Public report of block/buzz, published 14 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 14 November 2026, 15:12 UTC · Survey ID cd_5a9a9d6a74af4c5d808149e6d86892f7

block/buzz

Measured 14 November 2026, 15:09 UTC, at code version 5780bd7

CAI score 55out of 100 At risk Up 7 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A very large codebase: 1,143,444 lines of product code in 45 projects, tests not counted · Estimated rebuild effort: about 11.8 person-years · Weakest lens: Architecture, 46

Findings by how serious they are

73 critical 4983 serious 218 minor

24 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 15:09 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

86of 86 dimensions measured by tools.
5244of 5274 findings point to an exact file and line, so you can open each one in the code. The other 30 concern the repository as a whole, such as missing documentation.
86dimensions across 9 lenses, read from 1,143,444 lines of product code in 45 projects.
Chapters

Executive summary

block/buzz is rated At risk because critical security findings are open. Its score is held back in part because it has loops of files that import each other. It scores 55 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Architecture, at 46, is the weakest lens and counts most in the score. The best first step is breaking the import cycles, worth about 6 points. Separating the feature slices comes next, worth about 5 points. Raising Architecture to 67 would lift the score to about 60.

Sixteen known security holes in the packages the code depends on can be used by attackers. Nine weaknesses in the code could be used by an attacker, and nineteen form fields can't be read by a screen reader. Updating the vulnerable packages, fixing the weaknesses the scanner points to and labelling the form fields would close these risks. The three passwords or keys in the code and the password or key in the code's history need replacing, with the old ones switched off. The three unsafe settings in infrastructure or container files need changing to safe values. The eight controls that only work with a mouse need to work with the keyboard, or to become a real button.

The product code is 1,143,444 lines, about €1,700,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Architecture 46 · counts for 45%Accessibility 56 · counts for 25%Code Health 59 · counts for 14%Production Readiness 64 · counts for 8%Performance 69 · counts for 4%Security and Compliance 79 · counts for 2%Maturity 94 · counts for 1%Domain Modelling 100 · counts for 1%Event Sourcing 100 · counts for 0%

If Architecture rose from 46 to 67, the lowest score rated Strong, the score would rise from 55 to about 60.

Code composition: what the lines of code are
Product code 73%Tests 27%
New since the last survey: 1160 findings

These 1160 critical or serious findings weren't in the previous survey, on 27 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · ImageAvatarCapture.build (cyclomatic 114) mobile/lib/shared/widgets/image_avatar_capture.dart
  • Cyclomatic Complexity · AgentsPage.build (cyclomatic 99) mobile/lib/features/agents/agents_page.dart
  • Cyclomatic Complexity · _MessageImageStack.build (cyclomatic 71) mobile/lib/features/channels/message_content/media_stack.dart
  • Cyclomatic Complexity · _AddCommunityConnection.build (cyclomatic 58) mobile/lib/features/pairing/add_community_page/add_community_connection.dart
  • Cyclomatic Complexity · NativePhotoZoomCoordinator.init (cyclomatic 55) mobile/ios/Runner/NativePhotoZoomCoordinator.swift
  • Cyclomatic Complexity · _MeChatDraft.build (cyclomatic 53) mobile/lib/features/channels/me/me_chat_draft.dart
  • Cyclomatic Complexity · ReadStateManager._publishOnce (cyclomatic 53) mobile/lib/shared/read_state/read_state_manager.dart
  • Cyclomatic Complexity · HuddleTracker::apply (cyclomatic 52) crates/buzz-cli/src/commands/huddle_tracker.rs
  • Cyclomatic Complexity · CreateAgentPage.build (cyclomatic 50) mobile/lib/features/agents/create_agent_page.dart
  • Cyclomatic Complexity · NativePhotoZoomPreview.open (cyclomatic 50) mobile/lib/features/channels/native_photo_zoom_preview.dart
  • Cyclomatic Complexity · AdaptiveConversationPane.build (cyclomatic 50) mobile/lib/shared/widgets/adaptive_conversation_pane.dart
  • Cyclomatic Complexity · buzz_relay::handlers::req::handle_admitted_req (cyclomatic 48) crates/buzz-relay/src/handlers/req.rs
  • Cyclomatic Complexity · _ToastBubble.build (cyclomatic 47) mobile/lib/shared/widgets/buzz_toast.dart
  • Cyclomatic Complexity · PresetAgentAvatar.build (cyclomatic 47) mobile/lib/shared/widgets/preset_agent_avatar.dart
  • Cyclomatic Complexity · AgentAvatarPicker.build (cyclomatic 43) mobile/lib/features/agents/agent_avatar_picker.dart
  • Cyclomatic Complexity · HomePage.build (cyclomatic 43) mobile/lib/features/home/home_page.dart
  • Cyclomatic Complexity · ProfileAvatarCropPage.build (cyclomatic 43) mobile/lib/shared/widgets/profile_avatar_crop_page.dart
  • Cyclomatic Complexity · ConcentricSheetSurface.build (cyclomatic 33) mobile/lib/shared/widgets/concentric_sheet_surface.dart
  • Cyclomatic Complexity · OnboardingStepPage.build (cyclomatic 33) mobile/lib/shared/widgets/onboarding_step_page.dart
  • Cyclomatic Complexity · AppDelegate.handleQrScannerMethodCall (cyclomatic 32) mobile/ios/Runner/AppDelegate.swift
  • Cyclomatic Complexity · IosNavigationBarView.layout (cyclomatic 32) mobile/ios/Runner/IosNavigationBar.swift
  • Cyclomatic Complexity · _ProfileSetupForm.build (cyclomatic 32) mobile/lib/features/profile/profile_setup_page/form.dart
  • Cyclomatic Complexity · DefaultAgentLauncher.build (cyclomatic 30) mobile/lib/features/channels/default_agent_launcher.dart
  • Cyclomatic Complexity · buzz_relay::api::artifact_sync::execute (cyclomatic 29) crates/buzz-relay/src/api/artifact_sync.rs
  • Cyclomatic Complexity · _MarkdownEditingController._snapSelectionToChips (cyclomatic 29) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart
  • Cyclomatic Complexity · RemoteAgentController.create (cyclomatic 29) mobile/lib/shared/agents/remote_agents.dart
  • Cyclomatic Complexity · IosNavigationMetrics.updateRail (cyclomatic 29) mobile/lib/shared/widgets/ios_navigation_metrics.dart
  • Cyclomatic Complexity · bees.stepBees (cyclomatic 29) web/src/features/invite/ui/bees.ts
  • Cyclomatic Complexity · OrganizationAppEntry.build (cyclomatic 28) mobile/lib/organization_app_entry.dart
  • Cyclomatic Complexity · ReplySummaryLink.build (cyclomatic 28) mobile/lib/features/channels/reply_summary_link.dart
  • Cyclomatic Complexity · MembersSheet.build (cyclomatic 26) mobile/lib/features/channels/members_sheet.dart
  • Cyclomatic Complexity · HomeScreenShortcutHost.build (cyclomatic 26) mobile/lib/features/home/home_screen_shortcut_host.dart
  • Cyclomatic Complexity · HostedFlow.signInAccount (cyclomatic 26) mobile/lib/shared/hosted/hosted_flow.dart
  • Cyclomatic Complexity · _CreateMenuRoute.buildPage (cyclomatic 26) mobile/lib/shared/widgets/android_expanding_menu_button.dart
  • Cyclomatic Complexity · NativePhotoZoomViewController.layoutGallery (cyclomatic 25) mobile/ios/Runner/NativePhotoZoomCoordinator.swift
  • Cyclomatic Complexity · _ConversationAppBarTitle.build (cyclomatic 25) mobile/lib/features/channels/channel_detail_page/app_bar.dart
  • Cyclomatic Complexity · buzz_db::store::event::push_event_filters (cyclomatic 24) crates/buzz-db/src/store/event.rs
  • Cyclomatic Complexity · buzz_desktop::commands::personas::update::update_persona_with (cyclomatic 24) desktop/src-tauri/src/commands/personas/update.rs
  • Cyclomatic Complexity · BestieAgentAction.build (cyclomatic 24) mobile/lib/features/agents/bestie_agent_action.dart
  • Cyclomatic Complexity · RemoteAgentController.deleteAgent (cyclomatic 24) mobile/lib/shared/agents/remote_agents.dart
  • Cyclomatic Complexity · _BuzzPushLifecycle.build (cyclomatic 24) mobile/lib/shared/push/push_bootstrap.dart
  • Cyclomatic Complexity · Db::media_access (cyclomatic 23) crates/buzz-db/src/store/media.rs
  • Cyclomatic Complexity · _AgentsNavigation.build (cyclomatic 22) mobile/lib/features/agents/agents_page.dart
  • Cyclomatic Complexity · _ReadOnlyNotice.build (cyclomatic 22) mobile/lib/features/channels/channel_detail_page/banners.dart
  • Cyclomatic Complexity · buzz_db::store::partition::maintenance::attempt_change (cyclomatic 21) crates/buzz-db/src/store/partition/maintenance.rs
  • Cyclomatic Complexity · buzz_relay::handlers::side_effects::persist_put_user (cyclomatic 21) crates/buzz-relay/src/handlers/side_effects.rs
  • Cyclomatic Complexity · WorkflowEngine::cron_tick (cyclomatic 21) crates/buzz-workflow/src/lib.rs
  • Cyclomatic Complexity · buzz_desktop::commands::channels::ensure_starter_channels_inner (cyclomatic 21) desktop/src-tauri/src/commands/channels.rs
  • Cyclomatic Complexity · NativeCreateChannelViewController.tableView (cyclomatic 21) mobile/ios/Runner/NativeCreateChannelSheet.swift
  • Cyclomatic Complexity · BuilderlabBuild.parse (cyclomatic 21) mobile/lib/shared/hosted/builderlab_build.dart
  • Cyclomatic Complexity · buzz_relay::connection::handle_text_message (cyclomatic 20) crates/buzz-relay/src/connection.rs
  • Cyclomatic Complexity · buzz_relay::handlers::artifact_sync::handle_sync (cyclomatic 20) crates/buzz-relay/src/handlers/artifact_sync.rs
  • Cyclomatic Complexity · _ChannelsBody.build (cyclomatic 20) mobile/lib/features/channels/channels_page/body.dart
  • Cyclomatic Complexity · MobileHuddleController._finishLeaveLifecycle (cyclomatic 20) mobile/lib/features/channels/mobile_huddle_controller.dart
  • Cyclomatic Complexity · _VideoFileDownload._fetch (cyclomatic 20) mobile/lib/features/channels/native_video_files.dart
  • Cyclomatic Complexity · ChannelData.fromEvent (cyclomatic 20) mobile/lib/shared/relay/nostr_models.dart
  • Cyclomatic Complexity · AndroidTransparentAvatar.build (cyclomatic 20) mobile/lib/shared/widgets/android_transparent_avatar.dart
  • Cyclomatic Complexity · IosMessageCreateButton.build (cyclomatic 20) mobile/lib/shared/widgets/ios_message_create_button.dart
  • Cyclomatic Complexity · buzz_relay::api::bridge::membership_snapshot::query (cyclomatic 19) crates/buzz-relay/src/api/bridge/membership_snapshot.rs
  • Cyclomatic Complexity · IosNavigationBarView.reportRailGeometry (cyclomatic 19) mobile/ios/Runner/IosNavigationBar.swift
  • Cyclomatic Complexity · NativeAddMembersViewController.configure (cyclomatic 19) mobile/ios/Runner/NativeAddMembersSheet.swift
  • Cyclomatic Complexity · _IOSAttachmentPopoverCoordinator.present (cyclomatic 19) mobile/lib/features/channels/compose_bar/ios_attachment_popover.dart
  • Cyclomatic Complexity · SettingsPage.build (cyclomatic 19) mobile/lib/features/settings/settings_page.dart
  • Cyclomatic Complexity · CoveredRouteKeyboardInsets.build (cyclomatic 19) mobile/lib/shared/widgets/covered_route_keyboard_insets.dart
  • Cyclomatic Complexity · FilterChipBar._chip (cyclomatic 19) mobile/lib/shared/widgets/filter_chip_bar.dart
  • Cyclomatic Complexity · newAppInstallerDownload.reduceInstallerDialog (cyclomatic 19) desktop/src/app/newAppInstallerDownload.ts
  • Cyclomatic Complexity · Db::set_community_nip_fi_policy (cyclomatic 18) crates/buzz-db/src/store/community_auth.rs
  • Cyclomatic Complexity · buzz_db::store::channel::apply_channel_metadata_event (cyclomatic 18) crates/buzz-db/src/store/channel.rs
  • Cyclomatic Complexity · buzz_db::store::thread::get_channel_window_on (cyclomatic 18) crates/buzz-db/src/store/thread.rs
  • Cyclomatic Complexity · buzz_pubsub::subscriber::connect_and_subscribe (cyclomatic 18) crates/buzz-pubsub/src/subscriber.rs
  • Cyclomatic Complexity · buzz_relay::api::media::upload_blob_result (cyclomatic 18) REDACTED
  • Cyclomatic Complexity · buzz_relay::handlers::community_provisioning::provision_community (cyclomatic 18) crates/buzz-relay/src/handlers/community_provisioning.rs
  • Cyclomatic Complexity · NativePhotoZoomViewController.load (cyclomatic 18) mobile/ios/Runner/NativePhotoZoomCoordinator.swift
  • Cyclomatic Complexity · DeleteAgentAction.build (cyclomatic 18) mobile/lib/features/agents/delete_agent_action.dart
  • Cyclomatic Complexity · RemoteAgentModelControl.build (cyclomatic 18) mobile/lib/features/agents/remote_agent_model_control.dart
  • Cyclomatic Complexity · _MemberTile.build (cyclomatic 18) mobile/lib/features/channels/members_sheet.dart
  • Cyclomatic Complexity · _WebsiteBeeMotion.advance (cyclomatic 18) mobile/lib/features/pairing/pairing_page/website_bee_motion.dart
  • Cyclomatic Complexity · RemoteAgentController.ensureBinding (cyclomatic 18) mobile/lib/shared/agents/remote_agents.dart
  • Cyclomatic Complexity · VerifiedProfilesNotifier._syncBatches (cyclomatic 18) mobile/lib/shared/verified_profiles/verified_profile_directory.dart
  • Cyclomatic Complexity · NewAppInstallerDialog.NewAppInstallerDialog (cyclomatic 18) desktop/src/app/NewAppInstallerDialog.tsx
  • Cyclomatic Complexity · newAppInstaller.resolveInstallerUrl (cyclomatic 18) desktop/src/app/newAppInstaller.ts
  • Cyclomatic Complexity · ChannelBrowserDialog.selectBrowserChannels (cyclomatic 18) desktop/src/features/channels/ui/ChannelBrowserDialog.tsx
  • Cyclomatic Complexity · BeeField.BeeField (cyclomatic 18) web/src/features/invite/ui/BeeField.tsx
  • Cyclomatic Complexity · buzz_cli::commands::messages::cmd_send_message (cyclomatic 17) crates/buzz-cli/src/commands/messages.rs
  • Cyclomatic Complexity · buzz_core::media::reference_hashes (cyclomatic 17) crates/buzz-core/src/media.rs
  • Cyclomatic Complexity · buzz_db::store::media::media_reference_query (cyclomatic 17) crates/buzz-db/src/store/media.rs
  • Cyclomatic Complexity · buzz_relay::handlers::artifact_sync::run_live (cyclomatic 17) crates/buzz-relay/src/handlers/artifact_sync.rs
  • Cyclomatic Complexity · buzz_sdk::builders::build_update_channel (cyclomatic 17) crates/buzz-sdk/src/builders.rs
  • Cyclomatic Complexity · MobileInviteJoinRecovery.ensureStarterChannels (cyclomatic 17) mobile/lib/app.dart
  • Cyclomatic Complexity · AgentModelPicker.build (cyclomatic 17) mobile/lib/features/agents/agent_model_picker.dart
  • Cyclomatic Complexity · _DeepLinkDispatcherState._maybeDispatch (cyclomatic 17) mobile/lib/features/channels/deep_link_dispatcher.dart
  • Cyclomatic Complexity · ReplyActivityHandoff.build (cyclomatic 17) mobile/lib/features/channels/reply_activity_handoff.dart
  • Cyclomatic Complexity · HostedJoinPolicyView.build (cyclomatic 17) mobile/lib/features/onboarding/hosted_join_policy_view.dart
  • Cyclomatic Complexity · SearchPage.build (cyclomatic 17) mobile/lib/features/search/search_page.dart
  • Cyclomatic Complexity · BrowserAuth.start (cyclomatic 17) mobile/lib/shared/hosted/browser_auth.dart
  • Cyclomatic Complexity · ReadStateManager._mergeEvents (cyclomatic 17) mobile/lib/shared/read_state/read_state_manager.dart
  • Cyclomatic Complexity · buzz_relay::handlers::media_access::validate_media_references (cyclomatic 16) crates/buzz-relay/src/handlers/media_access.rs
  • Cyclomatic Complexity · buzz_relay::nip11::nip11_document (cyclomatic 16) crates/buzz-relay/src/nip11.rs
  • Cyclomatic Complexity · buzz_desktop::relay::profile_avatar::localize_avatar_url (cyclomatic 16) desktop/src-tauri/src/relay/profile_avatar.rs
  • Cyclomatic Complexity · _CreateChannelSheet.build (cyclomatic 16) mobile/lib/features/channels/channels_page/sheets.dart

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 4251 findings

These 4251 critical or serious findings were in the previous survey, on 27 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · ImageAvatarCapture.build (cyclomatic 114) mobile/lib/features/profile/image_avatar_capture.dart
  • Cyclomatic Complexity · buzz_relay::handlers::req::handle_req (cyclomatic 48) crates/buzz-relay/src/handlers/req.rs
  • Cyclomatic Complexity · buzz_db::store::event::build_query_events_sql (cyclomatic 37) crates/buzz-db/src/store/event.rs
  • Cyclomatic Complexity · _NewMeChat.build (cyclomatic 35) mobile/lib/features/channels/me/new_me_chat.dart
  • Cyclomatic Complexity · ProfileAvatarCropPage.build (cyclomatic 30) mobile/lib/features/profile/profile_avatar_crop_page.dart
  • Cyclomatic Complexity · buzz_relay::emit_db_usage_metrics (cyclomatic 28) crates/buzz-relay/src/main.rs
  • Cyclomatic Complexity · _OnboardingConnectionView.build (cyclomatic 28) mobile/lib/features/pairing/pairing_page/onboarding_connection_view.dart
  • Cyclomatic Complexity · ChannelsNotifier._catchUpUnreadEvents (cyclomatic 27) mobile/lib/features/channels/channels_provider.dart
  • Cyclomatic Complexity · SubscriptionRegistry::remove_from_index (cyclomatic 26) crates/buzz-relay/src/subscription.rs
  • Cyclomatic Complexity · NativeProfileTextEditorViewController.tableView (cyclomatic 26) mobile/ios/Runner/NativeProfileTextEditor.swift
  • Cyclomatic Complexity · ChannelQuickActionsLauncher.build (cyclomatic 26) mobile/lib/features/channels/channels_page/quick_actions_launcher.dart
  • Cyclomatic Complexity · desktop_release.validate (cyclomatic 25) scripts/desktop_release.py
  • Cyclomatic Complexity · desktop_release.previous_release (cyclomatic 23) scripts/desktop_release.py
  • Cyclomatic Complexity · NativeAddMembersViewController.tableView (cyclomatic 23) mobile/ios/Runner/NativeAddMembersSheet.swift
  • Cyclomatic Complexity · BuzzPushBootstrap.build (cyclomatic 23) mobile/lib/shared/push/push_bootstrap.dart
  • Cyclomatic Complexity · WorkflowEngine::run (cyclomatic 22) crates/buzz-workflow/src/lib.rs
  • Cyclomatic Complexity · buzz_db::store::partition::maintenance::apply_change (cyclomatic 21) crates/buzz-db/src/store/partition/maintenance.rs
  • Cyclomatic Complexity · buzz_desktop::relay::profile_avatar::localize_avatar (cyclomatic 21) desktop/src-tauri/src/relay/profile_avatar.rs
  • Cyclomatic Complexity · ProfileTextEditSheet.build (cyclomatic 21) mobile/lib/features/profile/profile_text_edit_sheet.dart
  • Cyclomatic Complexity · buzz_relay::handlers::side_effects::apply_put_user (cyclomatic 20) crates/buzz-relay/src/handlers/side_effects.rs
  • Cyclomatic Complexity · buzz_core::artifact::parse_query (cyclomatic 18) crates/buzz-core/src/artifact.rs
  • Cyclomatic Complexity · BuzzBrowserAuthBridge.init (cyclomatic 18) mobile/ios/Runner/AppDelegate.swift
  • Cyclomatic Complexity · ReadStateManager._handleIncomingEvent (cyclomatic 18) mobile/lib/shared/read_state/read_state_manager.dart
  • Cyclomatic Complexity · buzz_relay::handlers::side_effects::handle_standard_deletion_event (cyclomatic 17) crates/buzz-relay/src/handlers/side_effects.rs
  • Cyclomatic Complexity · _MorphingQuickActionsButton.build (cyclomatic 17) mobile/lib/features/channels/channels_page/quick_actions.dart
  • Cyclomatic Complexity · BuzzClient::submit_moderation_event (cyclomatic 16) crates/buzz-cli/src/client.rs
  • Cyclomatic Complexity · generate-dev-icon.swift.top-level code (cyclomatic 16) scripts/generate-dev-icon.swift
  • Cyclomatic Complexity · ChannelMessagesNotifier.cachedThreadReplyIds (cyclomatic 16) mobile/lib/features/channels/channel_messages_provider.dart
  • Cyclomatic Complexity · useSearchMenuKeyboardNavigation.useSearchMenuKeyboardNavigation (cyclomatic 16) desktop/src/features/search/ui/useSearchMenuKeyboardNavigation.ts
  • Cognitive Complexity · ImageAvatarCapture.build (cognitive 158) mobile/lib/features/profile/image_avatar_capture.dart
  • Cognitive Complexity · buzz_relay::handlers::req::handle_req (cognitive 87) crates/buzz-relay/src/handlers/req.rs
  • Cognitive Complexity · SubscriptionRegistry::remove_from_index (cognitive 78) crates/buzz-relay/src/subscription.rs
  • Cognitive Complexity · WorkflowEngine::run (cognitive 60) crates/buzz-workflow/src/lib.rs
  • Cognitive Complexity · buzz_relay::handlers::side_effects::handle_standard_deletion_event (cognitive 54) crates/buzz-relay/src/handlers/side_effects.rs
  • Cognitive Complexity · ChannelsNotifier._catchUpUnreadEvents (cognitive 54) mobile/lib/features/channels/channels_provider.dart
  • Cognitive Complexity · buzz_relay::emit_db_usage_metrics (cognitive 42) crates/buzz-relay/src/main.rs
  • Cognitive Complexity · _NewMeChat.build (cognitive 38) mobile/lib/features/channels/me/new_me_chat.dart
  • Cognitive Complexity · ProfileAvatarCropPage.build (cognitive 34) mobile/lib/features/profile/profile_avatar_crop_page.dart
  • Cognitive Complexity · buzz_relay::handlers::side_effects::apply_put_user (cognitive 32) crates/buzz-relay/src/handlers/side_effects.rs
  • Cognitive Complexity · NativeAddMembersViewController.tableView (cognitive 32) mobile/ios/Runner/NativeAddMembersSheet.swift
  • Cognitive Complexity · _OnboardingConnectionView.build (cognitive 32) mobile/lib/features/pairing/pairing_page/onboarding_connection_view.dart
  • Cognitive Complexity · BuzzPushBootstrap.build (cognitive 30) mobile/lib/shared/push/push_bootstrap.dart
  • Cognitive Complexity · _MorphingQuickActionsButton.build (cognitive 27) mobile/lib/features/channels/channels_page/quick_actions.dart
  • Cognitive Complexity · ChannelQuickActionsLauncher.build (cognitive 27) mobile/lib/features/channels/channels_page/quick_actions_launcher.dart
  • Cognitive Complexity · desktop_release.validate (cognitive 26) scripts/desktop_release.py
  • Cognitive Complexity · buzz_core::artifact::parse_query (cognitive 25) crates/buzz-core/src/artifact.rs
  • Cognitive Complexity · buzz_desktop::relay::profile_avatar::localize_avatar (cognitive 25) desktop/src-tauri/src/relay/profile_avatar.rs
  • Cognitive Complexity · SubscriptionRegistry::register_with_scope (cognitive 24) crates/buzz-relay/src/subscription.rs
  • Cognitive Complexity · ProfileTextEditSheet.build (cognitive 24) mobile/lib/features/profile/profile_text_edit_sheet.dart
  • Cognitive Complexity · buzz_relay::run_usage_metrics_tick (cognitive 23) crates/buzz-relay/src/main.rs
  • Cognitive Complexity · desktop_release.previous_release (cognitive 23) scripts/desktop_release.py
  • Cognitive Complexity · ChannelMessagesNotifier.cachedThreadReplyIds (cognitive 23) mobile/lib/features/channels/channel_messages_provider.dart
  • Cognitive Complexity · useAnchoredScroll.useAnchoredScroll.scrollToMessage (cognitive 22) desktop/src/features/messages/ui/useAnchoredScroll.ts
  • Cognitive Complexity · buzz_db::store::channel_members::put_members (cognitive 21) crates/buzz-db/src/store/channel_members.rs
  • Cognitive Complexity · check-file-sizes-core.runFileSizeCheck (cognitive 21) scripts/check-file-sizes-core.mjs
  • Cognitive Complexity · rehypeSearchHighlight.rehypeSearchHighlight (cognitive 21) desktop/src/shared/lib/rehypeSearchHighlight.ts
  • Cognitive Complexity · generate-dev-icon.swift.top-level code (cognitive 20) scripts/generate-dev-icon.swift
  • Cognitive Complexity · ReadStateManager._handleIncomingEvent (cognitive 20) mobile/lib/shared/read_state/read_state_manager.dart
  • Cognitive Complexity · buzz_relay::handlers::event::filter_fanout_by_access (cognitive 19) crates/buzz-relay/src/handlers/event.rs
  • Cognitive Complexity · BuzzPushSnapshotBridge.syncCommunities (cognitive 19) mobile/ios/Runner/PushSnapshotBridge.swift
  • Cognitive Complexity · HostedRelayAuth.headers (cognitive 19) mobile/lib/shared/hosted/hosted_relay_auth.dart
  • Cognitive Complexity · RelaySessionNotifier._postForEvents (cognitive 19) mobile/lib/shared/relay/relay_session.dart
  • Cognitive Complexity · NativeMessagePresentation.present (cognitive 18) mobile/lib/shared/widgets/native_message_presentation.dart
  • Cognitive Complexity · buzz_db::store::partition::maintenance::apply_change (cognitive 17) crates/buzz-db/src/store/partition/maintenance.rs
  • Cognitive Complexity · BuzzBrowserAuthBridge.init (cognitive 17) mobile/ios/Runner/AppDelegate.swift
  • Cognitive Complexity · buzz_relay::handlers::ingest::validate_edit_ownership (cognitive 16) crates/buzz-relay/src/handlers/ingest.rs
  • Cognitive Complexity · NotificationService.didReceive (cognitive 16) mobile/ios/NotificationService/NotificationService.swift
  • Cognitive Complexity · NativeProfileTextEditorCoordinator.handle (cognitive 16) mobile/ios/Runner/NativeProfileTextEditor.swift
  • Cognitive Complexity · NativeProfileTextEditorViewController.setTapped (cognitive 16) mobile/ios/Runner/NativeProfileTextEditor.swift
  • Cognitive Complexity · MeUnreadChannelIds.build (cognitive 16) mobile/lib/features/channels/me/me_unread_provider.dart
  • Cognitive Complexity · check-px-text-core.runPxTextCheck (cognitive 16) scripts/check-px-text-core.mjs
  • God Classes · MethodTooLong: ImageAvatarCapture.build mobile/lib/features/profile/image_avatar_capture.dart
  • God Classes · FunctionTooLong: buzz_relay::handlers::req::handle_req crates/buzz-relay/src/handlers/req.rs
  • God Classes · MethodTooLong: ProfileAvatarCropPage.build mobile/lib/features/profile/profile_avatar_crop_page.dart
  • God Classes · FunctionTooLong: buzz_relay::emit_db_usage_metrics crates/buzz-relay/src/main.rs
  • God Classes · MethodTooLong: _EmojiMode.build mobile/lib/features/profile/profile_avatar_editor/emoji_avatar_picker.dart
  • God Classes · MethodTooLong: _MorphingQuickActionsButton.build mobile/lib/features/channels/channels_page/quick_actions.dart
  • God Classes · MethodTooLong: _NewMeChat.build mobile/lib/features/channels/me/new_me_chat.dart
  • God Classes · MethodTooLong: BuzzPushBootstrap.build mobile/lib/shared/push/push_bootstrap.dart
  • God Classes · MethodTooLong: WorkflowEngine.run crates/buzz-workflow/src/lib.rs
  • God Classes · FunctionTooLong: buzz_db::store::channel_members::put_members crates/buzz-db/src/store/channel_members.rs
  • God Classes · FunctionTooLong: buzz_db::store::event::build_query_events_sql crates/buzz-db/src/store/event.rs
  • God Classes · FunctionTooLong: buzz_db::store::relay_invite::claim_relay_invite crates/buzz-db/src/store/relay_invite.rs
  • God Classes · FunctionTooLong: buzz_db::store::partition::maintenance::apply_change crates/buzz-db/src/store/partition/maintenance.rs
  • God Classes · FileTooLong: Runner/NativeProfileTextEditor.swift mobile/ios/Runner/NativeProfileTextEditor.swift
  • God Classes · MethodTooLong: Db.replace_addressable_event crates/buzz-db/src/store/replaceable.rs
  • God Classes · MethodTooLong: ChannelQuickActionsLauncher.build mobile/lib/features/channels/channels_page/quick_actions_launcher.dart
  • God Classes · FunctionTooLong: buzz_desktop::relay::profile_avatar::localize_avatar desktop/src-tauri/src/relay/profile_avatar.rs
  • God Classes · ClassTooLong: ImageAvatarCapture mobile/lib/features/profile/image_avatar_capture.dart
  • God Classes · MethodTooLong: GitAuth.from_request_parts crates/buzz-relay/src/api/git/transport.rs
  • God Classes · FunctionTooLong: buzz_relay::api::invites::claim_invite crates/buzz-relay/src/api/invites.rs
  • God Classes · MethodTooLong: NativeMessageMenuViewController.viewDidLoad mobile/ios/Runner/NativeMessageMenu.swift
  • God Classes · MethodTooLong: _EmojiPickerContent.build mobile/lib/features/channels/emoji_picker.dart
  • God Classes · ClassTooLong: ChannelBrowserDialog desktop/src/features/channels/ui/ChannelBrowserDialog.tsx
  • God Classes · FileTooLong: profile/image_avatar_capture.dart mobile/lib/features/profile/image_avatar_capture.dart
  • God Classes · MethodTooLong: NativeProfileSetupCoordinator.openAvatar mobile/ios/Runner/NativeProfileSetup.swift
  • God Classes · FunctionTooLong: buzz_relay::handlers::event::handle_agent_observer_event crates/buzz-relay/src/handlers/event.rs
  • God Classes · TooManyMethods: MediaUploadService mobile/lib/shared/relay/media_upload.dart
  • God Classes · FileTooLong: channels_page/community_switcher.dart mobile/lib/features/channels/channels_page/community_switcher.dart
  • God Classes · FunctionTooLong: buzz_cli::commands::mem::cmd_patch crates/buzz-cli/src/commands/mem.rs
Rebuild cost: about €1,700,000 · Estimate
Cost to rebuild€570,000 to €2,900,000, for 9,505 to 30,155 hours of work, about 11.8 person-years for 7 to 23 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 55. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 1,143,444 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Break each cycle by extracting the shared piece into a module both sides can import.
Raises the score by about 6 points · Medium effort · Circular Imports
2
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
Raises the score by about 5 points · Medium effort · Slice cohesion
3
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.
Raises the score by about 2 points · Low effort · Project Cohesion

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €1,700,000 to build again, about 11.8 person-years of work. Its weakest lens is Architecture, at 46 (Weak). Architecture is about whether the structure holds up as the product grows, and when the structure is weak, a change in one place ripples into many others. Because the weakest lens counts most in the score, work on Architecture also moves the score most.
Based on: the rebuild estimate · the Architecture grade · how much each lens counts
What to do: Start with the Architecture actions in Top priorities.
If you do one thing first · First action
Break each cycle by extracting the shared piece into a module both sides can import. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 10% on every change. The history of the code shows how much it changes: about 1,256,238 lines over the last 90 days, which is about 5,094,743 lines a year. At that pace, the extra work comes to an estimated 586 to 3515.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

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-audit->buzz-db 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-deletion->buzz-pubsub 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-search->buzz-db buzz-workflow->buzz-core buzz-workflow->buzz-db buzz-workflow->buzz-deletion sprig sprig sprig->buzz-acp sprig->buzz-dev-mcp __more__ +25 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

1299 modules, with 1623 dependencies between them. 16 loops run through 64 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1259 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 buzz_acp.config2 buzz_agent.types3 buzz_auth.nip_fi.assertion4 buzz_cli5 buzz_core.event6 buzz_core.private_managed_agent7 buzz_core.tenant8 buzz_desktop.managed_agents.types.teams9 buzz_pubsub.connection10 buzz_relay.config11 buzz_relay_mesh.wire12 desktop.src.shared.api.types13 buzz_acp.relay14 buzz_cli.error15 buzz_db.error16 buzz_db.runtime.admitted_tx17 buzz_desktop.managed_agents.types18 buzz_media.storage19 buzz_relay.audio.join20 desktop.src.features.agents.ui21 desktop.src.features.messages.lib22 buzz_acp.pool23 buzz_cli.client24 buzz_db.store.channel25 buzz_db.store.event26 buzz_desktop.managed_agents.global_config27 buzz_desktop.managed_agents.session_policy28 buzz_acp29 buzz_db.runtime30 buzz_desktop.app_state31 buzz_relay.mesh_boot32 buzz_relay.state33 buzz_relay.api.artifact_sync34 buzz_relay.connection35 buzz_relay.handlers.ingest36 buzz_relay.access37 buzz_relay.api.bridge38 buzz_relay.api.git.transport39 buzz_relay.api.media40 buzz_relay.audio.handler
1 buzz_acp.config
2 buzz_agent.types
3 buzz_auth.nip_fi.assertion
4 buzz_cli
5 buzz_core.event
6 buzz_core.private_managed_agent
7 buzz_core.tenant
8 buzz_desktop.managed_agents.types.teams
9 buzz_pubsub.connection
10 buzz_relay.config
11 buzz_relay_mesh.wire
12 desktop.src.shared.api.types
13 buzz_acp.relay22
14 buzz_cli.error1
15 buzz_db.error1
16 buzz_db.runtime.admitted_tx1
17 buzz_desktop.managed_agents.types3
18 buzz_media.storage2
19 buzz_relay.audio.join315
20 desktop.src.features.agents.ui1
21 desktop.src.features.messages.lib1
22 buzz_acp.pool34
23 buzz_cli.client2
24 buzz_db.store.channel11213
25 buzz_db.store.event21
26 buzz_desktop.managed_agents.global_config1
27 buzz_desktop.managed_agents.session_policy1
28 buzz_acp867
29 buzz_db.runtime21235
30 buzz_desktop.app_state1
31 buzz_relay.mesh_boot11521
32 buzz_relay.state7121111
33 buzz_relay.api.artifact_sync111
34 buzz_relay.connection2233
35 buzz_relay.handlers.ingest1211111
36 buzz_relay.access16113
37 buzz_relay.api.bridge113226
38 buzz_relay.api.git.transport14121
39 buzz_relay.api.media14121
40 buzz_relay.audio.handler11215211
Uses a module listed above itPart of a loopThe module itself
1 buzz_acp.config2 buzz_agent.types3 buzz_auth.nip_fi.assertion4 buzz_cli5 buzz_core.event6 buzz_core.private_managed_agent7 buzz_core.tenant8 buzz_desktop.managed_agents.types.teams9 buzz_pubsub.connection10 buzz_relay.config11 buzz_relay_mesh.wire12 desktop.src.shared.api.types13 buzz_acp.relay14 buzz_cli.error15 buzz_db.error16 buzz_db.runtime.admitted_tx17 buzz_desktop.managed_agents.types18 buzz_media.storage19 buzz_relay.audio.join20 desktop.src.features.agents.ui21 desktop.src.features.messages.lib22 buzz_acp.pool23 buzz_cli.client24 buzz_db.store.channel25 buzz_db.store.event26 buzz_desktop.managed_agents.global_config27 buzz_desktop.managed_agents.session_policy28 buzz_acp29 buzz_db.runtime30 buzz_desktop.app_state31 buzz_relay.mesh_boot32 buzz_relay.state33 buzz_relay.api.artifact_sync34 buzz_relay.connection35 buzz_relay.handlers.ingest36 buzz_relay.access37 buzz_relay.api.bridge38 buzz_relay.api.git.transport39 buzz_relay.api.media40 buzz_relay.audio.handlerbuzz_acp.config1buzz_agent.types2buzz_auth.nip_fi.assertion3buzz_cli4buzz_core.event5buzz_core.private_managed_agent6buzz_core.tenant7buzz_desktop.managed_agents.types.teams8buzz_pubsub.connection9buzz_relay.config10buzz_relay_mesh.wire11desktop.src.shared.api.types12buzz_acp.relay13buzz_cli.error14buzz_db.error15buzz_db.runtime.admitted_tx16buzz_desktop.managed_agents.types17buzz_media.storage18buzz_relay.audio.join19desktop.src.features.agents.ui20desktop.src.features.messages.lib21buzz_acp.pool22buzz_cli.client23buzz_db.store.channel24buzz_db.store.event25buzz_desktop.managed_agents.global_config26buzz_desktop.managed_agents.session_policy27buzz_acp28buzz_db.runtime29buzz_desktop.app_state30buzz_relay.mesh_boot31buzz_relay.state32buzz_relay.api.artifact_sync33buzz_relay.connection34buzz_relay.handlers.ingest35buzz_relay.access36buzz_relay.api.bridge37buzz_relay.api.git.transport38buzz_relay.api.media39buzz_relay.audio.handler402211132315113421121321118672123511152171211111112233121111116113113226141211412111215211+1259 more modules (most-connected shown)

At a glance — Code Health · 59% · Adequate · gated by D1, D2 ·

At a glance — Architecture · 46% · Weak · gated by R9, AX7 ·

At a glance — Maturity · 94% · Exemplary ·

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

At a glance — Security · 79% · Adequate · gated by D29 ·

At a glance — Domain Modelling · 100% · Exemplary ·

At a glance — Event Sourcing · 100% · Exemplary ·

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

At a glance — Performance · 69% · 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:2025 — Software Supply Chain Failures79High / Critical
A05:2025 — Injection65High / Critical
A02:2025 — Security Misconfiguration25High / Critical
A07:2025 — Authentication Failures5High / Critical

Roadmap

Top priorities: Break each cycle by extracting the shared piece into a module both sides can import; Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices; Resolve the 13 Off the main sequence finding(s) in Coupling.

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

Do thisHelpsEffortDimension
Break each cycle by extracting the shared piece into a module both sides can import.+5.6 ptsMediumCircular Imports
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.+5.3 ptsMediumSlice cohesion
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.+2.0 ptsLowProject Cohesion
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.+1.2 ptsLowREDACTED Scanning
Resolve the 13 Off the main sequence finding(s) in Coupling.+2.1 ptsMediumCoupling
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+1.7 ptsMediumKeyboard semantics
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+1.2 ptsMediumVisual & motion safety
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.+1.1 ptsMediumText alternatives

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.2SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.1SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.4SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED3.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx4.9MixedCyclomatic Complexity: AgentSessionTranscriptList.AgentSessionTranscriptList (cyclomatic 20)
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.4MixedStatic Analysis (SAST): Medium: REDACTED
mobile/lib/features/channels/channel_detail_page/message_bubble.dart5.5MixedCyclomatic Complexity: _MessageBubble.build (cyclomatic 52)
desktop/src-tauri/src/commands/agents.rs5.5MixedCyclomatic Complexity: buzz_desktop::commands::agents::create_managed_agent_in (cyclomatic 31)
desktop/src/features/onboarding/hooks.ts5.6MixedCyclomatic Complexity: hooks.useAppOnboardingState (cyclomatic 30)
desktop/src-tauri/src/app_state.rs5.6MixedCyclomatic Complexity: buzz_desktop::app_state::resolve_identity_with_store (cyclomatic 17)
mobile/lib/features/channels/thread_detail_page.dart5.6MixedCyclomatic Complexity: ThreadDetailPage.build (cyclomatic 174)

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

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

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

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

Could not be resolved — 24

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 86 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 86 dimensions across the health lenses
D1D2D3D4D5D6D7D10D13D14D15D16D17D19D20D21D24D26D28D29D30D31D34D35D36D37D40D41D43D44AC1AC2AC3AC4AC5AC6AX1AX10AX3AX5AX7AX8AX9DM4DM5DM6ES1ES2M1M2M3M4P1P10P2P3P4P5P6P7P8PF1PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X14X15X2X21X27X28X29X30X4X5

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, 5244 of 5274 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 or a scanner, 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
Canine Code Analyzer 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

Every finding is locatable in findings.md. Run 01a1da9b-5c42-7e03-bcb8-4f10711a0195.

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.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for desktop/ could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.4.0.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#…), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 8,508 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 818 test source file(s) (.py, .dart, .swift, .rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for admin-web/ could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.4.0.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#…), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in admin-web/ was NOT MEASURED: the dependency install for admin-web/ could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.4.0.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#…), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the node:test suite in desktop/ was NOT MEASURED: the dependency install for desktop/ could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.4.0.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#…), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 2 Maven/Gradle manifest(s) were read, stating a version for 3 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Dart pubspec.yaml, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Dart dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `admin-web/src/App.tsx`, `desktop/src/app/useAppShellDesktopNotifications.ts`, `desktop/src/features/agents/channelAgents.ts`, `desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx`, `desktop/src/features/agents/ui/activityRenderClasses/TranscriptActivityItem.tsx`, … (+29 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D41 Kernel & Syscall Confinement — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Deploy/charts/buzz-push-gateway/templates/deployment.yaml:2, deploy/charts/buzz-push-gateway/templates/migration-job.yaml:2, deploy/charts/buzz/templates/deployment.yaml:3, REDACTED:4, REDACTED:24, REDACTED:11, deploy/charts/buzz/templates/storage-accounting-cronjob.yaml:3 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AX7 Slice cohesion — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1460 further occurrence(s) are not listed individually; the score already reflects all 1500.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 1 — a container did not start, exited, or never became healthy) — container buzz-minio-init exited (1); runtime evidence skipped.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 726 further occurrence(s) are not listed individually; the score already reflects all 766.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 697 further occurrence(s) are not listed individually; the score already reflects all 737.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 180 further occurrence(s) are not listed individually; the score already reflects all 220.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
  • R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 95 further occurrence(s) are not listed individually; the score already reflects all 135.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 229 further occurrence(s) are not listed individually; the score already reflects all 269.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X26 Unsynchronised callback handoff — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 263 further occurrence(s) are not listed individually; the score already reflects all 303.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 432 further occurrence(s) are not listed individually; the score already reflects all 472.
  • X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 4 further occurrence(s) are not listed individually; the score already reflects all 44.

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

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • 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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity3.8 / 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 3.8 / 10 · rule-coverage 100% · ceiling Prevented

796 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _MessageList.build at 219. A further 16 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. 11 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-relay/src/access.rs (AuthReason::as_str at 32), crates/buzz-cli/src/lib.rs (buzz_cli::run at 30), crates/buzz-cli/src/validate.rs (buzz_cli::validate::infer_language at 24), desktop/src-tauri/src/commands/admin/attachment.rs (buzz_desktop::commands::admin::attachment::attachment_file_name at 24), desktop/src-tauri/src/commands/admin/routes.rs (AdminRoute::path at 23), and 6 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_relay::handlers::ingest::ingest_event_inner (cyclomatic 162) · ×50crates/buzz-relay/src/handlers/ingest.rs:2684
buzz_desktop::huddle::tts::tts_worker (cyclomatic 71) · ×43desktop/src-tauri/src/huddle/tts.rs:322
buzz_db::store::partition::audit_table_on (cyclomatic 45) · ×14crates/buzz-db/src/store/partition.rs:622
buzz_acp::run_harness (cyclomatic 171) · ×13crates/buzz-acp/src/lib.rs:2877
buzz_agent::llm::openrouter_post (cyclomatic 36) · ×9crates/buzz-agent/src/llm.rs:2265

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

What to do

  1. Bring the 15 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with _MessageList.build (cyclomatic 219), ThreadDetailPage.build (cyclomatic 174), buzz_acp::run_harness (cyclomatic 171). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 15 together lifts Cyclomatic Complexity from 3.8 to about 4.7/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

buzz_desktop::huddle::playout::run_playout_recv_loop (cognitive 175) · ×108desktop/src-tauri/src/huddle/playout.rs:273
buzz_relay::audio::handler::run_active_audio_connection (cognitive 260) · ×81crates/buzz-relay/src/audio/handler.rs:580
buzz_acp::run_harness (cognitive 398) · ×27crates/buzz-acp/src/lib.rs:2877
buzz_db::store::partition::audit_table_on (cognitive 94) · ×21crates/buzz-db/src/store/partition.rs:622
buzz_agent::llm::openrouter_post (cognitive 86) · ×16crates/buzz-agent/src/llm.rs:2265

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

What to do

  1. Bring the 40 bodies over 120 down to 120 or less in Cognitive Complexity — start with buzz_acp::run_harness (cognitive 398), buzz_relay::audio::handler::run_active_audio_connection (cognitive 260), ProfileAvatarEditor.ProfileAvatarEditor (cognitive 250). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 40 together lifts Cognitive Complexity from 2.0 to about 3.3/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes7.2 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

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

1029 god class(es) detected.

FunctionTooLong: buzz_relay::audio::handler::run_active_audio_connection · ×513crates/buzz-relay/src/audio/handler.rs:580
FileTooLong: src/lib.rs · ×258crates/buzz-acp/src/lib.rs
MethodTooLong: _MessageList.build · ×144mobile/lib/features/channels/channel_detail_page/message_list.dart:60
ClassTooLong: DeletionStore · ×84REDACTED:771
TooManyMethods: Db · ×18crates/buzz-db/src/runtime/mod.rs:265

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

What to do

  1. Resolve the 513 FunctionTooLong finding(s) in God Classes — start with lib.rs (9), hooks.ts (6), markdown.tsx (5). — One of this dimension's main actionable groups (513 warning-level).
  2. Resolve the 258 FileTooLong finding(s) in God Classes — start with lib.rs (8), mod.rs (6), hooks.ts (4). — One of this dimension's main actionable groups (258 warning-level).
  3. Resolve the 144 MethodTooLong finding(s) in God Classes — start with REDACTED (3), message_list.dart (2), config.rs (2). — One of this dimension's main actionable groups (144 warning-level).

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

D4 · Code Duplication8.9 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

700 duplicated block group(s) detected. 2.7 % of the production lines (31,015 of 1,143,444) are in a reported copy. A further 454 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 4 of the 1154 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .tsx (16% 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) · ×47crates/buzz-acp/src/lib.rs:2938
Duplicated block (8 lines × 2) · ×43crates/buzz-acp/src/relay.rs:3486
Duplicated block (7 lines × 2) · ×40crates/buzz-acp/src/relay.rs:509
Duplicated block (11 lines × 2) · ×38crates/buzz-admin/src/main.rs:469
Duplicated block (9 lines × 2) · ×37crates/buzz-acp/src/lib.rs:3152

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

What to do

  1. Resolve the 47 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with lib.rs (4), queue.rs (2), mem.rs (2). — One of this dimension's main actionable groups (47 warning-level).
  2. Resolve the 43 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with channel_mutes_manager.dart (3), social.rs (2), mod.rs (2). — One of this dimension's main actionable groups (43 warning-level).
  3. Resolve the 40 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with relay.rs (2), channel_head_cache.rs (2), channels.rs (2). — One of this dimension's main actionable groups (40 warning-level).

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

45 production modules (Gradle+Cargo+npm+SwiftPM+pub), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 13 module(s) off the main sequence, with abstractness counted on 38 of the 45 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: buzz-audio-client · ×13

What to do

  1. Resolve the 13 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (13 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

2 of 316 classes have LCOM4 above 3.

Low cohesion: Provider (LCOM4 5) · ×2crates/buzz-cli/src/desktop_provider.rs:426

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with desktop_provider.rs, app_state.rs. — One of this dimension's main actionable groups (2 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 27 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

4 skipped, 16 zero-assertion, 5 synchronised by a fixed sleep, 2 racing the wall clock, no mocking-framework packages referenced (hand-written doubles or no mocking) across 8508 tests. Measured on the JavaScript/TypeScript suite only — at least 818 test source file(s) (.py, .dart, .swift, .rs) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: capture: add-community choices · ×16desktop/tests/e2e/add-community-screenshots.spec.ts:176
Fixed-sleep synchronisation: an orphaned metadata load is cancelled after its re-entry grace period · ×5desktop/src/shared/lib/useResolvedLinkPreviews.test.mjs:629
Skipped test: (unnamed test) · ×4desktop/tests/e2e/agents-everywhere.live.spec.ts:87
Races the wall clock: shows a large elapsed for a turn that started well in the past · ×2desktop/src/features/agents/activeAgentTurnsStore.test.mjs:1126

What to do

  1. Resolve the 16 No assertions finding(s) in Test Quality — start with channel-add-screenshots.spec.ts (4), add-community-screenshots.spec.ts (3), community-rail.spec.ts. — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 5 Fixed-sleep synchronisation finding(s) in Test Quality — start with audioMediaLoadScheduler.test.mjs (2), communityViewTransition.test.mjs (2), useResolvedLinkPreviews.test.mjs. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 4 Skipped test finding(s) in Test Quality — start with composer-link-shortcut.spec.ts (2), agents-everywhere.live.spec.ts, relay-restart.live.spec.ts. — One of this dimension's main actionable groups (4 warning-level).

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

3 secret(s) detected. 5 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

REDACTED

What to do

  1. Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).

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

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 1022 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 55 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json and a Dart pubspec.yaml, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.0 / 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 9.0 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: desktop/src/testing/e2eBridge.ts (52×616=32032); mobile/lib/features/channels/channel_detail_page.dart (68×121=8228); crates/buzz-relay/src/handlers/ingest.rs (43×162=6966) Repeated repair below the complexity floor: mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift (10 of 12 changes were fixes); mobile/lib/features/channels/channel_directory.dart (7 of 13 changes were fixes); mobile/ios/NotificationService/NotificationService.swift (7 of 9 changes were fixes)

Hotspot: desktop/src/testing/e2eBridge.ts · ×303desktop/src/testing/e2eBridge.ts:11467
Repeated repair: mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift · ×49mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:185

What to do

  1. Resolve the 303 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (4), config.rs (3), message_list.dart (2). — One of this dimension's main actionable groups (303 warning-level).
  2. Resolve the 49 Repeated repair finding(s) in Churn × Complexity Hotspots — start with BuzzPushNotificationResolver.swift, channel_directory.dart, NotificationService.swift. — One of this dimension's main actionable groups (49 warning-level).

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

D16 · Bus Factor9.0 / 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 9.0 / 10 · rule-coverage 100% · ceiling Documented

256 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 2514 of the 3560 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 18 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

18 deducted task-comment markers across 1143444 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 · ×16web/src/features/repos/use-repo-refs.ts:52
FixmeCommentdesktop/tests/e2e/navigation.spec.ts:126
HackCommentcrates/buzz-search/tests/postgres_fts_integration.rs:206

What to do

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

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

2 of 2 documentation facets pass in full. 117 document(s) read across 5 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality3.3 / 10Weak✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

2 of 3 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

ADR has no Context and Decision section · ×2docs/adr/0001-internal-and-public-mobile-builds.md:1detected by adr-integrity

What to do

  1. Resolve the 2 ADR has no Context and Decision section finding(s) in ADR Quality — start with 0001-internal-and-public-mobile-builds.md, 0002-notification-message-text.md. — One of this dimension's main actionable groups (2 recommendation-level).

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

D21 · Naming Consistency3.0 / 10Weak✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

3 naming inconsistencies among 43 declarations measured against a convention their peers follow.

`relayUrl` spells `Url` where 25 names in the project spell it `URL` · ×2mobile/ios/BuzzPushKit/Sources/BuzzPushKit/PushLease.swift:14
`isHTMLElement` spells `HTML` where 15 names in the project spell it `Html`desktop/src/shared/hooks/useWebviewScrollBoundaryLock.ts:8

What to do

  1. Resolve the 2 `relayUrl` spells `Url` where 25 names in the project spell it `URL` finding(s) in Naming Consistency — start with PushLease.swift (2). — One of this dimension's main actionable groups (2 recommendation-level).
  2. Resolve the 1 `isHTMLElement` spells `HTML` where 15 names in the project spell it… finding(s) in Naming Consistency — start with useWebviewScrollBoundaryLock.ts. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value9.8 9.6 / 10Exemplary✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

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

18 of 8940 judged comments only repeat the code they sit on (0.2 %). 210 comment(s) in another language or script were not judged.

redundant comment · ×18desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs:1397
doc comments repeat the namesdesktop/src/features/admin-console/AdminConsoleReportsTab.tsx:140

✓ On the Gold path — maintain.

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

D26 · Project Cohesion7.8 / 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.

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

5 of 45 build units (Cargo, Gradle, SwiftPM, Xcode, npm, pub) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

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.1 / 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.1 / 10 · rule-coverage 100% · ceiling Documented

65 finding(s): 0 critical, 10 high, 54 medium, 1 low. semgrep hit a parse error in 87 file(s) — `REDACTED` (lines 23–188), `admin-web/src/App.tsx` (lines 75–76), `bin/activate-hermit` (line 12), `bin/activate-hermit.fish` (lines 8–24), `crates/buzz-cli/src/desktop_provider.rs` (line 2227, line 2230, line 2259, …), … (+82 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

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

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 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 Vulnerabilities0.0 / 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 and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

78 finding(s): 4 critical, 12 high, 35 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

11 of 2514 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is desktop/src/shared/lib/datetime.ts. Counted over 2514 of the 3560 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×11desktop/src/shared/lib/datetime.ts:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.7 / 10Stronggated by 31 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.7 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: ChannelPane.types.ts↔ChannelScreen.tsx 86%; message_bubble.dart↔thread_message.dart 86%; TopbarSearch.tsx↔AppSidebar.tsx 80%

Change coupling: ChannelPane.types.ts ↔ ChannelScreen.tsx · ×24desktop/src/features/channels/ui/ChannelPane.types.ts:1
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 24 Change coupling finding(s) in Change Coupling — start with AgentSessionTranscriptList.tsx (2), ChannelPane.types.ts, message_bubble.dart. — One of this dimension's main actionable groups (24 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 — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

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 Confinement6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Documented

No workload manifest could be read as a pod spec, so no confinement was judged.

Detailed fixes: d41_recommendation.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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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-Life10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 4 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

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 & labels6.9 / 10Strong✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×10) — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:445, desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:690, desktop/src/features/admin-console/AdminConsoleCommunities.tsx:157, …
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×9) — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:629, desktop/src/features/agents/ui/AgentSessionToolItem/TodoToolSummary.tsx:96, desktop/src/features/agents/ui/agentConfigControls.tsx:547, …
  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — desktop/src/features/agents/ui/AgentCardMintDialog.tsx:306, desktop/src/features/agents/ui/RespondToField.tsx:501, desktop/src/features/settings/ui/SendFeedbackDialog.tsx:234
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×3) — desktop/src/features/channels/ui/MembersSidebarAgentControls.tsx:33, desktop/src/features/channels/ui/MembersSidebarMemberCard.tsx:364, desktop/src/features/forum/ui/DeleteActionMenu.tsx:27
  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×3) — desktop/src/features/forum/ui/ForumComposer.tsx:681, desktop/src/features/onboarding/ui/DefaultConfigStep.tsx:231, desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:454
  • This <video> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. (×2) — desktop/src/shared/ui/VideoPlayer.tsx:992, desktop/src/shared/ui/VideoPlayer.tsx:1698

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
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.6 / 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: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×4) — desktop/src/features/agents/ui/AgentSessionToolItem/ViewImageToolPreview.tsx:25, desktop/src/features/communities/ui/CommunityChangeOverlay.tsx:76, desktop/src/features/home/ui/InboxListPane.tsx:373, …
  • 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
  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. — previews/invite-video/index.html:60
  • This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×2) — web/src/features/invite/ui/InvitePage.tsx:294, web/src/features/invite/ui/InvitePage.tsx:351

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 safety5.1 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×4) — desktop/src/features/agents/ui/PersonaModelCombobox.tsx:159, desktop/src/features/projects/ui/ProjectsSectionSearch.tsx:104, desktop/src/features/search/ui/SearchScopeControls.tsx:74, …
  • <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×6) — desktop/src/features/communities/ui/CommunitySwitcher.tsx:410, desktop/src/features/sidebar/ui/CommunityRail.tsx:123, desktop/src/features/sidebar/ui/CommunityRail.tsx:417, …
  • <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — desktop/src/features/messages/ui/ComposerAddressControls.tsx:353
  • This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. — desktop/src/features/settings/ui/MobilePairingCard.tsx:74
  • <div> moves — its `animate-[progress-indeterminate_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — desktop/src/shared/ui/progress.tsx:33
  • `.bubble` sets color: white on background-color: #087eff — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — previews/invite-video/preview.css:119
  • `.buzz-avatar-hue-scrubber` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — desktop/src/shared/styles/globals/animations.css:433
  • `.rich-text-composer .tiptap` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — desktop/src/shared/styles/globals/composer.css:97
  • `.video-volume-slider:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — desktop/src/shared/styles/globals/media-controls.css:11
  • `.sprout-arc-spinner` moves (`animation: sprout-arc-spinner-spin 500ms linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:2
  • `.buzz-poof-frame` moves (`animation: buzz-poof-frame 400ms linear both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:282
  • `.buzz-poof-frame-1` moves (`animation-name: buzz-poof-frame-1`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:294
  • `.buzz-poof-frame-2` moves (`animation-name: buzz-poof-frame-2`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:298
  • `.buzz-poof-frame-3` moves (`animation-name: buzz-poof-frame-3`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:302
  • `.buzz-poof-frame-4` moves (`animation-name: buzz-poof-frame-4`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:306
  • `.buzz-poof-frame-5` moves (`animation-name: buzz-poof-frame-5`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:310
  • `.buzz-sidebar-action-description__reel` moves (`animation: buzz-sidebar-action-description-roll-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:518
  • `.buzz-animated-count__slot[data-direction="up"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:577
  • `.buzz-animated-count__slot[data-direction="down"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-down 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:582
  • `.buzz-animated-count__symbol[data-direction="up"]` moves (`animation: buzz-animated-count-symbol-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:592
  • `.buzz-animated-count__symbol[data-direction="down"]` moves (`animation: buzz-animated-count-symbol-down 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:597
  • `.bee-sprite .bee-wing-left` moves (`animation-name: bee-wing-left-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:875
  • `.bee-sprite .bee-wing-right` moves (`animation-name: bee-wing-right-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:879
  • `.buzz-avatar-framing-slider-handle` moves (`transition: opacity 150ms ease, transform 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/avatar-framing.css:115
  • `.buzz-avatar-framing-slider-tip` moves (`transition: opacity 150ms ease, transform 150ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/avatar-framing.css:141
  • `.buzz-huddle-speaking-avatar::after` moves (`transition: opacity 80ms linear, transform 90ms cubic-bezier(0.2, 0, 0, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:195
  • `.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="forward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-forward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:530
  • `.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="backward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-backward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:535
  • `.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-down"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-down`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:561
  • `.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-up"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-up`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:566
  • `.record-card` moves (`transition: transform 180ms ease, box-shadow 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — admin-web/src/styles.css:279

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX1 · Captive dependencies7.7 / 10Strong✓ Tool-verified

Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.

Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.

  • `currentCommunityRoleProvider` is a keep-alive Riverpod provider and calls `ref.watch(communityMembershipProvider…)`, which is declared auto-dispose (mobile/lib/shared/community/community_membership_provider.dart:107). The keep-alive provider listens to it for the life of the ProviderContainer, so `communityMembershipProvider` is never disposed — the auto-dispose lifetime it declares never happens, and whatever it holds (a socket, a controller, a stale value) is kept for every later reader. Mark `communityMembershipProvider` keepAlive too, make `currentCommunityRoleProvider` auto-dispose, or read it per use outside build. — mobile/lib/shared/community/community_membership_provider.dart:119
  • `ownedCodexVoiceAgentsProvider` is a keep-alive Riverpod provider and calls `ref.watch(_voiceInventoryChangesProvider…)`, which is declared auto-dispose (mobile/lib/features/channels/dm_voice_agent_provider.dart:49). The keep-alive provider listens to it for the life of the ProviderContainer, so `_voiceInventoryChangesProvider` is never disposed — the auto-dispose lifetime it declares never happens, and whatever it holds (a socket, a controller, a stale value) is kept for every later reader. Mark `_voiceInventoryChangesProvider` keepAlive too, make `ownedCodexVoiceAgentsProvider` auto-dispose, or read it per use outside build. — mobile/lib/features/channels/dm_voice_agent_provider.dart:21

What to do

  • Riverpod: a keepAlive provider must only watch, listen to or read in build other keepAlive providers — mark the dependency @Riverpod(keepAlive: true) (or drop .autoDispose), make the consumer auto-dispose too, or read the dependency per use from a Notifier method instead of in build (riverpod_lint: only_use_keep_alive_inside_keep_alive).
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.

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 cohesion1.0 / 10Critical✓ 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.

  • `DirectActionsProvider` (slice 'admin-console') depends on `memberSearchLabel` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:248
  • `useAdminMemberSearch` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:617
  • `AdminMemberPicker` (slice 'admin-console') depends on `useMemberCandidates` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:664
  • `AdminMemberPicker` (slice 'admin-console') depends on `MemberSearchResult` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:717
  • `CommunitiesTab` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'. — desktop/src/features/admin-console/AdminConsoleCommunities.tsx:48
  • `AdminConsolePanel` (slice 'admin-console') depends on `useCommunities` from slice 'communities'. — desktop/src/features/admin-console/AdminConsolePanel.tsx:150
  • `formatTimestamp` (slice 'admin-console') depends on `formatRelativeTime` from slice 'forum'. — desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:263
  • `ReportsTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:702
  • `AdminConsoleSettingsCard` (slice 'admin-console') depends on `SettingsSectionHeader` from slice 'settings'. — desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:216
  • `StaffingTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:483
  • `mountCard` (slice 'admin-console') depends on `CommunitiesProvider` from slice 'communities'. — desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:161
  • `useIsManagedAgent` (slice 'agent-memory') depends on `useManagedAgentsQuery` from slice 'agents'. — desktop/src/features/agent-memory/hooks.ts:42
  • `invalidateAgentQueries` (slice 'agents') depends on `channelsQueryKey` from slice 'channels'. — desktop/src/features/agents/hooks.ts:157
  • `useUpdateManagedAgentMutation` (slice 'agents') depends on `updateCachedChannelMemberDisplayName` from slice 'channels'. — desktop/src/features/agents/hooks.ts:470
  • `useUpdateManagedAgentMutation` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'. — desktop/src/features/agents/hooks.ts:491
  • `useAttachManagedAgentToChannelMutation` (slice 'agents') depends on `upsertCachedChannelMember` from slice 'channels'. — desktop/src/features/agents/hooks.ts:723
  • `invalidatePersonaEditCaches` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'. — desktop/src/features/agents/lib/personaEditCaches.ts:21
  • `useAgentAvailabilityLookup` (slice 'agents') depends on `usePresenceQuery` from slice 'presence'. — desktop/src/features/agents/lib/useAgentAvailability.ts:43
  • `useAgentAvailabilityLookup` (slice 'agents') depends on `presenceQueryKey` from slice 'presence'. — desktop/src/features/agents/lib/useAgentAvailability.ts:48
  • `bootstrapManagedAgentRuntimePairs` (slice 'agents') depends on `loadCommunities` from slice 'communities'. — desktop/src/features/agents/managedAgentRuntimeHooks.ts:88
  • `clearActiveTurnsForAgentOnStop` (slice 'agents') depends on `loadActiveCommunityId` from slice 'communities'. — desktop/src/features/agents/managedAgentRuntimeHooks.ts:128
  • `projectChannelRequestListeners` (slice 'agents') depends on `ProjectChannelRequest` from slice 'projects'. — desktop/src/features/agents/observerRelayStore.ts:142
  • `processLiveObserverEvents` (slice 'agents') depends on `parseProjectChannelRequest` from slice 'projects'. — desktop/src/features/agents/observerRelayStore.ts:516
  • `AddAgentToChannelDialog` (slice 'agents') depends on `useChannelsQuery` from slice 'channels'. — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:41
  • `AddAgentToChannelDialog` (slice 'agents') depends on `useChannelMembersQuery` from slice 'channels'. — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:79
  • `AddCustomHarnessDialog` (slice 'agents') depends on `CustomHarnessForm` from slice 'settings'. — desktop/src/features/agents/ui/AddCustomHarnessDialog.tsx:29
  • `AddTeamToChannelDialog` (slice 'agents') depends on `useChannelsQuery` from slice 'channels'. — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:55
  • `AddTeamToChannelDialog` (slice 'agents') depends on `ProfileAvatar` from slice 'profile'. — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:190
  • `AgentCardViewerContent` (slice 'agents') depends on `useOpenDmMutation` from slice 'channels'. — desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:105
  • `AgentCardViewerContent` (slice 'agents') depends on `useUpsertCachedChannel` from slice 'channels'. — desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:106
  • `AgentConfigFields` (slice 'agents') depends on `SettingsOptionGroup` from slice 'settings'. — desktop/src/features/agents/ui/AgentConfigFields.tsx:1041
  • `AgentCreationPreview` (slice 'agents') depends on `DEFAULT_EMOJI_AVATAR_COLOR` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:85
  • `AgentCreationPreview` (slice 'agents') depends on `DEFAULT_CUSTOM_HUE` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:92
  • `AgentCreationPreview` (slice 'agents') depends on `DEFAULT_CUSTOM_SATURATION` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:94
  • `AgentCreationPreview` (slice 'agents') depends on `DEFAULT_CUSTOM_VALUE` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:96
  • `AgentCreationPreview` (slice 'agents') depends on `useEmojiMartThemeVars` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:105
  • `AgentCreationPreview` (slice 'agents') depends on `useAvatarUpload` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:119
  • `AgentCreationPreview` (slice 'agents') depends on `useEmojiMartStyles` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:128
  • `AgentCreationPreview` (slice 'agents') depends on `hsvToHex` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:159
  • `AgentCreationPreview` (slice 'agents') depends on `parseEmojiAvatarDataUrl` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:177

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
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.

DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

M1 · Documentation (README)8.7 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

M2 · Architecture documentation10.0 / 10Exemplary✓ 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.

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

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 21/30 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 4 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. (×2) — desktop/src-tauri/src/app_state.rs:183, desktop/src-tauri/src/app_state.rs:208
  • `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — desktop/src-tauri/src/app_state.rs:213

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
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.

PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene6.0 / 10Adequate✓ 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 each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • a busy-wait on the clock in `handleMockCommand` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — desktop/src/testing/e2eBridge.ts:12950
  • `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — desktop/test-loader-hooks.mjs:168, desktop/test-loader-hooks.mjs:184

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety7.2 / 10Strong✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

R10 · Code Duplication6.3 / 10Adequate✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 284 duplicated blocks under desktop/src/features/ have copies in at least two of the sibling directories admin-console, agents, channel-templates, channels, communities, community-members (+22 more sibling(s) not listed) — 144 of them are reported below, and 140 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 284 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 284 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 284 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49
  • 110 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 55 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 110 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 110 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 110 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/messages/ui/MessageReactions.tsx:371
  • 20 duplicated blocks under the repository root have copies in at least two of the sibling directories desktop, mobile, web — 13 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 20 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 20 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 20 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/shared/ui/card.tsx:133
  • 7 duplicated blocks under desktop/src/features/huddle/ have copies in at least two of the sibling directories components, hooks, lib — 4 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:42
  • 6 duplicated blocks under desktop/src/features/messages/ have copies in at least two of the sibling directories lib, ui — 2 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/messages/lib/useThreadFollows.ts:16
  • desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49 · desktop/src/features/settings/ui/EncryptedBackupCreator.tsx:19 — the two spans are one implementation copied and then locally edited — 1024 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49
  • desktop/src/features/sidebar/lib/useChannelMutes.ts:19 · desktop/src/features/sidebar/lib/useChannelStars.ts:19 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — desktop/src/features/sidebar/lib/useChannelMutes.ts:19
  • desktop/src/shared/ui/context-menu.tsx:13 · desktop/src/shared/ui/dropdown-menu.tsx:13 — the two spans are one implementation copied and then locally edited — 902 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/shared/ui/context-menu.tsx:13
  • desktop/src/features/projects/ui/ProjectsIssuesList.tsx:196 · desktop/src/features/projects/ui/ProjectsPullRequestsList.tsx:203 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — desktop/src/features/projects/ui/ProjectsIssuesList.tsx:196
  • desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119 · desktop/src/features/agents/ui/PersonaAdvancedFields.tsx:100 — the two spans are one implementation copied and then locally edited — 607 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119
  • desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277 · desktop/src/features/settings/ui/BackupTestFlow.tsx:160 — the two spans are one implementation copied and then locally edited — 823 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277
  • desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114 · desktop/src/features/workflows/ui/WorkflowMessagePicker.tsx:195 — the two spans are one implementation copied and then locally edited — 720 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114
  • desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:120 · desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:233 — the two spans are one implementation copied and then locally edited — 666 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:120
  • desktop/src/features/sidebar/lib/channelMutesSync.ts:1 · desktop/src/features/sidebar/lib/channelStarsSync.ts:1 — these 2 files are line-for-line copies of one another — 152 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — desktop/src/features/sidebar/lib/channelMutesSync.ts:1
  • desktop/src/features/agents/ui/AgentSnapshotImportDialog.tsx:24 · desktop/src/features/agents/ui/TeamSnapshotImportDialog.tsx:22 — the two spans are one implementation copied and then locally edited — 629 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/AgentSnapshotImportDialog.tsx:24
  • desktop/src/features/projects/ui/IssueAssigneesRow.tsx:31 · desktop/src/features/projects/ui/PullRequestReviewersRow.tsx:38 — the two spans are one implementation copied and then locally edited — 652 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/projects/ui/IssueAssigneesRow.tsx:31
  • desktop/src/shared/theme/ThemePreviewFrame.tsx:63 · desktop/src/shared/theme/ThemePreviewFrame.tsx:267 — the two spans are one implementation copied and then locally edited — 565 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/shared/theme/ThemePreviewFrame.tsx:63
  • desktop/src/features/channels/ui/MembersSidebar.tsx:268 · desktop/src/features/messages/ui/useNewMessageRecipients.ts:102 — the two spans are one implementation copied and then locally edited — 598 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/channels/ui/MembersSidebar.tsx:268
  • desktop/src/features/sidebar/lib/channelMutesStorage.ts:2 · desktop/src/features/sidebar/lib/channelStarsStorage.ts:2 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — desktop/src/features/sidebar/lib/channelMutesStorage.ts:2
  • desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:52 · desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:92 — the two spans are one implementation copied and then locally edited — 607 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:52
  • desktop/src/features/agents/ui/usePersonaActions.ts:70 · desktop/src/features/agents/ui/useTeamActions.ts:66 — the two spans are one implementation copied and then locally edited — 647 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/usePersonaActions.ts:70
  • desktop/src/features/agents/ui/AgentsView.tsx:325 · desktop/src/features/agents/ui/AgentsView.tsx:551 — the two spans are one implementation copied and then locally edited — 539 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/AgentsView.tsx:325
  • desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116 · desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:134 — the two spans are one implementation copied and then locally edited — 533 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116
  • desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33 · desktop/src/features/settings/ui/BackupTestFlow.tsx:14 — the two spans are one implementation copied and then locally edited — 699 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33
  • desktop/src/features/messages/lib/useChannelLinks.ts:92 · desktop/src/features/messages/lib/useEmojiAutocomplete.ts:151 — the two spans are one implementation copied and then locally edited — 544 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/communities/ui/HostedCommunityCreateFlow.tsx:148 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:200 — the two spans are one implementation copied and then locally edited — 503 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:148
  • desktop/src/features/onboarding/lib/encryptedBackup.ts:2 · desktop/src/features/settings/lib/encryptedBackup.ts:2 — these 2 files are line-for-line copies of one another — 94 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — desktop/src/features/onboarding/lib/encryptedBackup.ts:2
  • desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89 · desktop/src/features/agents/ui/TeamSnapshotExportDialog.tsx:72 — the two spans are one implementation copied and then locally edited — 401 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89
  • desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141 · desktop/src/features/search/ui/SearchPromptPlaceholder.tsx:62 — the two spans are one implementation copied and then locally edited — 526 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141
  • desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58 · desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:224 — the two spans are one implementation copied and then locally edited — 432 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58
  • desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631 · desktop/src/features/settings/ui/BackupTestFlow.tsx:341 — the two spans are one implementation copied and then locally edited — 358 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631
  • desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13 · desktop/src/features/projects/ui/CreatePullRequestDialog.tsx:23 — the two spans are one implementation copied and then locally edited — 425 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13
  • desktop/src/features/messages/ui/MessageRow.tsx:755 · desktop/src/features/messages/ui/MessageThreadSummaryRow.tsx:150 — the two spans are one implementation copied and then locally edited — 297 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/messages/ui/MessageRow.tsx:755
  • desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:90 — the two spans are one implementation copied and then locally edited — 525 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48
  • desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201 · desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1368 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201
  • desktop/src/features/channels/channelSnapshot.ts:46 · desktop/src/features/projects/projectSnapshot.ts:113 — the two spans are one implementation copied and then locally edited — 393 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/channels/channelSnapshot.ts:46
  • desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76 · desktop/src/features/projects/ui/ProjectsAgentPromptPage.tsx:427 — the two spans are one implementation copied and then locally edited — 284 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76
  • desktop/src/shared/ui/rich-link-preview-attachment.tsx:168 · desktop/src/shared/ui/rich-link-preview-attachment.tsx:267 — the two spans are one implementation copied and then locally edited — 282 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/shared/ui/rich-link-preview-attachment.tsx:168
  • desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126 · desktop/src/features/agents/ui/PromptSectionAccordion.tsx:17 — the two spans are one implementation copied and then locally edited — 249 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126
  • desktop/src/features/agents/useAgentManagement.ts:42 · desktop/src/features/projects/useProjectChannelRequests.ts:25 — the two spans are one implementation copied and then locally edited — 328 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/useAgentManagement.ts:42

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries7.6 / 10Strong✓ 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.

  • REDACTED:180 reaches into another package with a relative path (../desktop/package.json) — import the package by name instead. — REDACTED:180

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
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 672 and cognitive complexity 571; 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:12089
  • 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:10949
  • UserProfilePanel has cyclomatic complexity 112 and cognitive complexity 90; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/profile/ui/UserProfilePanel.tsx:105
  • ChannelPane has cyclomatic complexity 108 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/channels/ui/ChannelPane.tsx:79
  • 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:166
  • ProfileSummaryView has cyclomatic complexity 70 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/profile/ui/UserProfilePanelSections.tsx:136
  • AgentDefinitionDialog has cyclomatic complexity 69 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128
  • NostrKeyImportForm has cyclomatic complexity 68 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:60
  • ProjectRepositoryActionsPanel has cyclomatic complexity 68 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/projects/ui/ProjectRepositoryActionsPanel.tsx:139
  • UserProfilePopoverBody has cyclomatic complexity 68 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/profile/ui/UserProfilePopover.tsx:257
  • MessageRow has cyclomatic complexity 67 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/messages/ui/MessageRow.tsx:72
  • apply has cyclomatic complexity 64 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/huddle/lib/huddlePresence.ts:260
  • InboxMessageDetailPane has cyclomatic complexity 61 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/home/ui/InboxDetailPane.tsx:166
  • yamlToFormState has cyclomatic complexity 60 and cognitive complexity 98; 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/workflows/ui/workflowFormTypes.ts:408
  • AgentInstanceEditDialog has cyclomatic complexity 60 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/AgentInstanceEditDialog.tsx:102
  • HostedCommunityOnboarding has cyclomatic complexity 60 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/communities/ui/HostedCommunityOnboarding.tsx:76
  • WorkspaceTabs has cyclomatic complexity 59 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/projects/ui/ProjectWorkspaceTabs.tsx:86
  • ProfileSettingsCard has cyclomatic complexity 59 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/settings/ui/ProfileSettingsCard.tsx:135
  • ProjectConversationPanel has cyclomatic complexity 58 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/projects/ui/ProjectConversationPanel.tsx:37
  • ImageZoomOverlay has cyclomatic complexity 51 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/shared/ui/markdown.tsx:149
  • InviteRedeemForm has cyclomatic complexity 50 and cognitive complexity 46; 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/InviteRedeemForm.tsx:63
  • AgentsView has cyclomatic complexity 50 and cognitive complexity 41; 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/AgentsView.tsx:40
  • ChannelScreen has cyclomatic complexity 50 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/ChannelScreen.tsx:90
  • ChannelManagementSheet has cyclomatic complexity 50 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/channels/ui/ChannelManagementSheet.tsx:99
  • (anonymous) has cyclomatic complexity 48 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/messages/ui/MentionAutocomplete.tsx:246
  • WorkflowDialog has cyclomatic complexity 48 and cognitive complexity 42; 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/workflows/ui/WorkflowDialog.tsx:216
  • MessageComposerImpl has cyclomatic complexity 48 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/messages/ui/MessageComposer.tsx:70
  • ChannelManagementPanelContent has cyclomatic complexity 47 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/channels/ui/ChannelManagementSheet.tsx:673
  • HomeView has cyclomatic complexity 47 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/home/ui/HomeView.tsx:101
  • HostedCommunitiesSettingsCard has cyclomatic complexity 47 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:70
  • MachineOnboardingFlow has cyclomatic complexity 46 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/onboarding/ui/MachineOnboardingFlow.tsx:57
  • (anonymous) has cyclomatic complexity 46 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:3620
  • CommunityOnboardingFlow has cyclomatic complexity 45 and cognitive complexity 42; 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/CommunityOnboardingFlow.tsx:157
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.

  • desktop/src/testing/e2eBridge.ts has 14844 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/testing/e2eBridge.ts:1
  • desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs has 2667 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs:1
  • desktop/src/shared/ui/VideoPlayer.tsx has 2094 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/ui/VideoPlayer.tsx:1
  • desktop/src/shared/ui/markdown.tsx has 1751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/ui/markdown.tsx:1
  • desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs has 1561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1
  • desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs has 1434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs:1
  • desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx has 1164 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:1
  • desktop/src/features/onboarding/ui/SetupStep.tsx has 1127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/onboarding/ui/SetupStep.tsx:1
  • desktop/src/features/agents/ui/agentSessionTranscript.ts has 1126 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/agentSessionTranscript.ts:1
  • desktop/src/shared/api/relayClientSession.ts has 1096 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/api/relayClientSession.ts:1
  • desktop/src/features/messages/ui/useAnchoredScroll.ts has 1053 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/useAnchoredScroll.ts:1
  • desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs has 1035 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs:1
  • desktop/src/features/profile/ui/ProfileAvatarEditor.tsx has 1021 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:1
  • desktop/src/features/messages/ui/MessageComposer.tsx has 1012 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/MessageComposer.tsx:1
  • desktop/src/features/agents/ui/AgentDefinitionDialog.tsx has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:1
  • desktop/src/features/channels/ui/ChannelPane.tsx has 1007 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/ui/ChannelPane.tsx:1
  • desktop/src/features/agents/ui/AgentCreationPreview.tsx has 1002 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:1
  • desktop/src/features/agents/ui/AgentConfigFields.tsx has 999 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentConfigFields.tsx:1
  • desktop/src/features/channels/ui/ChannelScreen.tsx has 995 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/ui/ChannelScreen.tsx:1
  • desktop/src/features/messages/ui/useMentionSendFlow.ts has 992 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/useMentionSendFlow.ts:1
  • desktop/src/app/AppShell.tsx has 989 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/app/AppShell.tsx:1
  • desktop/src/features/projects/ui/ProjectDetailScreen.tsx has 988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/projects/ui/ProjectDetailScreen.tsx:1
  • desktop/src/features/messages/ui/MessageRow.tsx has 981 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/MessageRow.tsx:1
  • desktop/src/features/home/ui/HomeView.tsx has 980 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/home/ui/HomeView.tsx:1
  • admin-web/src/App.tsx has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — admin-web/src/App.tsx:1
  • desktop/src/shared/api/tauri.ts has 971 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/api/tauri.ts:1
  • desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx has 965 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:1
  • desktop/src/features/messages/lib/useMentions.ts has 964 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/lib/useMentions.ts:1
  • desktop/src/features/profile/ui/UserProfilePanel.tsx has 960 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/profile/ui/UserProfilePanel.tsx:1
  • desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx has 954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx:1
  • desktop/src/features/channels/ui/ChannelManagementSheet.tsx has 952 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/ui/ChannelManagementSheet.tsx:1
  • desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:1
  • desktop/src/features/projects/ui/ProjectsView.tsx has 948 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/projects/ui/ProjectsView.tsx:1
  • desktop/src/features/admin-console/AdminConsoleReportsTab.tsx has 945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:1
  • desktop/src/shared/ui/sidebar.tsx has 940 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/ui/sidebar.tsx:1
  • desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1
  • desktop/src/features/messages/ui/MessageTimeline.tsx has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/MessageTimeline.tsx:1
  • desktop/src/features/channels/useUnreadChannels.ts has 931 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/useUnreadChannels.ts:1
  • desktop/src/features/search/ui/TopbarSearch.tsx has 929 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/search/ui/TopbarSearch.tsx:1
  • desktop/src/features/messages/ui/SystemMessageRow.tsx has 923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/SystemMessageRow.tsx:1

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — desktop/src/protectedFeatures/bestie/BestiePopover.tsx:1, desktop/src/features/agents/ui/ManagedAgentRow.tsx:1, desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

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.8 / 10Strong✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 107 application, 34 tooling and 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×33) — desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx, desktop/src/features/agents/ui/ModelPicker.tsx, desktop/src/features/community-members/ui/CommunityMembersCard.tsx, …
  • no import path from any entry point (107 application, 34 tooling, 967 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (desktop/src/features/community-members/ui/CommunityMembersCard.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — desktop/src/features/community-members/ui/ConfirmRemoveDialog.tsx
  • Nothing imports this binding — it is safe to review for removal. (×4) — desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:356, desktop/src/features/admin-console/api.ts:626, desktop/src/features/agents/hooks.ts:646, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
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 Imports0.0 / 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/admin-console/AdminConsoleCommunityBadge.tsx → desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx → desktop/src/features/admin-console/AdminConsoleCommunityBadge.tsx — desktop/src/features/admin-console/AdminConsoleCommunityBadge.tsx:9
  • 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:3
  • 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:35
  • 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:1
  • 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:3

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. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — deploy/compose/Caddyfile:4

What to do

  • Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation7.9 / 10Strong✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on an AbortSignal or a CancelToken (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 21/32 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; Dio, AbortableRequest) accept an AbortSignal or a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Dart: `CancelToken? cancelToken`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `resolveBuzzDownloadUrlForPlatform` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/shared/lib/buzz-download.ts:159
  • `ensureClone` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/features/repos/git-client.ts:68
  • `acceptPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/features/invite/ui/InvitePage.tsx:101
  • `setupLogo` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — previews/invite-video/preview.js:19
  • `getJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/shared/api/invites.ts:131
  • `acceptJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/shared/api/invites.ts:170
  • `moderationGet` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/shared/api/moderation.ts:237
  • `tick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/features/sidebar/lib/useStaleReaderRecovery.ts:89
  • `fetchAvatarDataUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/features/profile/lib/selfProfileStorage.ts:378
  • `doRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — admin-web/src/api.ts:94
  • `probeAuthMode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — admin-web/src/api.ts:157

What to do

  • Thread an AbortSignal or a CancelToken through functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … in` loop leaves the `List`, `Map` or `Set` it is walking alone — Dart's collection iterators check that the collection has not changed since the loop began, so a body that adds to or removes from the very collection the loop is walking (or the map whose `keys`, `values` or `entries` it walks) makes the next step throw `ConcurrentModificationError` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging4.3 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:93
  • `warn!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:113
  • `warn!` at line 121 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:121
  • `warn!` at line 130 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:130
  • `warn!` at line 137 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:137
  • `warn!` at line 144 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:144
  • `warn!` at line 480 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:480
  • `warn!` at line 1156 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/discovery.rs:1156
  • `debug!` at line 118 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-ws-client/src/connection.rs:118
  • `debug!` at line 142 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-ws-client/src/connection.rs:142
  • `debug!` at line 233 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-ws-client/src/connection.rs:233
  • `info!` at line 678 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:678
  • `warn!` at line 739 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:739
  • `info!` at line 751 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:751
  • `info!` at line 784 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:784
  • `info!` at line 814 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:814
  • `info!` at line 841 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:841
  • `debug!` at line 939 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:939
  • `warn!` at line 1217 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:1217
  • `warn!` at line 244 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:244
  • `debug!` at line 250 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:250
  • `error!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:337
  • `error!` at line 356 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:356
  • `error!` at line 383 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:383
  • `error!` at line 450 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:450
  • `warn!` at line 459 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:459
  • `error!` at line 502 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:502
  • `error!` at line 590 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:590
  • `warn!` at line 604 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:604
  • `warn!` at line 664 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:664
  • `error!` at line 728 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:728
  • `error!` at line 746 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:746
  • `error!` at line 767 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:767
  • `warn!` at line 787 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:787
  • `warn!` at line 890 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:890
  • `warn!` at line 927 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:927
  • `warn!` at line 956 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:956
  • `warn!` at line 1163 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-relay/src/config.rs:1163
  • `warn!` at line 1176 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-relay/src/config.rs:1176
  • `info!` at line 1491 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-relay/src/config.rs:1491

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types6.8 / 10Strong✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 3/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

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

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 Health59%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture46%Weak — gated by R9, AX7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity94%ExemplarySolid.
Readiness64%Adequate — gated by D13, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security79%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplaryStrongest area.
Event Sourcing100%ExemplarySolid.
Accessibility56%Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance69%StrongSolid.
Unscored — 4 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 8 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 — 45 check(s) not relevant to this codebase

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

  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Dart isolates share no mutable memory, so no two requests write one object at the same instant. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — AX6 reached only 30% of this repository's production lines — rust (638,841 lines), dart (140,842 lines), swift (15,095 lines), python (7,233 lines), kotlin (2,785 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 1 — a container did not start, exited, or never became healthy) — container buzz-minio-init exited (1); runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
  • D12 Dependency Hygiene — Not scored — 2 Maven/Gradle manifest(s) were read, stating a version for 3 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, Swift surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 34 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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.
  • D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
  • DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
  • DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — Not assessed, and this one is on us: 1 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X12 Unreachable branch — X12 reached only 43% of this repository's production lines — rust (638,841 lines), swift (15,095 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 43% of this repository's production lines — rust (638,841 lines), swift (15,095 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X16 Unfloored truncation loop — X16 reached only 42% of this repository's production lines — rust (638,841 lines), swift (15,095 lines), python (7,233 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — X17 reached only 43% of this repository's production lines — rust (638,841 lines), swift (15,095 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X18 Disposal-pattern correctness — X18 reached only 42% of this repository's production lines — rust (638,841 lines), swift (15,095 lines), python (7,233 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — X24 reached only 30% of this repository's production lines — rust (638,841 lines), dart (140,842 lines), swift (15,095 lines), kotlin (2,785 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X25 Inert configuration knob — X25 reached only 43% of this repository's production lines — rust (638,841 lines), swift (15,095 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — X26 reached only 2% of this repository's production lines — rust (638,841 lines), typescript (331,469 lines), dart (140,842 lines), javascript (5,496 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X3 Exception handling — X3 reached only 44% of this repository's production lines — rust (638,841 lines), c (1 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.

Appendix A — Findings (grouped)

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

Critical — 73 finding(s)
AC2 · Forms & labels · <input> without a programmatic label · ×14
  • <input> without a programmatic label desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:445 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:690 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/admin-console/AdminConsoleCommunities.tsx:157 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:496 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:629 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:620 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/agents/ui/AgentCreationPreview.tsx:499 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/agents/ui/AgentSessionToolItem/TodoToolSummary.tsx:96 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label desktop/src/features/community-members/ui/CommunityMembersSettingsCard.tsx:336 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/onboarding/ui/BackupTestFlow.tsx:530 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:415 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:725 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label desktop/src/features/settings/ui/BackupTestFlow.tsx:301 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label desktop/src/features/user-status/ui/SetStatusDialog.tsx:407 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
D30 · Dependency Vulnerabilities · High CVE · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <select> without a programmatic label · ×5
  • <select> without a programmatic label desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:629 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label desktop/src/features/agents/ui/agentConfigControls.tsx:547 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label desktop/src/features/agents/ui/agentConfigControls.tsx:641 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label desktop/src/features/settings/ui/ChannelTemplatesSettingsCard.tsx:776 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label desktop/src/features/workflows/ui/workflowFormPrimitives.tsx:19 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D30 · Dependency Vulnerabilities · Critical 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 · Click handler on a non-interactive <div> · ×3
  • Click handler on a non-interactive <div> desktop/src/features/communities/ui/CommunityChangeOverlay.tsx:76 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> desktop/src/features/home/ui/InboxListPane.tsx:373 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> desktop/src/shared/ui/OverlayPanelBackdrop.tsx:34 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
D13 · REDACTED Scanning · Leaked secret · ×3
  • REDACTED
  • REDACTED
  • REDACTED
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}.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×2
  • 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.
AX1 · Captive dependencies · Captive dependency · ×2
  • Captive dependency: keepAlive provider currentCommunityRoleProvider captures autoDispose communityMembershipProvider mobile/lib/shared/community/community_membership_provider.dart:119 — `currentCommunityRoleProvider` is a keep-alive Riverpod provider and calls `ref.watch(communityMembershipProvider…)`, which is declared auto-dispose (mobile/lib/shared/community/community_membership_provider.dart:107). The keep-alive provider listens to it for the life of the ProviderContainer, so `communityMembershipProvider` is never disposed — the auto-dispose lifetime it declares never happens, and whatever it holds (a socket, a controller, a stale value) is kept for every later reader. Mark `communityMembershipProvider` keepAlive too, make `currentCommunityRoleProvider` auto-dispose, or read it per use outside build.
  • Captive dependency: keepAlive provider ownedCodexVoiceAgentsProvider captures autoDispose _voiceInventoryChangesProvider mobile/lib/features/channels/dm_voice_agent_provider.dart:21 — `ownedCodexVoiceAgentsProvider` is a keep-alive Riverpod provider and calls `ref.watch(_voiceInventoryChangesProvider…)`, which is declared auto-dispose (mobile/lib/features/channels/dm_voice_agent_provider.dart:49). The keep-alive provider listens to it for the life of the ProviderContainer, so `_voiceInventoryChangesProvider` is never disposed — the auto-dispose lifetime it declares never happens, and whatever it holds (a socket, a controller, a stale value) is kept for every later reader. Mark `_voiceInventoryChangesProvider` keepAlive too, make `ownedCodexVoiceAgentsProvider` auto-dispose, or read it per use outside build.
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) desktop/src/features/admin-console/AdminConsoleCommunityBadge.tsx:9 — desktop/src/features/admin-console/AdminConsoleCommunityBadge.tsx → desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx → desktop/src/features/admin-console/AdminConsoleCommunityBadge.tsx
  • Import cycle (2 files) desktop/src/shared/api/editMessage.ts:1 — desktop/src/shared/api/editMessage.ts → desktop/src/shared/api/tauri.ts → desktop/src/shared/api/editMessage.ts (one verified cycle inside a mutually-dependent group of 6 files)
AC3 · Page structure · Document <title> is empty · ×1
  • Document <title> is empty desktop/index.html:2 — An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
AC4 · Keyboard semantics · Click handler on a non-interactive <img> · ×1
  • Click handler on a non-interactive <img> desktop/src/features/agents/ui/AgentSessionToolItem/ViewImageToolPreview.tsx:25 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
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:3 — 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:35 — 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 (3 files) · ×1
  • Import cycle (3 files) desktop/src/shared/hooks/use-mobile.tsx:3 — 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 — 4983 finding(s)
D3 · God Classes · FunctionTooLong · ×513
  • FunctionTooLong: buzz_relay::audio::handler::run_active_audio_connection crates/buzz-relay/src/audio/handler.rs:580 — FunctionTooLong — buzz_relay::audio::handler::run_active_audio_connection runs 1112 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 1012 over it, 11.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: buzz_acp::run_harness crates/buzz-acp/src/lib.rs:2877 — FunctionTooLong — buzz_acp::run_harness runs 888 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 788 over it, 8.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AgentInstanceEditDialog.AgentInstanceEditDialog desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:102 — FunctionTooLong — AgentInstanceEditDialog runs 842 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 742 over it, 8.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChannelPane.ChannelPane desktop/src/features/channels/ui/ChannelPane.tsx:79 — FunctionTooLong — ChannelPane runs 841 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 741 over it, 8.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: buzz_acp::pool::run_prompt_task crates/buzz-acp/src/pool.rs:2415 — FunctionTooLong — buzz_acp::pool::run_prompt_task runs 826 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 726 over it, 8.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ProfileAvatarEditor.ProfileAvatarEditor desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:67 — FunctionTooLong — ProfileAvatarEditor runs 817 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 717 over it, 8.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: buzz_relay::run_relay_main crates/buzz-relay/src/main.rs:205 — FunctionTooLong — buzz_relay::run_relay_main runs 816 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 716 over it, 8.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChannelScreen.ChannelScreen desktop/src/features/channels/ui/ChannelScreen.tsx:90 — FunctionTooLong — ChannelScreen runs 816 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 716 over it, 8.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: MessageComposer.MessageComposerImpl desktop/src/features/messages/ui/MessageComposer.tsx:70 — FunctionTooLong — MessageComposerImpl runs 813 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 713 over it, 8.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AgentCreationPreview.AgentCreationPreview desktop/src/features/agents/ui/AgentCreationPreview.tsx:47 — FunctionTooLong — AgentCreationPreview runs 810 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 710 over it, 8.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: buzz_relay::handlers::ingest::ingest_event_inner crates/buzz-relay/src/handlers/ingest.rs:2684 — FunctionTooLong — buzz_relay::handlers::ingest::ingest_event_inner runs 807 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 707 over it, 8.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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: AgentDefinitionDialog.AgentDefinitionDialog desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128 — FunctionTooLong — AgentDefinitionDialog runs 747 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 647 over it, 7.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useMentionSendFlow.useMentionSendFlow desktop/src/features/messages/ui/useMentionSendFlow.ts:51 — FunctionTooLong — useMentionSendFlow runs 744 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 644 over it, 7.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AppShell.AppShell desktop/src/app/AppShell.tsx:111 — FunctionTooLong — AppShell 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:105 — FunctionTooLong — UserProfilePanel runs 731 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 631 over it, 7.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AppSidebar.AppSidebar desktop/src/features/sidebar/ui/AppSidebar.tsx:80 — FunctionTooLong — AppSidebar runs 730 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 630 over it, 7.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: VideoPlayer.VideoReviewDialog desktop/src/shared/ui/VideoPlayer.tsx:1198 — FunctionTooLong — VideoReviewDialog runs 717 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 617 over it, 7.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useMentions.useMentions desktop/src/features/messages/lib/useMentions.ts:76 — FunctionTooLong — useMentions runs 703 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 603 over it, 7.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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: buzz_desktop::run desktop/src-tauri/src/lib.rs:101 — FunctionTooLong — buzz_desktop::run runs 663 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 563 over it, 6.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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.
  • + 488 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×303
  • Hotspot: desktop/src/testing/e2eBridge.ts desktop/src/testing/e2eBridge.ts:11467 — desktop/src/testing/e2eBridge.ts changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 616 in e2eBridge.maybeInstallE2eTauriMocks at line 11467. 20 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: mobile/lib/features/channels/channel_detail_page.dart mobile/lib/features/channels/channel_detail_page.dart:203 — mobile/lib/features/channels/channel_detail_page.dart changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 121 in _ResolvedChannelDetailPage.build at line 203. 21 of those changes were fix/bug commits, and the other 47 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channel_detail_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/buzz-relay/src/handlers/ingest.rs crates/buzz-relay/src/handlers/ingest.rs:2684 — crates/buzz-relay/src/handlers/ingest.rs changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in buzz_relay::handlers::ingest::ingest_event_inner at line 2684. 12 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/handlers/ingest.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mobile/lib/features/channels/thread_detail_page.dart mobile/lib/features/channels/thread_detail_page.dart:115 — mobile/lib/features/channels/thread_detail_page.dart changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 174 in ThreadDetailPage.build at line 115. 15 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/thread_detail_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mobile/lib/features/channels/channel_detail_page/message_list.dart mobile/lib/features/channels/channel_detail_page/message_list.dart:60 — mobile/lib/features/channels/channel_detail_page/message_list.dart changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 219 in _MessageList.build at line 60. 8 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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/lib.rs crates/buzz-acp/src/lib.rs:2877 — crates/buzz-acp/src/lib.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 171 in buzz_acp::run_harness at line 2877. 17 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: crates/buzz-relay/src/main.rs crates/buzz-relay/src/main.rs:205 — crates/buzz-relay/src/main.rs changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in buzz_relay::run_relay_main at line 205. 15 of those changes were fix/bug commits, and the other 38 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: mobile/lib/features/channels/channels_page.dart mobile/lib/features/channels/channels_page.dart:171 — mobile/lib/features/channels/channels_page.dart changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in ChannelsPage.build at line 171. 14 of those changes were fix/bug commits, and the other 32 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channels_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/buzz-relay/src/api/bridge.rs crates/buzz-relay/src/api/bridge.rs:1712 — crates/buzz-relay/src/api/bridge.rs changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in buzz_relay::api::bridge::query_member_events at line 1712. 20 of those changes were fix/bug commits, and the other 40 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: crates/buzz-relay/src/audio/handler.rs crates/buzz-relay/src/audio/handler.rs:580 — crates/buzz-relay/src/audio/handler.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 146 in buzz_relay::audio::handler::run_active_audio_connection at line 580. 3 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/audio/handler.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/buzz-relay/src/config.rs crates/buzz-relay/src/config.rs:712 — crates/buzz-relay/src/config.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in Config::from_env at line 712. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/buzz-relay/src/handlers/side_effects.rs crates/buzz-relay/src/handlers/side_effects.rs:633 — crates/buzz-relay/src/handlers/side_effects.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in buzz_relay::handlers::side_effects::validate_admin_event at line 633. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/handlers/side_effects.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mobile/lib/features/channels/compose_bar/compose_bar_widget.dart mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:51 — mobile/lib/features/channels/compose_bar/compose_bar_widget.dart changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 136 in ComposeBar.build 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/compose_bar/compose_bar_widget.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mobile/lib/features/channels/message_content.dart mobile/lib/features/channels/message_content.dart:232 — mobile/lib/features/channels/message_content.dart changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in MessageContent.build at line 232. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/message_content.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mobile/lib/features/pairing/pairing_page.dart mobile/lib/features/pairing/pairing_page.dart:118 — mobile/lib/features/pairing/pairing_page.dart changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in PairingPage.build 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/pairing/pairing_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/channels/ui/ChannelPane.tsx desktop/src/features/channels/ui/ChannelPane.tsx:79 — desktop/src/features/channels/ui/ChannelPane.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 129 in ChannelPane.ChannelPane at line 79. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: mobile/lib/features/channels/channel_details_page.dart mobile/lib/features/channels/channel_details_page.dart:81 — mobile/lib/features/channels/channel_details_page.dart changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in ChannelDetailsPage.build at line 81. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channel_details_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mobile/lib/features/channels/channels_provider.dart mobile/lib/features/channels/channels_provider.dart:358 — mobile/lib/features/channels/channels_provider.dart changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in ChannelsNotifier._fetchChannels at line 358. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channels_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.
  • Hotspot: crates/buzz-acp/src/pool.rs crates/buzz-acp/src/pool.rs:2415 — crates/buzz-acp/src/pool.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in buzz_acp::pool::run_prompt_task at line 2415. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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/MessageComposer.tsx desktop/src/features/messages/ui/MessageComposer.tsx:70 — desktop/src/features/messages/ui/MessageComposer.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in MessageComposer.MessageComposerImpl at line 70. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- desktop/src/features/messages/ui/MessageComposer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/buzz-relay/src/handlers/req.rs crates/buzz-relay/src/handlers/req.rs:79 — crates/buzz-relay/src/handlers/req.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in buzz_relay::handlers::req::handle_admitted_req at line 79. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/handlers/req.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 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in buzz_desktop::run at line 101. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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/shared/ui/markdown.tsx desktop/src/shared/ui/markdown.tsx:149 — desktop/src/shared/ui/markdown.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in markdown.ImageZoomOverlay at line 149. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: mobile/lib/features/activity/activity_page.dart mobile/lib/features/activity/activity_page.dart:98 — mobile/lib/features/activity/activity_page.dart changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in ActivityPage.build at line 98. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/activity/activity_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mobile/lib/features/channels/channel_detail_page/message_bubble.dart mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in _MessageBubble.build 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channel_detail_page/message_bubble.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.
  • + 278 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×258
  • FileTooLong: src/lib.rs crates/buzz-acp/src/lib.rs — FileTooLong — 3429 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 73 free functions. The bar is 500 significant lines; this is 2929 over it, 6.86× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/pool.rs crates/buzz-acp/src/pool.rs — FileTooLong — 3085 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 2585 over it, 6.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: handlers/side_effects.rs crates/buzz-relay/src/handlers/side_effects.rs — FileTooLong — 2887 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 96 free functions. The bar is 500 significant lines; this is 2387 over it, 5.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2849 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: DeletionStore (2 blocks, 771-3376). The bar is 500 significant lines; this is 2349 over it, 5.70× 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 — 2516 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 53 free functions. The bar is 500 significant lines; this is 2016 over it, 5.03× 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 — 2355 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 1855 over it, 4.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: audio/handler.rs crates/buzz-relay/src/audio/handler.rs — FileTooLong — 2225 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 1725 over it, 4.45× 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 — 2141 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 1641 over it, 4.28× 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 — 1816 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 54 free functions. The bar is 500 significant lines; this is 1316 over it, 3.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ui/VideoPlayer.tsx desktop/src/shared/ui/VideoPlayer.tsx — FileTooLong — 1789 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1289 over it, 3.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: store/channel_members.rs crates/buzz-db/src/store/channel_members.rs — FileTooLong — 1703 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 52 free functions. The bar is 500 significant lines; this is 1203 over it, 3.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: store/relay_admin_actions.rs crates/buzz-db/src/store/relay_admin_actions.rs — FileTooLong — 1613 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 1113 over it, 3.23× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/state.rs crates/buzz-relay/src/state.rs — FileTooLong — 1547 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 1047 over it, 3.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs crates/buzz-cli/src/lib.rs — FileTooLong — 1541 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 1041 over it, 3.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/llm.rs crates/buzz-agent/src/llm.rs — FileTooLong — 1493 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 48 free functions. The bar is 500 significant lines; this is 993 over it, 2.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: store/channel.rs crates/buzz-db/src/store/channel.rs — FileTooLong — 1486 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 986 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: src/builders.rs crates/buzz-sdk/src/builders.rs — FileTooLong — 1475 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 90 free functions. The bar is 500 significant lines; this is 975 over it, 2.95× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ui/markdown.tsx desktop/src/shared/ui/markdown.tsx — FileTooLong — 1440 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 940 over it, 2.88× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs crates/buzz-deletion/src/lib.rs — FileTooLong — 1324 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 824 over it, 2.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/queue.rs crates/buzz-acp/src/queue.rs — FileTooLong — 1302 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 802 over it, 2.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: commands/channels.rs crates/buzz-cli/src/commands/channels.rs — FileTooLong — 1278 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 778 over it, 2.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/main.rs crates/buzz-relay/src/main.rs — FileTooLong — 1277 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 777 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: git/transport.rs crates/buzz-relay/src/api/git/transport.rs — FileTooLong — 1241 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 741 over it, 2.48× 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 — 1237 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 72% of them inside a single declaration: AcpClient (3 blocks, 148-2398). The bar is 500 significant lines; this is 737 over it, 2.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: store/workflow.rs crates/buzz-db/src/store/workflow.rs — FileTooLong — 1220 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 720 over it, 2.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 233 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×144
  • MethodTooLong: _MessageList.build mobile/lib/features/channels/channel_detail_page/message_list.dart:60 — MethodTooLong — build runs 880 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 780 over it, 8.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ComposeBar.build mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:51 — MethodTooLong — build runs 870 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 770 over it, 8.70× 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:115 — MethodTooLong — build runs 754 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 654 over it, 7.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.
  • MethodTooLong: Config.from_env crates/buzz-relay/src/config.rs:712 — MethodTooLong — from_env runs 633 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 533 over it, 6.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ResolvedChannelDetailPage.build mobile/lib/features/channels/channel_detail_page.dart:203 — MethodTooLong — build runs 631 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 531 over it, 6.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: ChannelsPage.build mobile/lib/features/channels/channels_page.dart:171 — MethodTooLong — build runs 511 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 411 over it, 5.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AnimatedAvatarCapture.build mobile/lib/features/profile/animated_avatar_capture.dart:81 — MethodTooLong — build runs 491 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 391 over it, 4.91× 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:135 — MethodTooLong — build runs 488 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 388 over it, 4.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: ChannelDetailsPage.build mobile/lib/features/channels/channel_details_page.dart:81 — MethodTooLong — build runs 487 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 387 over it, 4.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ImageAvatarCapture.build mobile/lib/shared/widgets/image_avatar_capture.dart:89 — MethodTooLong — build runs 444 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 344 over it, 4.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.
  • MethodTooLong: ActivityPage.build mobile/lib/features/activity/activity_page.dart:98 — MethodTooLong — build runs 395 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 295 over it, 3.95× 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:55 — MethodTooLong — build runs 385 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 285 over it, 3.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MediaImageViewerPage.build mobile/lib/features/channels/media_viewer_page.dart:213 — 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: _PairingWelcomeView.build mobile/lib/features/pairing/pairing_page/pairing_welcome_view.dart:62 — MethodTooLong — build runs 356 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 256 over it, 3.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _MessageBubble.build mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40 — MethodTooLong — build runs 354 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 254 over it, 3.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.
  • MethodTooLong: AgentsPage.build mobile/lib/features/agents/agents_page.dart:345 — MethodTooLong — build runs 350 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× 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:304 — MethodTooLong — build runs 348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 248 over it, 3.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HomePage.build mobile/lib/features/home/home_page.dart:64 — MethodTooLong — build runs 347 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 247 over it, 3.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: CommunitySwitcherPage.build mobile/lib/features/channels/channels_page/community_switcher.dart:90 — 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: _ThreadMessage.build mobile/lib/features/channels/thread_detail_page/thread_message.dart:41 — MethodTooLong — build runs 335 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 235 over it, 3.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _MessageImageStack.build mobile/lib/features/channels/message_content/media_stack.dart:22 — MethodTooLong — build runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UserProfileSheet.build mobile/lib/features/profile/user_profile_sheet.dart:126 — MethodTooLong — build runs 312 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 212 over it, 3.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: MessageContent.build mobile/lib/features/channels/message_content.dart:232 — MethodTooLong — build runs 308 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 208 over it, 3.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PairingPage.build mobile/lib/features/pairing/pairing_page.dart:118 — 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: 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.
  • + 119 more in this group — see findings.md.
D2 · Cognitive Complexity · buzz_desktop · ×108
  • buzz_desktop::huddle::playout::run_playout_recv_loop (cognitive 175) desktop/src-tauri/src/huddle/playout.rs:273 — buzz_desktop::huddle::playout::run_playout_recv_loop has cognitive complexity 175 (threshold 15). Drivers by points: if/else 27 (127 pts), loops 7 (29 pts), match/switch 5 (18 pts), boolean chains 1 (nesting depth added 135). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_desktop::huddle::tts::tts_worker (cognitive 149) desktop/src-tauri/src/huddle/tts.rs:322 — buzz_desktop::huddle::tts::tts_worker has cognitive complexity 149 (threshold 15). Drivers by points: if/else 43 (112 pts), match/switch 12 (22 pts), boolean chains 8, loops 4 (7 pts) (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::commands::pairing::pairing_ws_task_inner (cognitive 137) desktop/src-tauri/src/commands/pairing.rs:351 — buzz_desktop::commands::pairing::pairing_ws_task_inner has cognitive complexity 137 (threshold 15). Drivers by points: if/else 28 (117 pts), match/switch 4 (18 pts), boolean chains 1, loops 1 (nesting depth added 103). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_desktop::migration::sync_shared_agent_data (cognitive 104) desktop/src-tauri/src/migration.rs:785 — buzz_desktop::migration::sync_shared_agent_data has cognitive complexity 104 (threshold 15). Drivers by points: if/else 27 (81 pts), loops 7 (19 pts), boolean chains 2, match/switch 2 (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_desktop::native_relay_client::run_connection (cognitive 97) desktop/src-tauri/src/native_relay_client.rs:522 — buzz_desktop::native_relay_client::run_connection has cognitive complexity 97 (threshold 15). Drivers by points: if/else 21 (82 pts), loops 3 (7 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file (cognitive 62) desktop/src-tauri/src/migration/pollen.rs:21 — buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (53 pts), boolean chains 7, loops 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::run (cognitive 59) desktop/src-tauri/src/lib.rs:101 — buzz_desktop::run has cognitive complexity 59 (threshold 15). Drivers by points: if/else 33 (47 pts), boolean chains 5, loops 3 (4 pts), match/switch 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::managed_agents::backend::invoke_provider (cognitive 59) desktop/src-tauri/src/managed_agents/backend.rs:76 — buzz_desktop::managed_agents::backend::invoke_provider has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (31 pts), match/switch 7 (17 pts), loops 7 (11 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::huddle::start_huddle (cognitive 53) desktop/src-tauri/src/huddle/mod.rs:189 — buzz_desktop::huddle::start_huddle has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (45 pts), match/switch 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::commands::team_snapshot::confirm_team_snapshot_import (cognitive 49) desktop/src-tauri/src/commands/team_snapshot.rs:514 — 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::commands::personas::update::update_persona_with (cognitive 47) desktop/src-tauri/src/commands/personas/update.rs:241 — buzz_desktop::commands::personas::update::update_persona_with has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 5 (12 pts), boolean chains 3 (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::unread_catch_up::classify_batch (cognitive 46) desktop/src-tauri/src/unread_catch_up.rs:250 — buzz_desktop::unread_catch_up::classify_batch has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (34 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::commands::agent_models::normalize_agent_models (cognitive 44) desktop/src-tauri/src/commands/agent_models.rs:710 — buzz_desktop::commands::agent_models::normalize_agent_models has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (35 pts), loops 3 (9 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_desktop::commands::agent_models_update::update_managed_agent (cognitive 43) desktop/src-tauri/src/commands/agent_models_update.rs:143 — buzz_desktop::commands::agent_models_update::update_managed_agent has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::commands::agents::create_managed_agent_in (cognitive 43) desktop/src-tauri/src/commands/agents.rs:400 — buzz_desktop::commands::agents::create_managed_agent_in has cognitive complexity 43 (threshold 15). Drivers by points: if/else 27 (30 pts), match/switch 3 (6 pts), boolean chains 5, loops 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • buzz_desktop::media_proxy::handle_buzz_media (cognitive 43) desktop/src-tauri/src/media_proxy.rs:190 — buzz_desktop::media_proxy::handle_buzz_media has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (37 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_desktop::app_state::resolve_identity_with_store (cognitive 42) desktop/src-tauri/src/app_state.rs:383 — buzz_desktop::app_state::resolve_identity_with_store has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 3 (9 pts), boolean chains 2 (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • buzz_desktop::managed_agents::runtime::spawn_agent_child (cognitive 42) desktop/src-tauri/src/managed_agents/runtime.rs:484 — buzz_desktop::managed_agents::runtime::spawn_agent_child has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (28 pts), loops 6 (9 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_desktop::commands::channels::fetch::fetch_channels (cognitive 41) desktop/src-tauri/src/commands/channels/fetch.rs:211 — buzz_desktop::commands::channels::fetch::fetch_channels has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::archive::pipeline::commit_archive (cognitive 40) desktop/src-tauri/src/archive/pipeline.rs:260 — buzz_desktop::archive::pipeline::commit_archive has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (11 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::media_proxy::proxy_handler (cognitive 40) desktop/src-tauri/src/media_proxy.rs:29 — buzz_desktop::media_proxy::proxy_handler has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::migration::detach::detach_directory_backed_teams_in_dir (cognitive 40) desktop/src-tauri/src/migration/detach.rs:32 — buzz_desktop::migration::detach::detach_directory_backed_teams_in_dir has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (32 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_desktop::commands::media_gif::strip_gif_metadata (cognitive 36) desktop/src-tauri/src/commands/media_gif.rs:38 — buzz_desktop::commands::media_gif::strip_gif_metadata has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch (cognitive 36) desktop/src-tauri/src/managed_agents/restore.rs:140 — buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 4, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 83 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×84
  • ClassTooLong: DeletionStore REDACTED:771 — ClassTooLong — 1934 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 64 methods, 2 blocks, lines 771-3376. The bar is 400 significant lines; this is 1534 over it, 4.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: _MessageList mobile/lib/features/channels/channel_detail_page/message_list.dart:3 — ClassTooLong — 932 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 532 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ComposeBar mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:3 — ClassTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 499 over it, 2.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AcpClient crates/buzz-acp/src/acp.rs:148 — ClassTooLong — 893 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 148-2398. The bar is 400 significant lines; this is 493 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HostedFlow mobile/lib/shared/hosted/hosted_flow.dart:98 — ClassTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 454 over it, 2.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentInstanceEditDialog desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:1 — ClassTooLong — 842 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 442 over it, 2.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ChannelPane desktop/src/features/channels/ui/ChannelPane.tsx:1 — ClassTooLong — 841 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 441 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: ProfileAvatarEditor desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:1 — ClassTooLong — 817 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 417 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ChannelScreen desktop/src/features/channels/ui/ChannelScreen.tsx:1 — ClassTooLong — 816 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 416 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentCreationPreview desktop/src/features/agents/ui/AgentCreationPreview.tsx:1 — ClassTooLong — 810 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 410 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RelaySessionNotifier mobile/lib/shared/relay/relay_session.dart:38 — ClassTooLong — 788 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 388 over it, 1.97× 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:86 — ClassTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded), 2 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: ProjectDetailScreen desktop/src/features/projects/ui/ProjectDetailScreen.tsx:1 — ClassTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 374 over it, 1.94× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AnimatedAvatarCapture desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:1 — ClassTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 361 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppState crates/buzz-relay/src/state.rs:1422 — ClassTooLong — 756 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 3 blocks, lines 1422-2989. The bar is 400 significant lines; this is 356 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: RelayClient desktop/src/shared/api/relayClientSession.ts:83 — ClassTooLong — 751 significant lines (blank, comment-only and punctuation-only lines excluded), 50 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: HomeView desktop/src/features/home/ui/HomeView.tsx:1 — ClassTooLong — 751 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 351 over it, 1.88× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentDefinitionDialog desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:1 — ClassTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 347 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: useMentionSendFlow desktop/src/features/messages/ui/useMentionSendFlow.ts:1 — ClassTooLong — 744 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 344 over it, 1.86× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppShell desktop/src/app/AppShell.tsx:1 — ClassTooLong — 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 — 731 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 331 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppSidebar desktop/src/features/sidebar/ui/AppSidebar.tsx:1 — ClassTooLong — 730 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 330 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NativeAttachmentPopoverViewController mobile/ios/Runner/NativeAttachmentPopover.swift:7 — ClassTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 325 over it, 1.81× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: 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: ChannelMessagesNotifier mobile/lib/features/channels/channel_messages_provider.dart:32 — ClassTooLong — 711 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 311 over it, 1.78× 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.
  • + 59 more in this group — see findings.md.
D2 · Cognitive Complexity · buzz_relay · ×81
  • buzz_relay::audio::handler::run_active_audio_connection (cognitive 260) crates/buzz-relay/src/audio/handler.rs:580 — buzz_relay::audio::handler::run_active_audio_connection has cognitive complexity 260 (threshold 15). Drivers by points: if/else 113 (205 pts), match/switch 29 (49 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 114). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::handlers::ingest::ingest_event_inner (cognitive 222) crates/buzz-relay/src/handlers/ingest.rs:2684 — buzz_relay::handlers::ingest::ingest_event_inner has cognitive complexity 222 (threshold 15). Drivers by points: if/else 118 (159 pts), match/switch 25 (45 pts), boolean chains 18 (nesting depth added 61). To reduce it, split the body into named stages: move each independent 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 155) crates/buzz-relay/src/main.rs:205 — buzz_relay::run_relay_main has cognitive complexity 155 (threshold 15). Drivers by points: if/else 65 (98 pts), match/switch 20 (38 pts), loops 11 (15 pts), boolean chains 4 (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.
  • buzz_relay::api::bridge::query_member_events (cognitive 140) crates/buzz-relay/src/api/bridge.rs:1712 — buzz_relay::api::bridge::query_member_events has cognitive complexity 140 (threshold 15). Drivers by points: if/else 45 (96 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 129) crates/buzz-relay/src/handlers/side_effects.rs:633 — buzz_relay::handlers::side_effects::validate_admin_event has cognitive complexity 129 (threshold 15). Drivers by points: if/else 35 (79 pts), match/switch 10 (32 pts), loops 7 (14 pts), boolean chains 4 (nesting depth added 73). To reduce it, split the body into named stages: move each independent 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 111) crates/buzz-relay/src/handlers/auth.rs:523 — buzz_relay::handlers::auth::handle_auth has cognitive complexity 111 (threshold 15). Drivers by points: if/else 37 (91 pts), match/switch 8 (17 pts), boolean chains 3 (nesting depth added 63). 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::handlers::imeta::validate_imeta_tags (cognitive 109) crates/buzz-relay/src/handlers/imeta.rs:11 — 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::req::handle_search_req (cognitive 103) crates/buzz-relay/src/handlers/req.rs:910 — buzz_relay::handlers::req::handle_search_req has cognitive complexity 103 (threshold 15). Drivers by points: if/else 22 (67 pts), match/switch 6 (22 pts), loops 4 (12 pts), boolean chains 2 (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::handlers::count::handle_count (cognitive 100) crates/buzz-relay/src/handlers/count.rs:20 — buzz_relay::handlers::count::handle_count has cognitive complexity 100 (threshold 15). Drivers by points: if/else 21 (64 pts), match/switch 9 (18 pts), loops 3 (11 pts), boolean chains 7 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::api::bridge::count_member_events (cognitive 95) crates/buzz-relay/src/api/bridge.rs:2410 — buzz_relay::api::bridge::count_member_events has cognitive complexity 95 (threshold 15). Drivers by points: if/else 21 (64 pts), match/switch 4 (13 pts), loops 3 (11 pts), boolean chains 7 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::handlers::req::handle_admitted_req (cognitive 88) crates/buzz-relay/src/handlers/req.rs:79 — buzz_relay::handlers::req::handle_admitted_req has cognitive complexity 88 (threshold 15). Drivers by points: if/else 33 (61 pts), match/switch 11 (17 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::api::bridge::thread_window::query (cognitive 59) crates/buzz-relay/src/api/bridge/thread_window.rs:165 — buzz_relay::api::bridge::thread_window::query has cognitive complexity 59 (threshold 15). Drivers by points: if/else 8 (33 pts), loops 6 (21 pts), boolean chains 5 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::handlers::report_resolution::drive_enforcement (cognitive 59) crates/buzz-relay/src/handlers/report_resolution.rs:380 — buzz_relay::handlers::report_resolution::drive_enforcement has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (44 pts), match/switch 4 (14 pts), loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::api::git::policy::hook_policy_check (cognitive 57) crates/buzz-relay/src/api/git/policy.rs:176 — buzz_relay::api::git::policy::hook_policy_check has cognitive complexity 57 (threshold 15). Drivers by points: match/switch 14 (23 pts), if/else 18 (20 pts), boolean chains 11, 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_relay::handlers::relay_admin::execute_relay_admin_command (cognitive 54) crates/buzz-relay/src/handlers/relay_admin.rs:229 — buzz_relay::handlers::relay_admin::execute_relay_admin_command has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (43 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::router::nip11_or_ws_handler (cognitive 45) crates/buzz-relay/src/router.rs:809 — buzz_relay::router::nip11_or_ws_handler has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (31 pts), match/switch 5 (9 pts), boolean chains 5 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::api::artifact_sync::execute (cognitive 41) crates/buzz-relay/src/api/artifact_sync.rs:137 — buzz_relay::api::artifact_sync::execute has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 8, loops 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::audio::handler::recv_loop (cognitive 41) crates/buzz-relay/src/audio/handler.rs:2524 — 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::event::handle_event (cognitive 40) crates/buzz-relay/src/handlers/event.rs:690 — buzz_relay::handlers::event::handle_event has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 10 (18 pts), if/else 11 (16 pts), boolean chains 6 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • buzz_relay::handlers::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::audio::handler::commit_participant_join (cognitive 38) crates/buzz-relay/src/audio/handler.rs:3386 — buzz_relay::audio::handler::commit_participant_join has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (31 pts), match/switch 3 (6 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_relay::handlers::side_effects::persist_edit_metadata (cognitive 38) crates/buzz-relay/src/handlers/side_effects.rs:2328 — buzz_relay::handlers::side_effects::persist_edit_metadata has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (24 pts), match/switch 5 (8 pts), boolean chains 4, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::handlers::ingest::validate_project_envelope (cognitive 37) crates/buzz-relay/src/handlers/ingest.rs:2006 — 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:1109 — 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::handlers::side_effects::persist_put_user (cognitive 34) crates/buzz-relay/src/handlers/side_effects.rs:2094 — buzz_relay::handlers::side_effects::persist_put_user has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 7 (14 pts), loops 3 (4 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.
  • + 56 more in this group — see findings.md.
D1 · Cyclomatic Complexity · buzz_relay · ×50
  • buzz_relay::handlers::ingest::ingest_event_inner (cyclomatic 162) crates/buzz-relay/src/handlers/ingest.rs:2684 — buzz_relay::handlers::ingest::ingest_event_inner has cyclomatic complexity 162 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::audio::handler::run_active_audio_connection (cyclomatic 146) crates/buzz-relay/src/audio/handler.rs:580 — buzz_relay::audio::handler::run_active_audio_connection has cyclomatic complexity 146 (threshold 15). To reduce it, separate the cases: extract each independent 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 95) crates/buzz-relay/src/main.rs:205 — buzz_relay::run_relay_main has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::api::bridge::query_member_events (cyclomatic 72) crates/buzz-relay/src/api/bridge.rs:1712 — buzz_relay::api::bridge::query_member_events has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent 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 63) crates/buzz-relay/src/handlers/side_effects.rs:633 — buzz_relay::handlers::side_effects::validate_admin_event has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent 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 50) crates/buzz-relay/src/handlers/auth.rs:523 — buzz_relay::handlers::auth::handle_auth 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.
  • buzz_relay::handlers::req::handle_admitted_req (cyclomatic 48) crates/buzz-relay/src/handlers/req.rs:79 — buzz_relay::handlers::req::handle_admitted_req has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::handlers::imeta::validate_imeta_tags (cyclomatic 47) crates/buzz-relay/src/handlers/imeta.rs:11 — 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 46) crates/buzz-relay/src/api/git/policy.rs:176 — buzz_relay::api::git::policy::hook_policy_check has cyclomatic complexity 46 (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::side_effects::persist_edit_metadata (cyclomatic 42) crates/buzz-relay/src/handlers/side_effects.rs:2328 — buzz_relay::handlers::side_effects::persist_edit_metadata has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::handlers::count::handle_count (cyclomatic 38) crates/buzz-relay/src/handlers/count.rs:20 — 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 35) crates/buzz-relay/src/handlers/relay_admin.rs:229 — buzz_relay::handlers::relay_admin::execute_relay_admin_command has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::api::bridge::count_member_events (cyclomatic 33) crates/buzz-relay/src/api/bridge.rs:2410 — buzz_relay::api::bridge::count_member_events has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::handlers::event::handle_event (cyclomatic 33) crates/buzz-relay/src/handlers/event.rs:690 — buzz_relay::handlers::event::handle_event has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • buzz_relay::handlers::req::handle_search_req (cyclomatic 33) crates/buzz-relay/src/handlers/req.rs:910 — buzz_relay::handlers::req::handle_search_req has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::api::artifact_sync::execute (cyclomatic 29) crates/buzz-relay/src/api/artifact_sync.rs:137 — buzz_relay::api::artifact_sync::execute 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_relay::handlers::ingest::validate_project_envelope (cyclomatic 28) crates/buzz-relay/src/handlers/ingest.rs:2006 — 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::push_runtime::deliver_one (cyclomatic 28) crates/buzz-relay/src/push_runtime.rs:470 — 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::audio::handler::commit_participant_join (cyclomatic 27) crates/buzz-relay/src/audio/handler.rs:3386 — buzz_relay::audio::handler::commit_participant_join 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_relay::handlers::report_resolution::drive_enforcement (cyclomatic 26) crates/buzz-relay/src/handlers/report_resolution.rs:380 — buzz_relay::handlers::report_resolution::drive_enforcement 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.
  • 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::router::nip11_or_ws_handler (cyclomatic 25) crates/buzz-relay/src/router.rs:809 — buzz_relay::router::nip11_or_ws_handler 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::api::git::cas_publish::cas_publish_inner (cyclomatic 22) crates/buzz-relay/src/api/git/cas_publish.rs:1109 — 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::git::transport::finalize_push_inner (cyclomatic 21) crates/buzz-relay/src/api/git/transport.rs:2005 — buzz_relay::api::git::transport::finalize_push_inner has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • buzz_relay::handlers::side_effects::persist_put_user (cyclomatic 21) crates/buzz-relay/src/handlers/side_effects.rs:2094 — buzz_relay::handlers::side_effects::persist_put_user has cyclomatic complexity 21 (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.
  • + 25 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×49
  • Repeated repair: mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:185 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift changed 12 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is BuzzPushNotificationResolver.query at line 185), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile/ios): close notification code blocks only at line-ending fences (#9349)”; “fix(mobile): show the channel name as the notification subtitle (#9173)”; “fix(ios): mint hosted NIP-FI assertions in the notification extension (#9228)”; “fix(ios): mint NIP-FI assertions in the notification extension (#8982)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/features/channels/channel_directory.dart mobile/lib/features/channels/channel_directory.dart:472 — mobile/lib/features/channels/channel_directory.dart changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is _ChannelRefreshCoordinator.beginRefresh at line 472), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): join an open channel from the chat footer (#9253)”; “fix(mobile): show observed thread replies in Activity (#9286)”; “Fix mobile unread state retaining deleted messages (#8883)”; “fix(mobile): find open channels in search and stop the stuck spinner (#8764)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channel_directory.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/ios/NotificationService/NotificationService.swift mobile/ios/NotificationService/NotificationService.swift:139 — mobile/ios/NotificationService/NotificationService.swift changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is NotificationService.didReceive at line 139), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ios): mint hosted NIP-FI assertions in the notification extension (#9228)”; “fix(mobile): send hosted relay assertion from native media and tombstone paths (#9069)”; “fix(ios): mint NIP-FI assertions in the notification extension (#8982)”; “fix(mobile): resolve iOS pushes on a fresh connection and retry a stale one (#8722)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/ios/NotificationService/NotificationService.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/features/settings/settings_page/notifications_section.dart mobile/lib/features/settings/settings_page/notifications_section.dart:20 — mobile/lib/features/settings/settings_page/notifications_section.dart 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 8 (its worst body is _NotificationsSection.build at line 20), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Revert "fix(mobile): push every message in your own Solo chats (#8615)" (#8690)”; “fix(mobile): push every message in your own Solo chats (#8615)”; “fix(mobile): isolate push setup failures from app rendering (#8610)”; “fix(mobile): keep notification toggle usable and match row height (#8223)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/settings/settings_page/notifications_section.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: desktop/src/shared/api/relayClientShared.ts desktop/src/shared/api/relayClientShared.ts:169 — desktop/src/shared/api/relayClientShared.ts changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is relayClientShared.getTextPayload at line 169), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): fix the product races behind four E2E flakes (#8680)”; “fix(desktop): resume reconnect replay from the last live point (#8652)”; “fix(desktop): bound startup request bursts and recover quota refusals (#7790)”; “fix(desktop): harden profile batch and thread-reply fetches against relay slowness (#7188)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: mobile/lib/features/channels/channel_management_actions.dart mobile/lib/features/channels/channel_management_actions.dart:257 — mobile/lib/features/channels/channel_management_actions.dart 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 10 (its worst body is ChannelActions.recheckJoin at line 257), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): join an open channel from the chat footer (#9253)”; “fix(mobile): find verified people who have no profile (#9086)”; “fix(mobile): open new DMs without waiting for a full channel reload (#8638)”; “fix(mobile): restore Solo chats from channel labels (#8466)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channel_management_actions.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/ios/Runner/PushSnapshotBridge.swift mobile/ios/Runner/PushSnapshotBridge.swift:186 — mobile/ios/Runner/PushSnapshotBridge.swift 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 12 (its worst body is BuzzPushSnapshotBridge.syncHostedSession at line 186), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ios): mint hosted NIP-FI assertions in the notification extension (#9228)”; “fix(mobile): answer push snapshot bridge calls at user-initiated QoS; report hop latency on callback timeout (#8916)”; “fix(ios): mint NIP-FI assertions in the notification extension (#8982)”; “fix(ios): fetch profiles and avatars in notification extension (#8369)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/ios/Runner/PushSnapshotBridge.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/buzz-relay/src/handlers/system_channels.rs crates/buzz-relay/src/handlers/system_channels.rs:224 — crates/buzz-relay/src/handlers/system_channels.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is buzz_relay::handlers::system_channels::filter_channel_scope at line 224), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(relay): route live REQ events by each filter's own channel scope (#8519)”; “fix(relay): push system channel events to a lease that names them (#8517)”; “fix(relay): scope push matches with the read path's channel rule (#8507)”; “fix(relay): show only legacy channel types to reads that name no channel (#8469)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/handlers/system_channels.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/features/channels/channel_detail_page/placement_route.dart mobile/lib/features/channels/channel_detail_page/placement_route.dart:29 — mobile/lib/features/channels/channel_detail_page/placement_route.dart 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 ChannelDetailPage.build at line 29), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): show shared chats under Solo (#9348)”; “fix(mobile): restore ordinary DM behavior for Bestie (#8987)”; “fix(mobile): show Bestie as a continuous conversation (#8890)”; “fix(mobile): restore Solo chats from channel labels (#8466)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channel_detail_page/placement_route.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/ios/Runner/NativeReactionDetails.swift mobile/ios/Runner/NativeReactionDetails.swift:372 — mobile/ios/Runner/NativeReactionDetails.swift 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 15 (its worst body is NativeMessageGlyph.init at line 372), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): match browser GIF timing in the iOS reaction sheet (#9437)”; “fix(mobile): never show emoji shortcodes in reaction pills (#9411)”; “fix(mobile): show already-loaded custom emoji in the iOS reactions sheet (#9150)”; “Use grouped message action sheets and fix date layering (#8280)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/ios/Runner/NativeReactionDetails.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/features/channels/thread_detail_helpers.dart mobile/lib/features/channels/thread_detail_helpers.dart:156 — mobile/lib/features/channels/thread_detail_helpers.dart 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 4 (its worst body is _ThreadTailIntent.scheduleNextFrame at line 156), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): keep a sent thread reply above the composer (#9026)”; “fix(mobile): restore inline typing groups and keep working thread links (#8865)”; “Fix mobile jump-to-latest flicker (#6807)”; “Fix mobile thread tail and iOS channel header (#6399)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/thread_detail_helpers.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/buzz-relay/src/startup_steps.rs crates/buzz-relay/src/startup_steps.rs:143 — crates/buzz-relay/src/startup_steps.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 3 (its worst body is StepStatus::as_str at line 143), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(relay): bound mesh dials and keep failing pods out of the mesh (#8752)”; “fix(mesh): expire dead peer records and instrument mesh boot (#8503)”; “fix(relay): delete the startup NIP-33 d_tag backfill (#8468)”; “fix(relay): take NIP-43 snapshot reconcile off the startup path (#8467)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/startup_steps.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/shared/relay/nostr_filters.dart mobile/lib/shared/relay/nostr_filters.dart:74 — mobile/lib/shared/relay/nostr_filters.dart 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 2 (its worst body is NostrFilters.channelAux at line 74), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): bound notices to loaded message history (#9062)”; “fix(mobile): show channel posts before a burst of join notices (#8798)”; “fix(mobile): keep cached state with its community (#8349)”; “fix(client): resurface hidden DMs from live activity (#6885)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/shared/relay/nostr_filters.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/relay.rs desktop/src-tauri/src/relay.rs:285 — desktop/src-tauri/src/relay.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 9 (its worst body is buzz_desktop::relay::relay_error_message at line 285), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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-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), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: mobile/lib/shared/custom_emoji/custom_emoji_render.dart mobile/lib/shared/custom_emoji/custom_emoji_render.dart:156 — mobile/lib/shared/custom_emoji/custom_emoji_render.dart changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is CustomEmojiMd._referencedUrls at line 156), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): never show emoji shortcodes in reaction pills (#9411)”; “fix(mobile): show already-loaded custom emoji in the iOS reactions sheet (#9150)”; “fix(mobile): keep token labels visible in authored Markdown links (#7545)”; “fix(mobile): style inline code with the app mono face (#6631)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/shared/custom_emoji/custom_emoji_render.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/buzz-relay/src/subscription.rs crates/buzz-relay/src/subscription.rs:506 — crates/buzz-relay/src/subscription.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is SubscriptionRegistry::fan_out_scoped at line 506), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(relay): never close connections when cross-node fan-out falls behind (#9302)”; “fix(relay): route live REQ events by each filter's own channel scope (#8519)”; “fix(relay): deliver multi-node fan-out concurrently and never drop silently (#9195)”; “fix(workflows): preserve multi-channel listing semantics (#6009)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/subscription.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/ChannelPane.types.ts desktop/src/features/channels/ui/ChannelPane.types.ts:36 — desktop/src/features/channels/ui/ChannelPane.types.ts changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is (anonymous) at line 36), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): keep an own send out of the frozen timeline tail (#9095)”; “fix(desktop): surface channel history load failures (#7013)”; “fix(desktop): bound thread /query and surface load errors, not false-empty (#6447)”; “fix(messages): route edits to the owning composer (#6575)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- desktop/src/features/channels/ui/ChannelPane.types.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/shared/community/community.dart mobile/lib/shared/community/community.dart:136 — mobile/lib/shared/community/community.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 6 (its worst body is Community.fromJson at line 136), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): show hosted community names consistently (#8872)”; “fix(mobile): reset community notification preferences (#8455)”; “fix(mobile): default community push notifications to on (#8425)”; “fix(mobile): join starter channels after accepting invite (#5915)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/shared/community/community.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: desktop/src/shared/api/relayClosedRecovery.ts desktop/src/shared/api/relayClosedRecovery.ts:27 — desktop/src/shared/api/relayClosedRecovery.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is relayClosedRecovery.handleRelayClosed at line 27), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): resume reconnect replay from the last live point (#8652)”; “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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-acp/src/setup_mode.rs crates/buzz-acp/src/setup_mode.rs:321 — crates/buzz-acp/src/setup_mode.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is buzz_acp::setup_mode::run_setup_listener at line 321), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(acp): wake agents for mentions added by edits (#6131)”; “fix(acp): preserve routing for edited messages (#4741)”; “fix(acp): improve hints in pi agent setup guide (#7594)”; “fix(acp): wake agents from workflow messages (#6953)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-acp/src/setup_mode.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/features/channels/thread_replies_provider.dart mobile/lib/features/channels/thread_replies_provider.dart:17 — mobile/lib/features/channels/thread_replies_provider.dart changed 4 times in last 90 days and 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), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): load earlier edits to thread replies when a thread opens (#8870)”; “fix(mobile): avoid opening empty threads on message tap (#7756)”; “fix(mobile): preserve thread replies through refresh failures (#7757)”; “fix(mobile): recover stale and shuffled messages (#6691)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08: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: crates/buzz-cli/src/desktop_provider.rs crates/buzz-cli/src/desktop_provider.rs:330 — crates/buzz-cli/src/desktop_provider.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is buzz_cli::desktop_provider::call_with at line 330), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): pair for the active community, skip stopped desktops, accept a bare relay host (#9417)”; “fix(cli): clearer desktop pairing errors, paired default relay, and auth desktop list (#9196)”; “fix(cli): list DMs, attach any file, validate kinds, default the relay (#9168)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-cli/src/desktop_provider.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mobile/lib/features/channels/channels_page/skeleton.dart mobile/lib/features/channels/channels_page/skeleton.dart:9 — mobile/lib/features/channels/channels_page/skeleton.dart changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is _ChannelsSkeleton.build at line 9), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): restore channel icons and align chat colors with desktop (#8478)”; “fix(mobile): bump Flutter 3.47, resolving memory leak (#8419)”; “fix(mobile): fill and stabilize content-aware loading placeholders (#8083)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- mobile/lib/features/channels/channels_page/skeleton.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/buzz-relay/src/mesh_boot.rs crates/buzz-relay/src/mesh_boot.rs:413 — crates/buzz-relay/src/mesh_boot.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is buzz_relay::mesh_boot::run_demo_echo at line 413), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(relay): revoke invitations and restrict claims (#8237)”; “fix(mesh): expire dead peer records and instrument mesh boot (#8503)”; “fix(db): audit partition catalog before creation (#6515)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:39:22 -08:00' --until='2026-11-13 17:39:22 -08:00' --full-history --no-merges -- crates/buzz-relay/src/mesh_boot.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.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×47
  • Duplicated block (6 lines × 2) crates/buzz-acp/src/lib.rs:2938 — crates/buzz-acp/src/lib.rs:2938-2943 | crates/buzz-acp/src/setup_mode.rs:328-333 — 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) crates/buzz-acp/src/queue.rs:566 — crates/buzz-acp/src/queue.rs:566-571 | crates/buzz-acp/src/queue.rs:601-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/buzz-acp/src/queue.rs:1426 — crates/buzz-acp/src/queue.rs:1426-1431 | crates/buzz-sdk/src/mentions.rs:112-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 (6 lines × 2) crates/buzz-agent/src/llm.rs:1996 — crates/buzz-agent/src/llm.rs:1996-2001 | crates/buzz-agent/src/llm.rs:2435-2440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-agent/src/llm.rs:1996` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/buzz-cli/src/commands/mem.rs:272 — crates/buzz-cli/src/commands/mem.rs:272-280 | 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) crates/buzz-cli/src/commands/workflows.rs:40 — crates/buzz-cli/src/commands/workflows.rs:40-45 | crates/buzz-cli/src/commands/workflows.rs:129-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/buzz-db/src/store/api_token.rs:241 — crates/buzz-db/src/store/api_token.rs:241-247 | crates/buzz-db/src/store/api_token.rs:572-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/api_token.rs:241` 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 (6 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:1942 — crates/buzz-db/src/store/relay_admin_actions.rs:1942-1947 | crates/buzz-db/src/store/relay_admin_actions.rs:1959-1964 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/relay_admin_actions.rs:1942` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/buzz-deletion/src/lib.rs:1115 — crates/buzz-deletion/src/lib.rs:1115-1120 | crates/buzz-deletion/src/lib.rs:1349-1354 — both copies are in the same file, so extract the 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 `crates/buzz-deletion/src/lib.rs:1115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-dev-mcp/src/shell.rs:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) crates/buzz-relay/src/api/bridge.rs:2198 — crates/buzz-relay/src/api/bridge.rs:2198-2203 | crates/buzz-relay/src/handlers/req.rs:602-607 — 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 4 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. 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/api/bridge.rs:2198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/buzz-relay/src/api/bridge.rs:3002 — crates/buzz-relay/src/api/bridge.rs:3002-3007 | crates/buzz-relay/src/handlers/command_executor.rs:974-979 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/api/bridge.rs:3002` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/buzz-relay/src/readiness.rs:619 — crates/buzz-relay/src/readiness.rs:619-624 | crates/buzz-relay/src/readiness.rs:652-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/readiness.rs:619` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) desktop/src-tauri/src/archive/metric_store.rs:404 — desktop/src-tauri/src/archive/metric_store.rs:404-409 | desktop/src-tauri/src/archive/store_migrations.rs:155-160 — 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 `desktop/src-tauri/src/archive/metric_store.rs:404` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) desktop/src-tauri/src/commands/identity.rs:408 — desktop/src-tauri/src/commands/identity.rs:408-413 | desktop/src-tauri/src/commands/identity.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) desktop/src-tauri/src/commands/teams/mod.rs:431 — desktop/src-tauri/src/commands/teams/mod.rs:431-436 | desktop/src-tauri/src/commands/teams/mod.rs:481-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/teams/mod.rs:431` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `CreateTeamRequest` in one and `UpdateTeamRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/commands/teams/mod.rs:437` calls `now_iso` and `desktop/src-tauri/src/commands/teams/mod.rs:488` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) desktop/src-tauri/src/mesh_llm/mod.rs:620 — desktop/src-tauri/src/mesh_llm/mod.rs:620-625 | desktop/src-tauri/src/mesh_llm/mod.rs:651-656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) desktop/src-tauri/src/migration/detach.rs:37 — desktop/src-tauri/src/migration/detach.rs:37-42 | desktop/src-tauri/src/migration/team_membership.rs:99-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/migration/detach.rs:37` 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 (6 lines × 2) desktop/src-tauri/src/relay/profile_avatar.rs:134 — desktop/src-tauri/src/relay/profile_avatar.rs:134-139 | desktop/src-tauri/src/relay/profile_avatar.rs:166-174 — both copies are in the same file, so extract the 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 `desktop/src-tauri/src/relay/profile_avatar.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/secret_store.rs:321` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/buzz-media/src/validation.rs:692 — crates/buzz-media/src/validation.rs:692-697 | crates/buzz-media/src/validation.rs:725-730 — both copies are in the same file, so extract the 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 `crates/buzz-media/src/validation.rs:692` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/buzz-acp/src/git.rs:396 — crates/buzz-acp/src/git.rs:396-401 | 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.
  • Duplicated block (6 lines × 2) crates/buzz-acp/src/git.rs:414 — crates/buzz-acp/src/git.rs:414-419 | crates/buzz-dev-mcp/src/shim.rs:51-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/buzz-cli/src/commands/mem.rs:79 — crates/buzz-cli/src/commands/mem.rs:79-84 | crates/buzz-cli/src/commands/notes.rs:475-480 — 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) crates/buzz-relay-mesh/src/registry.rs:163 — crates/buzz-relay-mesh/src/registry.rs:163-168 | crates/buzz-relay/src/invite_token.rs:214-219 — 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.
  • + 22 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 47) desktop/src-tauri/src/lib.rs:101 — buzz_desktop::run 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_desktop::commands::pairing::pairing_ws_task_inner (cyclomatic 39) desktop/src-tauri/src/commands/pairing.rs:351 — buzz_desktop::commands::pairing::pairing_ws_task_inner has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::migration::sync_shared_agent_data (cyclomatic 39) desktop/src-tauri/src/migration.rs:785 — buzz_desktop::migration::sync_shared_agent_data has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file (cyclomatic 36) desktop/src-tauri/src/migration/pollen.rs:21 — buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::managed_agents::backend::invoke_provider (cyclomatic 34) desktop/src-tauri/src/managed_agents/backend.rs:76 — buzz_desktop::managed_agents::backend::invoke_provider has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::native_relay_client::run_connection (cyclomatic 34) desktop/src-tauri/src/native_relay_client.rs:522 — buzz_desktop::native_relay_client::run_connection has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::commands::agents::create_managed_agent_in (cyclomatic 31) desktop/src-tauri/src/commands/agents.rs:400 — buzz_desktop::commands::agents::create_managed_agent_in has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_desktop::commands::agent_models_update::update_managed_agent (cyclomatic 30) desktop/src-tauri/src/commands/agent_models_update.rs:143 — buzz_desktop::commands::agent_models_update::update_managed_agent has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::commands::team_snapshot::confirm_team_snapshot_import (cyclomatic 30) desktop/src-tauri/src/commands/team_snapshot.rs:514 — buzz_desktop::commands::team_snapshot::confirm_team_snapshot_import has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • buzz_desktop::managed_agents::runtime::spawn_agent_child (cyclomatic 30) desktop/src-tauri/src/managed_agents/runtime.rs:484 — buzz_desktop::managed_agents::runtime::spawn_agent_child has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_desktop::reset::run_boot_reset_with_keychain (cyclomatic 29) desktop/src-tauri/src/reset.rs:185 — buzz_desktop::reset::run_boot_reset_with_keychain has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::huddle::start_huddle (cyclomatic 25) desktop/src-tauri/src/huddle/mod.rs:189 — buzz_desktop::huddle::start_huddle has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::commands::personas::update::update_persona_with (cyclomatic 24) desktop/src-tauri/src/commands/personas/update.rs:241 — buzz_desktop::commands::personas::update::update_persona_with 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_desktop::media_proxy::handle_buzz_media (cyclomatic 23) desktop/src-tauri/src/media_proxy.rs:190 — buzz_desktop::media_proxy::handle_buzz_media has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::commands::channels::fetch::fetch_channels (cyclomatic 22) desktop/src-tauri/src/commands/channels/fetch.rs:211 — buzz_desktop::commands::channels::fetch::fetch_channels has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::commands::personas::inbound::reconcile_inbound_persona_event_blocking (cyclomatic 22) desktop/src-tauri/src/commands/personas/inbound.rs:152 — buzz_desktop::commands::personas::inbound::reconcile_inbound_persona_event_blocking has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::deep_link::parse_entity_deep_link (cyclomatic 22) desktop/src-tauri/src/deep_link.rs:424 — buzz_desktop::deep_link::parse_entity_deep_link has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch (cyclomatic 22) desktop/src-tauri/src/managed_agents/restore.rs:140 — buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::unread_catch_up::classify_batch (cyclomatic 22) desktop/src-tauri/src/unread_catch_up.rs:250 — buzz_desktop::unread_catch_up::classify_batch has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_desktop::commands::channels::ensure_starter_channels_inner (cyclomatic 21) desktop/src-tauri/src/commands/channels.rs:426 — buzz_desktop::commands::channels::ensure_starter_channels_inner 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::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::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 (8 lines × 2) · ×43
  • Duplicated block (8 lines × 2) crates/buzz-acp/src/relay.rs:3486 — crates/buzz-acp/src/relay.rs:3486-3493 | crates/buzz-acp/src/relay.rs:3543-3550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/buzz-cli/src/commands/channels.rs:236 — crates/buzz-cli/src/commands/channels.rs:236-243 | crates/buzz-cli/src/commands/channels.rs:259-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/buzz-cli/src/commands/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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/social.rs:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/buzz-cli/src/links.rs:115 — crates/buzz-cli/src/links.rs:115-122 | crates/buzz-relay/src/handlers/side_effects.rs:3894-3901 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/validate.rs:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/buzz-relay/src/api/invites.rs:514 — crates/buzz-relay/src/api/invites.rs:514-521 | crates/buzz-relay/src/api/invites.rs:610-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-relay/src/api/invites.rs:523` calls `hash_v2_code` and `crates/buzz-relay/src/api/invites.rs:619` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/agents.rs:159 — desktop/src-tauri/src/commands/agents.rs:159-166 | desktop/src-tauri/src/commands/agents.rs:1026-1033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/agents_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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agents_profile.rs:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/messages/forum.rs:50 — desktop/src-tauri/src/commands/messages/forum.rs:50-57 | desktop/src-tauri/src/commands/messages/forum.rs:93-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/personas/card.rs:499 — desktop/src-tauri/src/commands/personas/card.rs:499-506 | desktop/src-tauri/src/commands/personas/card.rs:557-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/personas/mod.rs:82 — desktop/src-tauri/src/commands/personas/mod.rs:82-89 | desktop/src-tauri/src/commands/personas/mod.rs:300-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/personas/mod.rs:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/personas/sharing.rs:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/project_git_workflow.rs:253 — desktop/src-tauri/src/commands/project_git_workflow.rs:253-260 | desktop/src-tauri/src/commands/project_git_workflow.rs:295-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/social.rs:208 — desktop/src-tauri/src/commands/social.rs:208-215 | desktop/src-tauri/src/commands/social.rs:284-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/social.rs:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/deep_link.rs:318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/deep_link.rs:328` calls `Some` and `desktop/src-tauri/src/deep_link.rs:355` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/managed_agents/nest.rs:494 — desktop/src-tauri/src/managed_agents/nest.rs:494-501 | desktop/src-tauri/src/managed_agents/nest.rs:543-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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/nest.rs:494` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/media_proxy.rs:90 — desktop/src-tauri/src/media_proxy.rs:90-97 | desktop/src-tauri/src/media_proxy.rs:246-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/media_proxy.rs:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/mesh_llm/mod.rs:375` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/mesh_llm/mod.rs:383` calls `Some`, `max_vram_gb` and `desktop/src-tauri/src/mesh_llm/mod.rs:420` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/buzz-admin/src/communities.rs:75 — crates/buzz-admin/src/communities.rs:75-82 | crates/buzz-admin/src/communities.rs:127-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 (8 lines × 2) crates/buzz-relay/src/handlers/moderation_commands.rs:619 — crates/buzz-relay/src/handlers/moderation_commands.rs:619-626 | crates/buzz-relay/src/handlers/relay_admin.rs:51-58 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:531 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:531-538 | desktop/src-tauri/src/commands/team_snapshot.rs:552-559 — 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 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/native_relay_client.rs:697 — desktop/src-tauri/src/native_relay_client.rs:697-704 | desktop/src-tauri/src/native_relay_client.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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/native_relay_client.rs:697` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/media.rs:721 — desktop/src-tauri/src/commands/media.rs:721-728 | desktop/src-tauri/src/commands/media.rs:741-748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media.rs:721` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/channel_templates.rs:65 — desktop/src-tauri/src/commands/channel_templates.rs:65-72 | desktop/src-tauri/src/commands/channel_templates.rs:108-115 — both copies are in the same file, so extract the 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 `desktop/src-tauri/src/commands/channel_templates.rs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `CreateChannelTemplateRequest` in one and `UpdateChannelTemplateRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/commands/channel_templates.rs:73` calls `now_iso` and `desktop/src-tauri/src/commands/channel_templates.rs:117` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • + 18 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×42
  • 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
  • + 17 more in this group — see findings.md.
AX7 · Slice cohesion · Cross-slice coupling · ×40
  • Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:248 — `DirectActionsProvider` (slice 'admin-console') depends on `memberSearchLabel` from slice 'profile'.
  • Cross-slice coupling: admin-console → onboarding desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:617 — `useAdminMemberSearch` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'.
  • Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:664 — `AdminMemberPicker` (slice 'admin-console') depends on `useMemberCandidates` from slice 'profile'.
  • Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:717 — `AdminMemberPicker` (slice 'admin-console') depends on `MemberSearchResult` from slice 'profile'.
  • Cross-slice coupling: admin-console → onboarding desktop/src/features/admin-console/AdminConsoleCommunities.tsx:48 — `CommunitiesTab` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'.
  • Cross-slice coupling: admin-console → communities desktop/src/features/admin-console/AdminConsolePanel.tsx:150 — `AdminConsolePanel` (slice 'admin-console') depends on `useCommunities` from slice 'communities'.
  • Cross-slice coupling: admin-console → forum desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:263 — `formatTimestamp` (slice 'admin-console') depends on `formatRelativeTime` from slice 'forum'.
  • Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:702 — `ReportsTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'.
  • Cross-slice coupling: admin-console → settings desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:216 — `AdminConsoleSettingsCard` (slice 'admin-console') depends on `SettingsSectionHeader` from slice 'settings'.
  • Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:483 — `StaffingTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'.
  • Cross-slice coupling: admin-console → communities desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:161 — `mountCard` (slice 'admin-console') depends on `CommunitiesProvider` from slice 'communities'.
  • Cross-slice coupling: agent-memory → agents desktop/src/features/agent-memory/hooks.ts:42 — `useIsManagedAgent` (slice 'agent-memory') depends on `useManagedAgentsQuery` from slice 'agents'.
  • Cross-slice coupling: agents → channels desktop/src/features/agents/hooks.ts:157 — `invalidateAgentQueries` (slice 'agents') depends on `channelsQueryKey` from slice 'channels'.
  • Cross-slice coupling: agents → channels desktop/src/features/agents/hooks.ts:470 — `useUpdateManagedAgentMutation` (slice 'agents') depends on `updateCachedChannelMemberDisplayName` from slice 'channels'.
  • Cross-slice coupling: agents → profile desktop/src/features/agents/hooks.ts:491 — `useUpdateManagedAgentMutation` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'.
  • Cross-slice coupling: agents → channels desktop/src/features/agents/hooks.ts:723 — `useAttachManagedAgentToChannelMutation` (slice 'agents') depends on `upsertCachedChannelMember` from slice 'channels'.
  • Cross-slice coupling: agents → profile desktop/src/features/agents/lib/personaEditCaches.ts:21 — `invalidatePersonaEditCaches` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'.
  • Cross-slice coupling: agents → presence desktop/src/features/agents/lib/useAgentAvailability.ts:43 — `useAgentAvailabilityLookup` (slice 'agents') depends on `usePresenceQuery` from slice 'presence'.
  • Cross-slice coupling: agents → presence desktop/src/features/agents/lib/useAgentAvailability.ts:48 — `useAgentAvailabilityLookup` (slice 'agents') depends on `presenceQueryKey` from slice 'presence'.
  • Cross-slice coupling: agents → communities desktop/src/features/agents/managedAgentRuntimeHooks.ts:88 — `bootstrapManagedAgentRuntimePairs` (slice 'agents') depends on `loadCommunities` from slice 'communities'.
  • Cross-slice coupling: agents → communities desktop/src/features/agents/managedAgentRuntimeHooks.ts:128 — `clearActiveTurnsForAgentOnStop` (slice 'agents') depends on `loadActiveCommunityId` from slice 'communities'.
  • Cross-slice coupling: agents → projects desktop/src/features/agents/observerRelayStore.ts:142 — `projectChannelRequestListeners` (slice 'agents') depends on `ProjectChannelRequest` from slice 'projects'.
  • Cross-slice coupling: agents → projects desktop/src/features/agents/observerRelayStore.ts:516 — `processLiveObserverEvents` (slice 'agents') depends on `parseProjectChannelRequest` from slice 'projects'.
  • Cross-slice coupling: agents → channels desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:41 — `AddAgentToChannelDialog` (slice 'agents') depends on `useChannelsQuery` from slice 'channels'.
  • Cross-slice coupling: agents → channels desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:79 — `AddAgentToChannelDialog` (slice 'agents') depends on `useChannelMembersQuery` from slice 'channels'.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×40
  • Duplicated block (7 lines × 2) crates/buzz-acp/src/relay.rs:509 — crates/buzz-acp/src/relay.rs:509-515 | crates/buzz-acp/src/relay.rs:522-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `filters` to `&[nostr::Filter]` in one and `&[Value]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) crates/buzz-acp/src/relay.rs:3950 — crates/buzz-acp/src/relay.rs:3950-3956 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/relay.rs:3950` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/buzz-admin/src/nip_fi.rs:123 — crates/buzz-admin/src/nip_fi.rs:123-129 | crates/buzz-admin/src/nip_fi.rs:141-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-admin/src/nip_fi.rs:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (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. 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 (7 lines × 2) crates/buzz-db/src/store/channel.rs:771 — crates/buzz-db/src/store/channel.rs:771-777 | crates/buzz-db/src/store/dm.rs:513-519 — 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 `crates/buzz-db/src/store/channel.rs:771` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-dev-mcp/src/view_image.rs:263` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/buzz-media/src/bucket_index.rs:153 — crates/buzz-media/src/bucket_index.rs:153-159 | crates/buzz-media/src/bucket_index.rs:177-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-media/src/bucket_index.rs:152` calls `parse_canonical_uuid`, `next` and `crates/buzz-media/src/bucket_index.rs:176` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/buzz-relay/src/audio/handler.rs:1891 — crates/buzz-relay/src/audio/handler.rs:1891-1897 | crates/buzz-relay/src/audio/handler.rs:2748-2754 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:1891` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/buzz-relay/src/audio/join.rs:573 — crates/buzz-relay/src/audio/join.rs:573-579 | crates/buzz-relay/src/tunnel/reliable.rs:592-598 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/join.rs:573` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/audio/join.rs:571` calls `owner_runtime_id`, `generation` and `crates/buzz-relay/src/tunnel/reliable.rs:591` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/buzz-relay/src/router.rs:906 — crates/buzz-relay/src/router.rs:906-912 | crates/buzz-relay/src/router.rs:1035-1042 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/router.rs:906` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/buzz-workflow/src/executor.rs:885 — crates/buzz-workflow/src/executor.rs:885-891 | crates/buzz-workflow/src/executor.rs:893-899 — both copies are in the same file, so extract the 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 `crates/buzz-workflow/src/executor.rs:885` 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 × 2) desktop/src-tauri/src/commands/agent_auth.rs:114 — desktop/src-tauri/src/commands/agent_auth.rs:114-120 | desktop/src-tauri/src/commands/agent_auth.rs:250-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/commands/agent_discovery.rs:129 — desktop/src-tauri/src/commands/agent_discovery.rs:129-137 | desktop/src-tauri/src/managed_agents/discovery.rs:1162-1168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agent_discovery.rs:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/commands/media_transcode.rs:158 — desktop/src-tauri/src/commands/media_transcode.rs:158-164 | desktop/src-tauri/src/commands/relay_reconnect.rs:70-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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media_transcode.rs:158` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `desktop/src-tauri/src/commands/profile.rs:241` calls `insert`, `to_string` and `desktop/src-tauri/src/commands/social.rs:133` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/discovery/login_shell.rs:288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/mesh_llm/recovery.rs:402 — desktop/src-tauri/src/mesh_llm/recovery.rs:402-408 | desktop/src-tauri/src/mesh_llm/recovery.rs:415-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/migration/backfill.rs:52 — desktop/src-tauri/src/migration/backfill.rs:52-58 | desktop/src-tauri/src/migration/team_suffix.rs:68-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/persona_catalog.rs:86 — desktop/src-tauri/src/persona_catalog.rs:86-92 | desktop/src-tauri/src/team_catalog.rs:76-82 — 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 6 separate duplicated blocks between them, totalling at least 51 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 `desktop/src-tauri/src/persona_catalog.rs:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/buzz-pairing-cli/src/main.rs:494 — crates/buzz-pairing-cli/src/main.rs:494-500 | desktop/src-tauri/src/commands/pairing.rs:868-874 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/channel_head_cache.rs:34 — desktop/src-tauri/src/channel_head_cache.rs:34-40 | desktop/src-tauri/src/observed_unread.rs:49-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/channel_head_cache.rs:303 — desktop/src-tauri/src/channel_head_cache.rs:303-309 | desktop/src-tauri/src/observed_unread.rs:667-673 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs:88 — desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs:88-94 | desktop/src-tauri/src/commands/channels/fetch.rs:19-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/commands/personas/pending.rs:96 — desktop/src-tauri/src/commands/personas/pending.rs:96-102 | desktop/src-tauri/src/commands/teams/pending.rs:55-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) desktop/src-tauri/src/media_proxy.rs:278 — desktop/src-tauri/src/media_proxy.rs:278-284 | desktop/src-tauri/src/media_proxy.rs:294-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 15 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file desktop/src/protectedFeatures/bestie/BestiePopover.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/agents/ui/ManagedAgentRow.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/protectedFeatures/bestie/BloomMenu.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/agents/ui/ModelPicker.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/community-members/ui/CommunityMembersCard.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/home/ui/FeedSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/protectedFeatures/bestie/BestieGlobalOverlay.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/profile/ui/AvatarUpload.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/protectedFeatures/bestie/useBestie.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/scripts/generate-sound-waveforms.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/scripts/texture-card/generate-card-texture.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/messages/useLoadMissingAncestors.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/channels/ui/QuickBotBar.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/home/ui/RecentNotesSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/community-members/ui/ConfirmRemoveDialog.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/protectedFeatures/internalUi.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/protectedFeatures/bestie/BestieProfileSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mobile/scripts/generate-emoji-data.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/shared/ui/card.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/channels/ui/MembersSidebarAgentControls.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/agents/lib/pickBotName.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/agents/ui/useWindowFileDragOver.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/scripts/summarize-flaky-tests.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file desktop/src/features/channels/ui/useQuickBotDrop.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×38
  • Duplicated block (11 lines × 2) crates/buzz-admin/src/main.rs:469 — crates/buzz-admin/src/main.rs:469-479 | crates/buzz-admin/src/main.rs:508-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/buzz-cli/src/commands/channels.rs:725 — crates/buzz-cli/src/commands/channels.rs:725-736 | crates/buzz-cli/src/commands/channels.rs:1512-1522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-cli/src/commands/channels.rs:1511` calls `as_deref` and `crates/buzz-cli/src/commands/channels.rs:724` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/buzz-db/src/store/channel_members.rs:2287 — crates/buzz-db/src/store/channel_members.rs:2287-2297 | crates/buzz-db/src/store/event.rs:1746-1756 — 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 `crates/buzz-db/src/store/channel_members.rs:2287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `channel_ids` to `&[Uuid]` in one and `&[uuid::Uuid]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) crates/buzz-db/src/store/community.rs:342 — crates/buzz-db/src/store/community.rs:342-352 | crates/buzz-db/src/store/nip_fi_binding.rs:230-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/community.rs:342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/buzz-db/src/store/reaction.rs:390 — crates/buzz-db/src/store/reaction.rs:390-400 | crates/buzz-db/src/store/relay_admin_actions.rs:1368-1378 — 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 `crates/buzz-db/src/store/reaction.rs:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/buzz-db/src/store/relay_invite.rs:550 — crates/buzz-db/src/store/relay_invite.rs:550-560 | crates/buzz-db/src/store/relay_invite.rs:575-585 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/relay_invite.rs:550` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-db/src/store/relay_invite.rs:586` calls `principal_restricted`, `conn` and `crates/buzz-db/src/store/relay_invite.rs:561` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/buzz-dev-mcp/src/shell.rs:654 — crates/buzz-dev-mcp/src/shell.rs:654-665 | desktop/src-tauri/src/managed_agents/git_bash.rs:308-318 — before extracting anything, compare `crates/buzz-dev-mcp/src/shell.rs` and `desktop/src-tauri/src/managed_agents/git_bash.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 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) crates/buzz-pair-relay/src/lib.rs:301 — crates/buzz-pair-relay/src/lib.rs:301-311 | crates/buzz-pair-relay/src/lib.rs:585-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/admin_action_worker.rs:49` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:714 — crates/buzz-relay/src/handlers/ingest.rs:714-724 | crates/buzz-relay/src/handlers/side_effects.rs:3729-3739 — 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 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:4390 — crates/buzz-relay/src/handlers/side_effects.rs:4390-4400 | crates/buzz-relay/src/handlers/side_effects.rs:4849-4859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/side_effects.rs:4390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn synth_chunk( &mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-voice/src/pocket_april.rs:932` calls `initialize_state` and `crates/buzz-voice/src/pocket_april.rs:643` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/buzz-ws-client/src/connection.rs:311 — crates/buzz-ws-client/src/connection.rs:311-321 | crates/buzz-ws-client/src/connection.rs:365-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-ws-client/src/connection.rs:311` 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 (11 lines × 2) desktop/src-tauri/src/commands/agent_discovery.rs:592 — desktop/src-tauri/src/commands/agent_discovery.rs:592-602 | desktop/src-tauri/src/commands/global_agent_config.rs:329-339 — before extracting anything, compare `desktop/src-tauri/src/commands/agent_discovery.rs` and `desktop/src-tauri/src/commands/global_agent_config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agent_discovery.rs:592` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/messages.rs:273` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:630 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:630-640 | desktop/src-tauri/src/commands/team_snapshot.rs:581-591 — 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 139 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/personas/snapshot/import.rs:709 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:709-719 | desktop/src-tauri/src/commands/team_snapshot.rs:795-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 139 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/personas/snapshot/import.rs:709` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 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/huddle/pipeline.rs:510 — desktop/src-tauri/src/huddle/pipeline.rs:510-520 | desktop/src-tauri/src/huddle/pipeline.rs:636-646 — both copies are in the same file, so extract the block into 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/managed_agents/config_bridge/reader.rs:344` calls `as_deref` and `desktop/src-tauri/src/managed_agents/config_bridge/reader.rs:503` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) desktop/src-tauri/src/relay/profile_avatar.rs:172 — desktop/src-tauri/src/relay/profile_avatar.rs:172-182 | desktop/src-tauri/src/relay/profile_avatar.rs:227-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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/relay/profile_avatar.rs:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) desktop/src-tauri/src/archive/store.rs:172 — desktop/src-tauri/src/archive/store.rs:172-182 | desktop/src-tauri/src/managed_agents/retention.rs:155-165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) desktop/src-tauri/src/commands/personas/card.rs:546 — desktop/src-tauri/src/commands/personas/card.rs:546-556 | desktop/src-tauri/src/commands/personas/snapshot.rs:262-272 — 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.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×37
  • Duplicated block (9 lines × 2) crates/buzz-acp/src/lib.rs:3152 — crates/buzz-acp/src/lib.rs:3152-3160 | crates/buzz-acp/src/lib.rs:3173-3181 — both copies are in the same file, so extract the block into 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:3736 — crates/buzz-acp/src/relay.rs:3736-3744 | crates/buzz-acp/src/relay.rs:3773-3781 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/relay.rs:3736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/buzz-cli/src/commands/users.rs:49 — crates/buzz-cli/src/commands/users.rs:49-57 | crates/buzz-cli/src/commands/users.rs:470-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) REDACTED:2317 — REDACTED:2317-2325 | REDACTED:2454-2464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/buzz-db/src/store/reaction.rs:122 — crates/buzz-db/src/store/reaction.rs:122-131 | crates/buzz-db/src/store/workflow.rs:353-361 — 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 `crates/buzz-db/src/store/reaction.rs:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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/artifact_sync.rs:179 — crates/buzz-relay/src/api/artifact_sync.rs:179-187 | crates/buzz-relay/src/api/artifact_sync.rs:282-290 — both copies are in the same file, so extract the block into 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/ingest.rs:1378 — crates/buzz-relay/src/handlers/ingest.rs:1378-1386 | crates/buzz-relay/src/handlers/ingest.rs:1481-1489 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/ingest.rs:1378` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:2273 — crates/buzz-relay/src/handlers/side_effects.rs:2273-2281 | crates/buzz-relay/src/handlers/side_effects.rs:3282-3290 — both copies are in the same file, so extract the block into 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:2184 — crates/buzz-relay/src/main.rs:2184-2192 | crates/buzz-relay/src/main.rs:2217-2225 — both copies are in the same file, so extract the block into 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:240 — crates/buzz-ws-client/src/connection.rs:240-248 | crates/buzz-ws-client/src/connection.rs:350-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-ws-client/src/connection.rs:240` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/git-sign-nostr/src/lib.rs:1585` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (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/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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/project_git.rs:809` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) desktop/src-tauri/src/commands/project_git_workflow.rs:572 — desktop/src-tauri/src/commands/project_git_workflow.rs:572-580 | desktop/src-tauri/src/commands/project_terminal.rs:235-243 — 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 `desktop/src-tauri/src/commands/project_git_workflow.rs:572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/social.rs:387` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `records` to `&mut [TeamRecord]` in one and `&mut [ChannelTemplateRecord]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/teams.rs:167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/managed_agents/teams.rs:195` calls `exists`, `save_teams` and `desktop/src-tauri/src/managed_agents/teams.rs:176` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/relay.rs:244` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/buzz-relay/src/handlers/moderation_commands.rs:575 — crates/buzz-relay/src/handlers/moderation_commands.rs:575-583 | crates/buzz-relay/src/handlers/moderation_commands.rs:590-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/moderation_commands.rs:575` 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 (9 lines × 2) desktop/src-tauri/src/persona_catalog.rs:198 — desktop/src-tauri/src/persona_catalog.rs:198-206 | desktop/src-tauri/src/team_catalog.rs:316-324 — 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 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/buzz-acp/src/relay.rs:2813 — crates/buzz-acp/src/relay.rs:2813-2824 | crates/buzz-acp/src/relay.rs:2982-2990 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/relay.rs:2813` 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.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×32
  • Duplicated block (5 lines × 2) crates/buzz-acp/src/relay.rs:3946 — crates/buzz-acp/src/relay.rs:3946-3950 | crates/buzz-acp/src/relay.rs:3974-3980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-acp/src/relay.rs:3950` calls `to_string`, `get`, `and_then` and `crates/buzz-acp/src/relay.rs:3980` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) crates/buzz-auth/src/nip_fi/command.rs:588 — crates/buzz-auth/src/nip_fi/command.rs:588-592 | crates/buzz-auth/src/nip_fi/verifier.rs:432-436 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) REDACTED:1338 — REDACTED:1338-1342 | REDACTED:1552-1556 — both copies are in the same file, so extract the block into 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-media/src/storage.rs:296` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/buzz-relay/src/api/bridge.rs:2829 — crates/buzz-relay/src/api/bridge.rs:2829-2833 | crates/buzz-relay/src/handlers/req.rs:1143-1148 — 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 4 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. 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/api/bridge.rs:2829` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:513 — crates/buzz-relay/src/handlers/side_effects.rs:513-517 | crates/buzz-relay/src/handlers/side_effects.rs:3388-3392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/handlers/side_effects.rs:508` calls `effective_message_author`, `public_key`, `extract_target_event_ids` and `crates/buzz-relay/src/handlers/side_effects.rs:3387` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-sdk/src/mentions.rs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) desktop/src-tauri/src/archive/store.rs:756 — desktop/src-tauri/src/archive/store.rs:756-760 | desktop/src-tauri/src/archive/store_migrations.rs:152-156 — 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 `desktop/src-tauri/src/archive/store.rs:756` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 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:249 — desktop/src-tauri/src/managed_agents/nest.rs:249-255 | desktop/src-tauri/src/managed_agents/nest.rs:275-279 — both copies are in the same file, so extract the 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 `desktop/src-tauri/src/managed_agents/nest.rs:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/buzz-relay/src/fenced_cache.rs:130 — crates/buzz-relay/src/fenced_cache.rs:130-134 | crates/buzz-relay/src/host_cache.rs:127-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) desktop/src-tauri/src/commands/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-db/src/store/media.rs:448 — crates/buzz-db/src/store/media.rs:448-456 | crates/buzz-db/src/store/media.rs:462-466 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/media.rs:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/buzz-voice/src/imported.rs:286 — crates/buzz-voice/src/imported.rs:286-290 | desktop/src-tauri/src/managed_agents/storage.rs:644-650 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-voice/src/imported.rs:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/identity_archive.rs:172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/archive/store_migrations.rs:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/buzz-cli/src/commands/agents.rs:373 — crates/buzz-cli/src/commands/agents.rs:373-377 | crates/buzz-cli/src/commands/agents.rs:435-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/buzz-cli/src/commands/channels.rs:374 — crates/buzz-cli/src/commands/channels.rs:374-378 | crates/buzz-cli/src/commands/workflows.rs:80-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/channels.rs:374` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-cli/src/commands/workflows.rs:85` calls `get`, `and_then`, `as_u64` and `crates/buzz-cli/src/commands/channels.rs:379` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) crates/buzz-cli/src/commands/channels.rs:819 — crates/buzz-cli/src/commands/channels.rs:819-823 | crates/buzz-cli/src/commands/emoji.rs:128-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/channels.rs:819` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 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:557 — crates/buzz-core/src/engram.rs:557-561 | crates/buzz-core/src/engram.rs:576-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-core/src/engram.rs:557` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) desktop/src-tauri/src/managed_agents/storage.rs:691 — desktop/src-tauri/src/managed_agents/storage.rs:691-695 | desktop/src-tauri/src/migration/pollen.rs:364-368 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/storage.rs:691` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/buzz-media/src/validation.rs:438 — crates/buzz-media/src/validation.rs:438-442 | crates/buzz-media/src/validation.rs:943-947 — both copies are in the same file, so extract the block into 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) mobile/ios/Runner/NativeAddMembersSheet.swift:39 — mobile/ios/Runner/NativeAddMembersSheet.swift:39-43 | mobile/ios/Runner/NativeConfirmationDialog.swift:34-38 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mobile/ios/Runner/NativeConfirmationDialog.swift:33` calls `result` and `mobile/ios/Runner/NativeAddMembersSheet.swift:38` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) mobile/ios/Runner/NativeReactionDetails.swift:554 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:822-828 | mobile/ios/Runner/NativeReactionDetails.swift:554-558 — 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.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×31
  • Duplicated block (10 lines × 2) crates/buzz-acp/src/queue.rs:2435 — crates/buzz-acp/src/queue.rs:2435-2444 | crates/buzz-acp/src/queue.rs:2478-2487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/queue.rs:2435` 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 (10 lines × 2) crates/buzz-acp/src/relay.rs:3939 — crates/buzz-acp/src/relay.rs:3939-3948 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/relay.rs:3939` 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 (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:1504 — REDACTED:1504-1513 | REDACTED:1766-1775 — both copies are in the same file, so extract the 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 `REDACTED:1504` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1501` calls `Some`, `Ok` and `REDACTED:1765` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/buzz-db/src/store/workflow.rs:1078 — crates/buzz-db/src/store/workflow.rs:1078-1087 | crates/buzz-db/src/store/workflow.rs:1296-1305 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/workflow.rs:1078` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/workflow.rs:1076` calls `bind` and `crates/buzz-db/src/store/workflow.rs:1295` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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 — before extracting anything, compare `crates/buzz-dev-mcp/src/shell.rs` and `desktop/src-tauri/src/managed_agents/git_bash.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (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:242-251 — 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.
  • Duplicated block (10 lines × 2) crates/buzz-relay/src/operator_listener.rs:179 — crates/buzz-relay/src/operator_listener.rs:179-188 | crates/buzz-relay/src/storage_usage_delivery.rs:182-191 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/buzz-relay/src/protocol.rs:137 — crates/buzz-relay/src/protocol.rs:137-146 | crates/buzz-relay/src/protocol.rs:210-219 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/protocol.rs:137` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-voice/src/pocket_april.rs:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn synth_chunk( &mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) desktop/src-tauri/src/commands/admin/mod.rs:984 — desktop/src-tauri/src/commands/admin/mod.rs:984-993 | desktop/src-tauri/src/commands/admin/mod.rs:1020-1029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/admin/mod.rs:984` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/effective_config/mod.rs:82` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/mesh_llm/mod.rs:689` 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 (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 6 separate duplicated blocks between them, totalling at least 51 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 `desktop/src-tauri/src/persona_catalog.rs:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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 6 separate duplicated blocks between them, totalling at least 51 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 `desktop/src-tauri/src/persona_catalog.rs:166` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) crates/buzz-agent/src/llm.rs:583 — crates/buzz-agent/src/llm.rs:583-592 | crates/buzz-agent/src/llm.rs:751-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-agent/src/llm.rs:583` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/buzz-voice/src/pocket_april.rs:644 — crates/buzz-voice/src/pocket_april.rs:644-653 | crates/buzz-voice/src/pocket_april.rs:935-944 — both copies are in the same file, so extract the 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 `crates/buzz-voice/src/pocket_april.rs:644` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-voice/src/pocket_april.rs:932` calls `initialize_state` and `crates/buzz-voice/src/pocket_april.rs:642` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/buzz-agent/src/mcp.rs:911 — crates/buzz-agent/src/mcp.rs:911-920 | crates/buzz-dev-mcp/src/str_replace.rs:166-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) crates/buzz-dev-mcp/src/lib.rs:189 — crates/buzz-dev-mcp/src/lib.rs:189-198 | desktop/src-tauri/src/util.rs:212-221 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) desktop/src-tauri/src/archive/store.rs:184 — desktop/src-tauri/src/archive/store.rs:184-193 | desktop/src-tauri/src/managed_agents/retention.rs:167-176 — 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:90-99 — 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:3981-3990 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) crates/buzz-sdk/src/builders.rs:1102 — crates/buzz-sdk/src/builders.rs:1102-1111 | crates/buzz-sdk/src/builders.rs:1165-1176 — both copies are in the same file, so extract the 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 `crates/buzz-sdk/src/builders.rs:1102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/buzz-db/src/store/channel_members.rs:1960 — crates/buzz-db/src/store/channel_members.rs:1960-1969 | crates/buzz-db/src/store/channel_members.rs:2319-2329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/channel_members.rs:1960` 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 (10 lines × 2) crates/buzz-db/src/store/allowlist.rs:104 — crates/buzz-db/src/store/allowlist.rs:104-113 | crates/buzz-db/src/store/archived_identities.rs:101-110 — 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 `crates/buzz-db/src/store/allowlist.rs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `pubkey` to `&[u8]` in one and `&str` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×28
  • Duplicated block (12 lines × 2) crates/buzz-agent/src/llm.rs:2557 — crates/buzz-agent/src/llm.rs:2557-2568 | crates/buzz-agent/src/llm.rs:2581-2592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-agent/src/llm.rs:2557` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/buzz-db/src/store/channel.rs:1456 — crates/buzz-db/src/store/channel.rs:1456-1467 | crates/buzz-db/src/store/channel.rs:1500-1511 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/channel.rs:1456` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/buzz-db/src/store/community.rs:849 — crates/buzz-db/src/store/community.rs:849-860 | crates/buzz-db/src/store/community.rs:907-918 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/community.rs:849` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/buzz-relay/src/api/git/cas_publish.rs:958 — crates/buzz-relay/src/api/git/cas_publish.rs:958-969 | crates/buzz-relay/src/api/git/transport.rs:1654-1665 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) crates/buzz-relay/src/api/git/store.rs:389 — crates/buzz-relay/src/api/git/store.rs:389-400 | crates/buzz-relay/src/api/git/store.rs:415-426 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/git/store.rs:389` 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 × 2) crates/buzz-relay/src/audio/handler.rs:1076 — crates/buzz-relay/src/audio/handler.rs:1076-1087 | crates/buzz-relay/src/audio/handler.rs:1219-1230 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:1076` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/audio/handler.rs:1075` calls `abort_reason`, `abort_cause` and `crates/buzz-relay/src/audio/handler.rs:1218` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) crates/buzz-relay/src/audio/handler.rs:2275 — crates/buzz-relay/src/audio/handler.rs:2275-2286 | crates/buzz-relay/src/audio/join.rs:1336-1347 — 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/handlers/count.rs:253 — crates/buzz-relay/src/handlers/count.rs:253-264 | crates/buzz-relay/src/handlers/count.rs:343-354 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/count.rs:253` 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 × 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) desktop/src-tauri/src/archive/agent_usage.rs:763 — desktop/src-tauri/src/archive/agent_usage.rs:763-774 | desktop/src-tauri/src/archive/agent_usage.rs:790-801 — both copies are in the same file, so extract the 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 `desktop/src-tauri/src/archive/agent_usage.rs:763` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/archive/store_migrations.rs:221` 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 (12 lines × 2) desktop/src-tauri/src/commands/agent_discovery.rs:649 — desktop/src-tauri/src/commands/agent_discovery.rs:649-660 | desktop/src-tauri/src/commands/global_agent_config.rs:387-398 — before extracting anything, compare `desktop/src-tauri/src/commands/agent_discovery.rs` and `desktop/src-tauri/src/commands/global_agent_config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agent_discovery.rs:649` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `app` to `&tauri::AppHandle` in one and `&AppHandle` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) desktop/src-tauri/src/commands/agents.rs:858 — desktop/src-tauri/src/commands/agents.rs:858-869 | desktop/src-tauri/src/commands/agents.rs:1021-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) desktop/src-tauri/src/commands/channels/fetch.rs:244 — desktop/src-tauri/src/commands/channels/fetch.rs:244-255 | desktop/src-tauri/src/commands/channels/fetch.rs:348-359 — both copies are in the same file, so extract the 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 `desktop/src-tauri/src/commands/channels/fetch.rs:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/buzz-db/src/store/channel.rs:2017 — crates/buzz-db/src/store/channel.rs:2017-2028 | crates/buzz-db/src/store/channel_members.rs:2422-2433 — 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 `crates/buzz-db/src/store/channel.rs:2017` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/buzz-db/src/store/push.rs:386 — crates/buzz-db/src/store/push.rs:386-397 | crates/buzz-db/src/store/push.rs:502-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/push.rs:386` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) crates/buzz-db/src/store/channel.rs:582 — crates/buzz-db/src/store/channel.rs:582-593 | crates/buzz-db/src/store/workflow.rs:808-824 — 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 `crates/buzz-db/src/store/channel.rs:582` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/archive/store_migrations.rs:46` 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 (12 lines × 2) desktop/src-tauri/src/app_state.rs:520 — desktop/src-tauri/src/app_state.rs:520-531 | desktop/src-tauri/src/app_state.rs:604-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/app_state.rs:520` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) crates/buzz-relay/src/audio/handler.rs:357 — crates/buzz-relay/src/audio/handler.rs:357-368 | crates/buzz-relay/src/connection.rs:472-483 — before extracting anything, compare `crates/buzz-relay/src/audio/handler.rs` and `crates/buzz-relay/src/connection.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/handler.rs:357` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/buzz-agent/src/llm.rs:2045 — crates/buzz-agent/src/llm.rs:2045-2056 | crates/buzz-agent/src/llm.rs:2479-2490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-agent/src/llm.rs:2045` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/project_git.rs:511` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:2797 — crates/buzz-relay/src/handlers/side_effects.rs:2797-2808 | crates/buzz-relay/src/handlers/side_effects.rs:2835-2846 — both copies are in the same file, so extract the block into 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/add_members_sheet.dart:378 — mobile/lib/features/channels/add_members_sheet.dart:378-389 | mobile/lib/features/channels/channels_page/sheets.dart:701-712 — before extracting anything, compare `mobile/lib/features/channels/add_members_sheet.dart` and `mobile/lib/features/channels/channels_page/sheets.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/add_members_sheet.dart:378` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) mobile/lib/features/channels/channel_detail_page/empty_messages.dart:14 — mobile/lib/features/channels/channel_detail_page/empty_messages.dart:14-25 | mobile/lib/features/forum/forum_posts_view.dart:226-237 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/empty_messages.dart:14` 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.
  • + 3 more in this group — see findings.md.
D2 · Cognitive Complexity · buzz_acp · ×27
  • buzz_acp::run_harness (cognitive 398) crates/buzz-acp/src/lib.rs:2877 — buzz_acp::run_harness has cognitive complexity 398 (threshold 15). Drivers by points: if/else 105 (276 pts), loops 21 (55 pts), match/switch 22 (54 pts), boolean chains 13 (nesting depth added 237). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_acp::relay::run_background_task (cognitive 166) crates/buzz-acp/src/relay.rs:1849 — buzz_acp::relay::run_background_task has cognitive complexity 166 (threshold 15). Drivers by points: if/else 37 (128 pts), match/switch 9 (30 pts), boolean chains 7, loops 1 (nesting depth added 112). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_acp::pool::run_prompt_task (cognitive 143) crates/buzz-acp/src/pool.rs:2415 — buzz_acp::pool::run_prompt_task has cognitive complexity 143 (threshold 15). Drivers by points: if/else 47 (96 pts), match/switch 22 (41 pts), boolean chains 6 (nesting depth added 68). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_acp::relay::handle_ws_message (cognitive 109) crates/buzz-acp/src/relay.rs:2287 — buzz_acp::relay::handle_ws_message has cognitive complexity 109 (threshold 15). Drivers by points: if/else 32 (80 pts), match/switch 9 (26 pts), boolean chains 3 (nesting depth added 65). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • buzz_acp::handle_prompt_result (cognitive 55) crates/buzz-acp/src/lib.rs:5270 — buzz_acp::handle_prompt_result has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (39 pts), match/switch 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::queue::format_context_hints (cognitive 49) crates/buzz-acp/src/queue.rs:1951 — buzz_acp::queue::format_context_hints has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (45 pts), boolean chains 3, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::relay::resubscribe_after_reconnect (cognitive 41) crates/buzz-acp/src/relay.rs:2780 — buzz_acp::relay::resubscribe_after_reconnect has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 2 (4 pts), loops 1 (2 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.
  • buzz_acp::config::resolve_channel_filters (cognitive 39) crates/buzz-acp/src/config.rs:1383 — buzz_acp::config::resolve_channel_filters has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 5 (14 pts), match/switch 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::relay::execute_connected_command (cognitive 38) crates/buzz-acp/src/relay.rs:1661 — 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:6355 — 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:191 — 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 33) crates/buzz-acp/src/relay.rs:3317 — buzz_acp::relay::wait_for_reconnect has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 5 (16 pts), if/else 7 (12 pts), loops 3 (5 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • buzz_acp::config::resolve_dynamic_channel_filter (cognitive 30) crates/buzz-acp/src/config.rs:1478 — buzz_acp::config::resolve_dynamic_channel_filter has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (6 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::relay::try_autonomous_reconnect (cognitive 30) crates/buzz-acp/src/relay.rs:3184 — buzz_acp::relay::try_autonomous_reconnect has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 5 (10 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • buzz_acp::pool::create_session_and_apply_model (cognitive 27) crates/buzz-acp/src/pool.rs:1581 — buzz_acp::pool::create_session_and_apply_model has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::queue::format_prompt (cognitive 26) crates/buzz-acp/src/queue.rs:2338 — buzz_acp::queue::format_prompt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::relay::drain_commands (cognitive 25) crates/buzz-acp/src/relay.rs:3084 — buzz_acp::relay::drain_commands has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (10 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::pool::parse_nostr_thread_response_with_meta (cognitive 23) crates/buzz-acp/src/pool.rs:4748 — buzz_acp::pool::parse_nostr_thread_response_with_meta has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::acp::resolve_model_switch_method (cognitive 22) crates/buzz-acp/src/acp.rs:2299 — buzz_acp::acp::resolve_model_switch_method has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::setup_mode::run_setup_listener (cognitive 21) crates/buzz-acp/src/setup_mode.rs:321 — buzz_acp::setup_mode::run_setup_listener has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::config::load_rules (cognitive 20) crates/buzz-acp/src/config.rs:1295 — buzz_acp::config::load_rules has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::filter::match_event (cognitive 20) crates/buzz-acp/src/filter.rs:368 — buzz_acp::filter::match_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::run_relay_observer_publisher (cognitive 18) crates/buzz-acp/src/lib.rs:1410 — 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:4981 — buzz_acp::dispatch_pending has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_acp::acp::build_codex_config_env (cognitive 18) crates/buzz-acp/src/acp.rs:282 — buzz_acp::acp::build_codex_config_env has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 2 more in this group — see findings.md.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×24
  • Animation without a prefers-reduced-motion guard desktop/src/features/messages/ui/ComposerAddressControls.tsx:353 — <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/ui/progress.tsx:33 — <div> moves — its `animate-[progress-indeterminate_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:2 — `.sprout-arc-spinner` moves (`animation: sprout-arc-spinner-spin 500ms linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:282 — `.buzz-poof-frame` moves (`animation: buzz-poof-frame 400ms linear both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:294 — `.buzz-poof-frame-1` moves (`animation-name: buzz-poof-frame-1`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:298 — `.buzz-poof-frame-2` moves (`animation-name: buzz-poof-frame-2`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:302 — `.buzz-poof-frame-3` moves (`animation-name: buzz-poof-frame-3`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:306 — `.buzz-poof-frame-4` moves (`animation-name: buzz-poof-frame-4`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:310 — `.buzz-poof-frame-5` moves (`animation-name: buzz-poof-frame-5`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:518 — `.buzz-sidebar-action-description__reel` moves (`animation: buzz-sidebar-action-description-roll-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:577 — `.buzz-animated-count__slot[data-direction="up"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:582 — `.buzz-animated-count__slot[data-direction="down"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-down 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:592 — `.buzz-animated-count__symbol[data-direction="up"]` moves (`animation: buzz-animated-count-symbol-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:597 — `.buzz-animated-count__symbol[data-direction="down"]` moves (`animation: buzz-animated-count-symbol-down 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:875 — `.bee-sprite .bee-wing-left` moves (`animation-name: bee-wing-left-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:879 — `.bee-sprite .bee-wing-right` moves (`animation-name: bee-wing-right-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/avatar-framing.css:115 — `.buzz-avatar-framing-slider-handle` moves (`transition: opacity 150ms ease, transform 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/avatar-framing.css:141 — `.buzz-avatar-framing-slider-tip` moves (`transition: opacity 150ms ease, transform 150ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:195 — `.buzz-huddle-speaking-avatar::after` moves (`transition: opacity 80ms linear, transform 90ms cubic-bezier(0.2, 0, 0, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:530 — `.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="forward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-forward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:535 — `.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="backward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-backward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:561 — `.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-down"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-down`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:566 — `.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-up"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-up`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard admin-web/src/styles.css:279 — `.record-card` moves (`transition: transform 180ms ease, box-shadow 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D35 · Change Coupling · Change coupling · ×24
  • Change coupling: ChannelPane.types.ts ↔ ChannelScreen.tsx desktop/src/features/channels/ui/ChannelPane.types.ts:1 — `desktop/src/features/channels/ui/ChannelPane.types.ts` and `desktop/src/features/channels/ui/ChannelScreen.tsx` change together 86% of the time (12 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `e94b547f` fix(desktop): keep an own send out of the frozen timeline tail (#9095); `00e61eaf` fix(desktop): surface channel history load failures (#7013); `f6e6617a` fix(desktop): bound thread /query and surface load errors, not false-… — run `git show` on any of them.
  • Change coupling: message_bubble.dart ↔ thread_message.dart mobile/lib/features/channels/channel_detail_page/message_bubble.dart:1 — `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` change together 86% of the time (12 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `96e56c5b` Add participant avatars to mobile conversation headers (#9369); `6384c6cd` feat(mobile): mark edited messages after the body (#8863); `44b3c482` Add swipeable photo stacks and native iOS gallery preview (#9259) — run `git show` on any of them.
  • Change coupling: thread_detail_page.dart ↔ forum_thread_page.dart mobile/lib/features/channels/thread_detail_page.dart:1 — `mobile/lib/features/channels/thread_detail_page.dart` and `mobile/lib/features/forum/forum_thread_page.dart` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4ef23609` feat(mobile): show contextual names in channel conversations (#7895); `06582ee6` Render mobile agent mention chips (#3702); `7e009a89` fix(mobile): open profile sheet when tapping @mentions (#1876) — run `git show` on any of them.
  • Change coupling: ForumComposer.tsx ↔ MessageComposer.tsx desktop/src/features/forum/ui/ForumComposer.tsx:1 — `desktop/src/features/forum/ui/ForumComposer.tsx` and `desktop/src/features/messages/ui/MessageComposer.tsx` change together 69% of the time (11 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `571c1902` fix(desktop): scope composer autocomplete to focus (#6860); `b4967589` fix(desktop): resolve exact typed mentions on space (#6862); `bcf353c9` fix(desktop): enforce agent mention authorization at send boundaries … — run `git show` on any of them.
  • Change coupling: events.rs ↔ tauri.ts desktop/src-tauri/src/events.rs:1 — `desktop/src-tauri/src/events.rs` and `desktop/src/shared/api/tauri.ts` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `3e56331e` fix(delete): make agent-deleted messages disappear from desktop UI im…; `7dd5b345` Add channel visibility & ephemeral TTL controls to manage sidebar (#911); `5d7c7489` fix(presence): clear on disconnect, fix heartbeat/TTL, drop broken RE… — run `git show` on any of them.
  • Change coupling: agents.rs ↔ restore.rs desktop/src-tauri/src/commands/agents.rs:1 — `desktop/src-tauri/src/commands/agents.rs` and `desktop/src-tauri/src/managed_agents/restore.rs` change together 61% of the time (14 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `076081bf` Rename Bumble agent to Pollen (#5864); `1f48860b` fix(desktop): propagate agent definition edits to instances and remov…; `79a05753` fix(desktop): refresh persona env vars on respawn — record.env_vars i… — run `git show` on any of them.
  • Change coupling: DayDivider.tsx ↔ MessageTimeline.tsx desktop/src/features/messages/ui/DayDivider.tsx:1 — `desktop/src/features/messages/ui/DayDivider.tsx` and `desktop/src/features/messages/ui/MessageTimeline.tsx` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `a5bf3c5a` Refine desktop timeline activity presentation (#4582); `8c388479` Keep channel day dividers sticky (#1420); `047db421` fix(desktop): single-owner anchored scroll for dynamic loading (#1115) — run `git show` on any of them.
  • Change coupling: teams.rs ↔ types.ts desktop/src-tauri/src/managed_agents/teams.rs:1 — `desktop/src-tauri/src/managed_agents/teams.rs` and `desktop/src/shared/api/types.ts` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `ba2fdbf6` refactor(desktop): consolidate packs into teams (#852); `9a98e60f` feat: provider/model selection for personas and runtime-aware env inj…; `32347d11` feat(desktop): per-persona and per-agent env var overrides (#594) — run `git show` on any of them.
  • Change coupling: MessageComposer.tsx ↔ MessageComposerToolbar.tsx desktop/src/features/messages/ui/MessageComposer.tsx:1 — `desktop/src/features/messages/ui/MessageComposer.tsx` and `desktop/src/features/messages/ui/MessageComposerToolbar.tsx` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `1aa87bb2` feat(composer): compose spoiler, annotation, and tooltip controls (#1…; `770266d2` feat(composer): link editing — inline popover, modal picker, buzz:// …; `05fc69b8` Video Player Improvements (#993) — run `git show` on any of them.
  • Change coupling: HomeView.tsx ↔ InboxMessageRow.tsx desktop/src/features/home/ui/HomeView.tsx:1 — `desktop/src/features/home/ui/HomeView.tsx` and `desktop/src/features/home/ui/InboxMessageRow.tsx` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `514195b1` feat(desktop): add Inbox message delete action (#5779); `eb6a3756` fix(desktop): enable message editing in Inbox (#2198); `7f769b24` fix(desktop): align inbox layout and draft details (#2143) — run `git show` on any of them.
  • Change coupling: InboxDetailPane.tsx ↔ InboxListPane.tsx desktop/src/features/home/ui/InboxDetailPane.tsx:1 — `desktop/src/features/home/ui/InboxDetailPane.tsx` and `desktop/src/features/home/ui/InboxListPane.tsx` change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `4d77175c` fix(client): resurface hidden DMs from live activity (#6885); `17d2147e` Fix video comment effect wrapping (#5748); `7f769b24` fix(desktop): align inbox layout and draft details (#2143) — run `git show` on any of them.
  • Change coupling: AgentSessionThreadPanel.tsx ↔ UserProfilePanel.tsx desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx:1 — `desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx` and `desktop/src/features/profile/ui/UserProfilePanel.tsx` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `fd5d04de` fix(desktop): scope observer feed by channel and add session-boundary…; `1f5ba5bb` fix(desktop): sync derived active-turn liveness in channel activity p…; `360d2e54` Fix channel header shared blur layering (#1336) — run `git show` on any of them.
  • Change coupling: formatTimelineMessages.ts ↔ MessageTimeline.tsx desktop/src/features/messages/lib/formatTimelineMessages.ts:1 — `desktop/src/features/messages/lib/formatTimelineMessages.ts` and `desktop/src/features/messages/ui/MessageTimeline.tsx` change together 50% of the time (15 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `463db6de` feat(desktop): show agent owners in messages (#2080); `6cca7599` desktop: fix scrollback paging and visible history depth (#1153); `047db421` fix(desktop): single-owner anchored scroll for dynamic loading (#1115) — run `git show` on any of them.
  • Change coupling: types.ts ↔ tauri.ts desktop/src/features/messages/types.ts:1 — `desktop/src/features/messages/types.ts` and `desktop/src/shared/api/tauri.ts` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `3d61fd60` feat(desktop): add message editing support (#182); `fa939ec1` Polish chat replies and managed agent creation (#81); `d9f81322` Add end-to-end emoji reactions (#57) — run `git show` on any of them.
  • Change coupling: readStateManager.ts ↔ useUnreadChannels.ts desktop/src/features/channels/readState/readStateManager.ts:1 — `desktop/src/features/channels/readState/readStateManager.ts` and `desktop/src/features/channels/useUnreadChannels.ts` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `733c766e` fix(desktop): clear unread projections from message read markers (#1242); `5268fac2` Fix monotonic read-state merges (#884); `269b35e8` fix(mobile+desktop): cross-device read state sync + diagnostic loggin… — run `git show` on any of them.
  • Change coupling: hooks.ts ↔ OnboardingFlow.tsx desktop/src/features/onboarding/hooks.ts:1 — `desktop/src/features/onboarding/hooks.ts` and `desktop/src/features/onboarding/ui/OnboardingFlow.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `8688c041` Rework first-launch community onboarding (#1936); `5bb61929` fix(desktop): remediate all onboarding dead paths (D1-D7) (#1856); `e4a0824c` fix(onboarding): skip onboarding when relay already has a profile (#973) — run `git show` on any of them.
  • Change coupling: AgentSessionTranscriptList.tsx ↔ AgentSessionThreadPanel.tsx desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1 — `desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx` and `desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1df4a4e7` fix(observer): align scroll-anchor ids with transcript display-block …; `51234bd8` fix(desktop): preserve archived observer history (#1752); `fd5d04de` fix(desktop): scope observer feed by channel and add session-boundary… — run `git show` on any of them.
  • Change coupling: AgentSessionTranscriptList.tsx ↔ agentSessionTranscript.ts desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1 — `desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx` and `desktop/src/features/agents/ui/agentSessionTranscript.ts` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1df4a4e7` fix(observer): align scroll-anchor ids with transcript display-block …; `84ec63aa` fix(desktop): separate system prompt from turn context (#1754); `426f0448` feat(agents): group activity tool bursts (#1571) — run `git show` on any of them.
  • Change coupling: channels_page.dart ↔ me_page.dart mobile/lib/features/channels/channels_page.dart:1 — `mobile/lib/features/channels/channels_page.dart` and `mobile/lib/features/channels/me/me_page.dart` 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 `642ce416` fix(mobile): show shared chats under Solo (#9348); `2636e986` fix(mobile): build channel section rows lazily (#9401); `beec0553` feat(mobile): move Activity to a Home bell and align Home spacing (#9… — run `git show` on any of them.
  • Change coupling: AddTeamToChannelDialog.tsx ↔ AgentDefinitionDialog.tsx desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:1 — `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: agent_config.rs ↔ runtime.rs desktop/src-tauri/src/commands/agent_config.rs:1 — `desktop/src-tauri/src/commands/agent_config.rs` and `desktop/src-tauri/src/managed_agents/runtime.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `be95a8a9` fix(config-bridge): add harness-definition env tier and fix equal-val…; `25bb7147` fix(desktop): make doctor installs retryable with per-runtime progres…; `a415f0f3` feat(desktop): auto-restart agents on config change (Chunk F) (#1649) — run `git show` on any of them.
  • Change coupling: ChatHeader.tsx ↔ ViewLoadingFallback.tsx desktop/src/features/chat/ui/ChatHeader.tsx:1 — `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.
  • Change coupling: MessageThreadPanel.tsx ↔ ViewLoadingFallback.tsx desktop/src/features/messages/ui/MessageThreadPanel.tsx:1 — `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: lib.rs ↔ deep-link.ts desktop/src-tauri/src/lib.rs:1 — `desktop/src-tauri/src/lib.rs` and `desktop/src/shared/deep-link.ts` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `8688c041` Rework first-launch community onboarding (#1936); `cecd0314` feat: add deeplink nostr identity binding flow (#1648); `c5a54dcc` Rename web app to Buzz (#959) — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×24
  • Duplicated block (13 lines × 2) crates/buzz-acp/src/lib.rs:5785 — crates/buzz-acp/src/lib.rs:5785-5797 | crates/buzz-acp/src/lib.rs:6027-6039 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/lib.rs:5785` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-acp/src/lib.rs:6042` calls `shutdown`, `drop` and `crates/buzz-acp/src/lib.rs:5798` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) crates/buzz-acp/src/relay.rs:2093 — crates/buzz-acp/src/relay.rs:2093-2105 | crates/buzz-acp/src/relay.rs:2113-2125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) crates/buzz-acp/src/relay.rs:4299 — crates/buzz-acp/src/relay.rs:4299-4311 | crates/buzz-acp/src/relay.rs:4377-4389 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/relay.rs:4299` 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 (13 lines × 2) crates/buzz-relay/src/api/admin/mod.rs:704 — crates/buzz-relay/src/api/admin/mod.rs:704-716 | crates/buzz-relay/src/api/admin/mod.rs:782-794 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/admin/mod.rs:704` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-relay/src/api/admin/mod.rs:718` calls `to_vec`, `admin_role_str` and `crates/buzz-relay/src/api/admin/mod.rs:796` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) crates/buzz-relay/src/audio/handler.rs:2654 — crates/buzz-relay/src/audio/handler.rs:2654-2666 | crates/buzz-relay/src/audio/handler.rs:2693-2705 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:2654` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/buzz-relay/src/handlers/event.rs:813 — crates/buzz-relay/src/handlers/event.rs:813-828 | crates/buzz-relay/src/handlers/event.rs:948-960 — both copies are in the same file, so extract the block into 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/archive/store.rs:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) desktop/src-tauri/src/commands/agent_settings.rs:50 — desktop/src-tauri/src/commands/agent_settings.rs:50-62 | desktop/src-tauri/src/commands/agent_settings.rs:94-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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agent_settings.rs:50` 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 (13 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:749 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:749-761 | 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 139 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/personas/snapshot/import.rs:749` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/nostr_convert.rs:536` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/buzz-relay/src/api/bridge.rs:2748 — crates/buzz-relay/src/api/bridge.rs:2748-2760 | crates/buzz-relay/src/handlers/req.rs:962-974 — 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 4 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. 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/api/bridge.rs:2748` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/buzz-db/src/store/channel_members.rs:1613 — crates/buzz-db/src/store/channel_members.rs:1613-1629 | crates/buzz-db/src/store/user.rs:461-473 — 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 `crates/buzz-db/src/store/channel_members.rs:1613` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) crates/buzz-db/src/store/push.rs:1077 — crates/buzz-db/src/store/push.rs:1077-1089 | crates/buzz-db/src/store/workflow.rs:853-869 — 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 `crates/buzz-db/src/store/push.rs:1077` 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 (13 lines × 2) crates/buzz-relay/src/handlers/req.rs:192 — crates/buzz-relay/src/handlers/req.rs:192-204 | crates/buzz-relay/src/handlers/req.rs:244-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/req.rs:192` 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 (13 lines × 2) crates/buzz-db/src/store/moderation.rs:327 — crates/buzz-db/src/store/moderation.rs:327-342 | crates/buzz-db/src/store/relay_members.rs:171-183 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/moderation.rs:327` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/buzz-acp/src/lib.rs:2104 — crates/buzz-acp/src/lib.rs:2104-2116 | crates/buzz-acp/src/lib.rs:2196-2209 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/lib.rs:2104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media_transcode.rs:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:2884 — REDACTED:2884-2896 | REDACTED:2951-2963 — both copies are in the same file, so extract the block into 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:1970 — REDACTED:1970-1982 | REDACTED:2402-2414 — both copies are in the same file, so extract the 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 `REDACTED:1970` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/buzz-cli/src/commands/agents.rs:116 — crates/buzz-cli/src/commands/agents.rs:116-128 | crates/buzz-cli/src/commands/agents.rs:154-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/agents.rs:116` 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 (13 lines × 2) mobile/ios/Runner/PushSnapshotBridge.swift:156 — mobile/ios/Runner/PushSnapshotBridge.swift:156-168 | mobile/ios/Runner/PushSnapshotBridge.swift:201-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/Runner/PushSnapshotBridge.swift:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) mobile/lib/features/channels/channel_detail_page/app_bar.dart:112 — mobile/lib/features/channels/channel_detail_page/app_bar.dart:112-124 | mobile/lib/features/channels/channel_detail_page/app_bar.dart:170-182 — both copies are in the same file, so extract the 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/lib/features/channels/channel_detail_page/app_bar.dart:112` 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 (13 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:131 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:131-143 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:105-117 — 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 6 separate duplicated blocks between them, totalling at least 172 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_bubble.dart:131` 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 (13 lines × 2) mobile/lib/features/forum/forum_thread_page.dart:183 — mobile/lib/features/forum/forum_thread_page.dart:183-195 | mobile/lib/features/forum/forum_thread_page.dart:645-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/forum/forum_thread_page.dart:183` 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 · Edited copy of a member (7 corresponding lines) · ×22
  • Edited copy of a member (7 corresponding lines) docs/formal/nip-rs-unread/model.py:263 — docs/formal/nip-rs-unread/model.py:263-296 | docs/formal/nip-rs-unread/mutation.py:306-312 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-sdk/src/builders.rs:229 — crates/buzz-sdk/src/builders.rs:229-235 | crates/buzz-sdk/src/builders.rs:242-250 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-sdk/src/builders.rs:543 — crates/buzz-sdk/src/builders.rs:543-549 | desktop/src-tauri/src/events.rs:400-408 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) desktop/src-tauri/src/commands/media_animated.rs:22 — desktop/src-tauri/src/commands/media_animated.rs:22-28 | desktop/src-tauri/src/commands/media_animated.rs:30-36 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-cli/src/commands/huddles.rs:227 — crates/buzz-cli/src/commands/huddles.rs:227-240 | crates/buzz-cli/src/commands/huddles.rs:248-254 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) mobile/lib/features/channels/local_send_bubble_surface.dart:111 — mobile/lib/features/channels/local_send_bubble_surface.dart:111-118 | mobile/lib/features/channels/local_send_row.dart:64-70 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) desktop/src-tauri/src/managed_agents/config_bridge/codex.rs:125 — desktop/src-tauri/src/managed_agents/config_bridge/codex.rs:125-131 | desktop/src-tauri/src/managed_agents/config_bridge/goose.rs:157-163 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-sdk/src/builders.rs:962 — crates/buzz-sdk/src/builders.rs:962-968 | desktop/src-tauri/src/events.rs:178-184 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-sdk/src/builders.rs:971 — crates/buzz-sdk/src/builders.rs:971-977 | desktop/src-tauri/src/events.rs:187-193 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-sdk/src/builders.rs:1028 — crates/buzz-sdk/src/builders.rs:1028-1034 | desktop/src-tauri/src/events.rs:196-202 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-sdk/src/builders.rs:1037 — crates/buzz-sdk/src/builders.rs:1037-1043 | desktop/src-tauri/src/events.rs:205-211 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) desktop/src-tauri/src/managed_agents/persona_events.rs:486 — desktop/src-tauri/src/managed_agents/persona_events.rs:486-493 | desktop/src-tauri/src/managed_agents/persona_events.rs:508-514 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-relay/src/api/git/store.rs:350 — crates/buzz-relay/src/api/git/store.rs:350-357 | crates/buzz-db/src/runtime/mod.rs:215-221 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-relay/src/api/git/pack_cache.rs:458 — crates/buzz-relay/src/api/git/pack_cache.rs:458-470 | desktop/src-tauri/src/commands/social.rs:146-152 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-push-gateway/src/strict_json.rs:51 — crates/buzz-push-gateway/src/strict_json.rs:51-57 | crates/buzz-relay/src/handlers/push_lease.rs:410-416 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-push-gateway/src/http.rs:142 — crates/buzz-push-gateway/src/http.rs:142-148 | desktop/src-tauri/src/managed_agents/team_catalog.rs:229-235 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) docs/formal/nip-rs-unread/model.py:92 — docs/formal/nip-rs-unread/model.py:92-100 | docs/formal/nip-rs-unread/mutation.py:58-64 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) desktop/src-tauri/src/commands/agent_models_env.rs:10 — desktop/src-tauri/src/commands/agent_models_env.rs:10-16 | desktop/src-tauri/src/mesh_llm/discovery.rs:349-356 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-acp/src/pool.rs:5212 — crates/buzz-acp/src/pool.rs:5212-5218 | crates/buzz-dev-mcp/src/todo.rs:58-64 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-acp/src/pool.rs:5222 — crates/buzz-acp/src/pool.rs:5222-5231 | crates/buzz-relay/src/state.rs:2003-2009 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/buzz-deletion/src/lib.rs:1778 — crates/buzz-deletion/src/lib.rs:1778-1784 | crates/buzz-relay/src/main.rs:2275-2281 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) desktop/src-tauri/src/commands/agents_pending.rs:176 — desktop/src-tauri/src/commands/agents_pending.rs:176-182 | desktop/src-tauri/src/managed_agents/retention.rs:313-319 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×22
  • Duplicated block (15 lines × 2) crates/buzz-acp/src/pool.rs:3560 — crates/buzz-acp/src/pool.rs:3560-3574 | crates/buzz-acp/src/pool.rs:3589-3603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/pool.rs:3560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/buzz-cli/src/commands/agents.rs:92 — crates/buzz-cli/src/commands/agents.rs:92-106 | crates/buzz-cli/src/commands/agents.rs:131-145 — both copies are in the same file, so extract the 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 `crates/buzz-cli/src/commands/agents.rs:92` 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 (15 lines × 2) crates/buzz-core/src/pairing/session.rs:285 — crates/buzz-core/src/pairing/session.rs:285-299 | crates/buzz-core/src/pairing/session.rs:508-522 — both copies are in the same file, so extract the 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 `crates/buzz-core/src/pairing/session.rs:285` 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 (15 lines × 2) REDACTED:1530 — REDACTED:1530-1544 | REDACTED:1815-1829 — both copies are in the same file, so extract the 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 `REDACTED:1530` 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 (15 lines × 2) REDACTED:2358 — REDACTED:2358-2372 | REDACTED:2377-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2358` 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 (15 lines × 2) crates/buzz-db/src/store/feed.rs:93 — crates/buzz-db/src/store/feed.rs:93-107 | crates/buzz-db/src/store/feed.rs:183-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/feed.rs:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/buzz-relay/src/api/invites.rs:530 — crates/buzz-relay/src/api/invites.rs:530-544 | crates/buzz-relay/src/api/invites.rs:625-639 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/invites.rs:530` 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 (15 lines × 2) crates/buzz-relay/src/audio/handler.rs:312 — crates/buzz-relay/src/audio/handler.rs:312-326 | crates/buzz-relay/src/connection.rs:424-438 — before extracting anything, compare `crates/buzz-relay/src/audio/handler.rs` and `crates/buzz-relay/src/connection.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/handler.rs:312` 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 (15 lines × 2) crates/buzz-relay/src/audio/handler.rs:1458 — crates/buzz-relay/src/audio/handler.rs:1458-1472 | crates/buzz-relay/src/audio/handler.rs:1484-1498 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:1458` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) crates/buzz-relay/src/push_runtime.rs:475 — crates/buzz-relay/src/push_runtime.rs:475-489 | crates/buzz-relay/src/push_runtime.rs:536-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/push_runtime.rs:475` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/buzz-relay/src/subscription.rs:522 — crates/buzz-relay/src/subscription.rs:522-536 | crates/buzz-relay/src/subscription.rs:586-600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/subscription.rs:522` 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 (15 lines × 2) desktop/src-tauri/src/managed_agents/readiness.rs:135 — desktop/src-tauri/src/managed_agents/readiness.rs:135-149 | desktop/src-tauri/src/managed_agents/readiness.rs:195-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/buzz-db/src/store/thread.rs:980 — crates/buzz-db/src/store/thread.rs:980-994 | crates/buzz-db/src/store/thread.rs:1158-1176 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/thread.rs:980` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/git-sign-nostr/src/lib.rs:802` 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 (15 lines × 2) crates/buzz-cli/src/commands/channels.rs:696 — crates/buzz-cli/src/commands/channels.rs:696-711 | crates/buzz-cli/src/commands/channels.rs:1474-1488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/channels.rs:696` 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 (15 lines × 2) mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:260 — mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:260-274 | mobile/ios/Runner/NativeEmojiPicker.swift:179-193 — 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/agents/agent_character_stage.dart:131 — mobile/lib/features/agents/agent_character_stage.dart:131-145 | mobile/lib/features/agents/agent_emoji_stage.dart:147-161 — 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/lib/features/agents/agent_character_stage.dart:131` 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 (15 lines × 2) mobile/lib/features/channels/channel_detail_page/message_list.dart:709 — mobile/lib/features/channels/channel_detail_page/message_list.dart:709-723 | mobile/lib/features/channels/thread_detail_page.dart:932-946 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_list.dart:709` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The 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 (15 lines × 2) mobile/lib/features/channels/channels_page/sheets.dart:67 — mobile/lib/features/channels/channels_page/sheets.dart:67-81 | mobile/lib/features/channels/channels_page/sheets.dart:496-510 — both copies are in the same file, so extract the 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/lib/features/channels/channels_page/sheets.dart:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:991 — mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:991-1005 | mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:1085-1099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) mobile/lib/features/profile/profile_edit_page.dart:669 — mobile/lib/features/profile/profile_edit_page.dart:669-683 | mobile/lib/shared/widgets/text_editor.dart:95-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/profile/profile_edit_page.dart:669` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mobile/lib/shared/widgets/text_editor.dart:93` calls `Function` and `mobile/lib/features/profile/profile_edit_page.dart:667` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. 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.
D2 · Cognitive Complexity · buzz_db · ×21
  • buzz_db::store::partition::audit_table_on (cognitive 94) crates/buzz-db/src/store/partition.rs:622 — buzz_db::store::partition::audit_table_on has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (60 pts), loops 9 (17 pts), boolean chains 14, match/switch 1 (3 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl (cognitive 38) crates/buzz-db/src/store/replaceable.rs:105 — buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 11, match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::event::count_events_sql (cognitive 36) crates/buzz-db/src/store/event.rs:1581 — buzz_db::store::event::count_events_sql has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (28 pts), loops 3 (8 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • buzz_db::store::event::push_event_filters (cognitive 35) crates/buzz-db/src/store/event.rs:785 — buzz_db::store::event::push_event_filters has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (25 pts), loops 4 (10 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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::media::media_reference_query (cognitive 33) crates/buzz-db/src/store/media.rs:291 — buzz_db::store::media::media_reference_query has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::partition::maintenance::plan_maintenance (cognitive 32) crates/buzz-db/src/store/partition/maintenance.rs:204 — buzz_db::store::partition::maintenance::plan_maintenance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::thread::get_channel_window_on (cognitive 30) crates/buzz-db/src/store/thread.rs:596 — buzz_db::store::thread::get_channel_window_on has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (7 pts), match/switch 4 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::event::insert_event_with_thread_metadata_tx (cognitive 28) crates/buzz-db/src/store/event.rs:1969 — 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:3598 — 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::channel::update_channel_on (cognitive 26) crates/buzz-db/src/store/channel.rs:1304 — buzz_db::store::channel::update_channel_on has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22 (23 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_db::store::thread::get_thread_replies_on (cognitive 25) crates/buzz-db/src/store/thread.rs:353 — 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::channel_members::put_members_on (cognitive 23) crates/buzz-db/src/store/channel_members.rs:930 — buzz_db::store::channel_members::put_members_on has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (5 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.
  • buzz_db::store::push::accept_lease_event (cognitive 23) crates/buzz-db/src/store/push.rs:199 — buzz_db::store::push::accept_lease_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::channel::group_metadata_tags (cognitive 20) crates/buzz-db/src/store/channel.rs:840 — buzz_db::store::channel::group_metadata_tags has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_db::store::relay_admin_actions::finalize_success (cognitive 20) crates/buzz-db/src/store/relay_admin_actions.rs:902 — buzz_db::store::relay_admin_actions::finalize_success has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::event::build_query_events_sql (cognitive 18) crates/buzz-db/src/store/event.rs:703 — buzz_db::store::event::build_query_events_sql has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • buzz_db::store::channel::apply_channel_metadata_event (cognitive 17) crates/buzz-db/src/store/channel.rs:1639 — buzz_db::store::channel::apply_channel_metadata_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, 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.
  • buzz_db::store::partition::maintenance::attempt_change (cognitive 17) crates/buzz-db/src/store/partition/maintenance.rs:586 — buzz_db::store::partition::maintenance::attempt_change has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • buzz_db::store::push::enqueue_wakes (cognitive 17) crates/buzz-db/src/store/push.rs:633 — buzz_db::store::push::enqueue_wakes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • buzz_db::store::partition::maintenance::verify_applied (cognitive 16) crates/buzz-db/src/store/partition/maintenance.rs:998 — buzz_db::store::partition::maintenance::verify_applied has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_db::store::relay_invite::claim_relay_invite_with_owner (cognitive 16) crates/buzz-db/src/store/relay_invite.rs:457 — buzz_db::store::relay_invite::claim_relay_invite_with_owner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×20
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/usage.rs:494` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/buzz-cli/src/commands/mem.rs:249 — crates/buzz-cli/src/commands/mem.rs:249-262 | desktop/src-tauri/src/commands/engrams.rs:191-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/mem.rs:249` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) REDACTED:3054 — REDACTED:3054-3067 | REDACTED:3258-3272 — both copies are in the same file, so extract the 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 `REDACTED:3054` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/buzz-db/src/store/partition.rs:460 — crates/buzz-db/src/store/partition.rs:460-473 | crates/buzz-db/src/store/partition.rs:478-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/partition.rs:460` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/buzz-relay/src/api/admin/mod.rs:1284 — crates/buzz-relay/src/api/admin/mod.rs:1284-1297 | crates/buzz-relay/src/api/admin/mod.rs:1327-1340 — both copies are in the same file, so extract the block into 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:1801 — crates/buzz-relay/src/api/bridge.rs:1801-1814 | crates/buzz-relay/src/api/bridge.rs:2452-2465 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/bridge.rs:1801` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/buzz-relay/src/audio/handler.rs:3781 — crates/buzz-relay/src/audio/handler.rs:3781-3794 | crates/buzz-relay/src/audio/handler.rs:3983-3996 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:3781` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/buzz-relay/src/subscription.rs:521 — crates/buzz-relay/src/subscription.rs:521-534 | crates/buzz-relay/src/subscription.rs:538-551 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/subscription.rs:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) desktop/src-tauri/src/commands/agent_models.rs:743 — desktop/src-tauri/src/commands/agent_models.rs:743-756 | desktop/src-tauri/src/commands/agent_models.rs:767-780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agent_models.rs:743` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) desktop/src-tauri/src/commands/teams/pending.rs:493 — desktop/src-tauri/src/commands/teams/pending.rs:493-506 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/teams/pending.rs:493` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/event_sync.rs:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) desktop/src-tauri/src/media_proxy.rs:57 — desktop/src-tauri/src/media_proxy.rs:57-70 | desktop/src-tauri/src/media_proxy.rs:217-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/media_proxy.rs:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/buzz-db/src/store/dm.rs:454 — crates/buzz-db/src/store/dm.rs:454-471 | crates/buzz-db/src/store/relay_members.rs:1306-1319 — 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 `crates/buzz-db/src/store/dm.rs:454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/buzz-db/src/store/channel_members.rs:1498 — crates/buzz-db/src/store/channel_members.rs:1498-1511 | crates/buzz-db/src/store/channel_members.rs:1610-1627 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/channel_members.rs:1498` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-db/src/store/channel_members.rs:1512` calls `bind` and `crates/buzz-db/src/store/channel_members.rs:1628` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) crates/buzz-db/src/store/channel_members.rs:2314 — crates/buzz-db/src/store/channel_members.rs:2314-2327 | crates/buzz-db/src/store/event.rs:1817-1832 — 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 `crates/buzz-db/src/store/channel_members.rs:2314` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/buzz-db/src/store/event.rs:1789 — crates/buzz-db/src/store/event.rs:1789-1802 | crates/buzz-db/src/store/event.rs:1866-1879 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/event.rs:1789` 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 (14 lines × 2) crates/buzz-relay/src/api/operator.rs:991 — crates/buzz-relay/src/api/operator.rs:991-1004 | crates/buzz-relay/src/api/operator.rs:1053-1066 — both copies are in the same file, so extract the block into 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/settings/theme_picker_page/theme_home_preview.dart:224` 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 · Edited copy of a member (12 corresponding lines) · ×19
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/persona_catalog.rs:197 — desktop/src-tauri/src/persona_catalog.rs:197-208 | desktop/src-tauri/src/team_catalog.rs:315-326 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/mesh_llm/recovery.rs:401 — desktop/src-tauri/src/mesh_llm/recovery.rs:401-412 | desktop/src-tauri/src/mesh_llm/recovery.rs:414-432 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/commands/clipboard.rs:44 — desktop/src-tauri/src/commands/clipboard.rs:44-55 | desktop/src-tauri/src/commands/media_download.rs:211-228 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-db/src/store/thread_window.rs:187 — crates/buzz-db/src/store/thread_window.rs:187-198 | crates/buzz-db/src/store/thread_window.rs:429-440 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-push-gateway/src/main.rs:146 — crates/buzz-push-gateway/src/main.rs:146-157 | crates/buzz-relay/src/main.rs:2244-2258 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-relay-mesh/src/peer.rs:77 — crates/buzz-relay-mesh/src/peer.rs:77-88 | crates/buzz-relay-mesh/src/peer.rs:90-103 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-sdk/src/builders.rs:179 — crates/buzz-sdk/src/builders.rs:179-191 | desktop/src-tauri/src/events.rs:54-65 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/event_sync.rs:589 — desktop/src-tauri/src/event_sync.rs:589-600 | desktop/src-tauri/src/managed_agents/storage.rs:256-274 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/commands/admin/routes.rs:18 — desktop/src-tauri/src/commands/admin/routes.rs:18-31 | desktop/src-tauri/src/commands/admin/routes.rs:124-135 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-relay/src/tunnel/directory.rs:438 — crates/buzz-relay/src/tunnel/directory.rs:438-449 | crates/buzz-relay/src/tunnel/directory.rs:456-467 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-cli/src/validate.rs:168 — crates/buzz-cli/src/validate.rs:168-179 | crates/buzz-cli/src/validate.rs:186-198 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-cli/src/agent_management.rs:86 — crates/buzz-cli/src/agent_management.rs:86-97 | crates/buzz-sdk/src/broker/actions/mod.rs:256-267 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-agent/src/types.rs:374 — crates/buzz-agent/src/types.rs:374-385 | crates/buzz-agent/src/types.rs:396-409 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/commands/link_preview.rs:274 — desktop/src-tauri/src/commands/link_preview.rs:274-285 | desktop/src-tauri/src/commands/link_preview_youtube.rs:141-155 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/deep_link.rs:44 — desktop/src-tauri/src/deep_link.rs:44-55 | desktop/src-tauri/src/deep_link.rs:97-109 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/relay/scope.rs:16 — desktop/src-tauri/src/relay/scope.rs:16-27 | desktop/src-tauri/src/relay/scope.rs:76-89 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-pubsub/src/presence.rs:33 — crates/buzz-pubsub/src/presence.rs:33-44 | crates/buzz-relay-mesh/src/registry.rs:264-279 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) desktop/src-tauri/src/commands/channel_reconnect_repair.rs:55 — desktop/src-tauri/src/commands/channel_reconnect_repair.rs:55-68 | desktop/src-tauri/src/commands/channel_window.rs:45-56 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/buzz-db/src/store/channel_members.rs:314 — crates/buzz-db/src/store/channel_members.rs:314-326 | crates/buzz-db/src/store/channel_members.rs:357-368 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×19
  • Edited copy of a member (9 corresponding lines) REDACTED:2515 — REDACTED:2515-2541 | REDACTED:3357-3365 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) docs/formal/nip-rs-unread/mutation.py:67 — docs/formal/nip-rs-unread/mutation.py:67-75 | docs/formal/nip-rs-unread/mutation.py:197-207 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/terminal_runtime.rs:314 — desktop/src-tauri/src/terminal_runtime.rs:314-322 | desktop/src-tauri/src/terminal_runtime.rs:624-636 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/mesh_llm/mod.rs:619 — desktop/src-tauri/src/mesh_llm/mod.rs:619-627 | desktop/src-tauri/src/mesh_llm/mod.rs:650-658 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-push-gateway/src/authority.rs:328 — crates/buzz-push-gateway/src/authority.rs:328-336 | crates/buzz-push-gateway/src/authority.rs:342-350 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-relay/src/audio/join.rs:1249 — crates/buzz-relay/src/audio/join.rs:1249-1260 | crates/buzz-relay/src/audio/join.rs:1273-1281 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/commands/identity.rs:297 — desktop/src-tauri/src/commands/identity.rs:297-305 | desktop/src-tauri/src/commands/identity.rs:338-346 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/event_sync.rs:744 — desktop/src-tauri/src/event_sync.rs:744-752 | desktop/src-tauri/src/managed_agents/global_config/mod.rs:186-194 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/migration.rs:450 — desktop/src-tauri/src/migration.rs:450-458 | desktop/src-tauri/src/migration.rs:469-480 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-db/src/store/partition.rs:554 — crates/buzz-db/src/store/partition.rs:554-563 | crates/buzz-db/src/store/user_deletion/discovery.rs:68-76 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-relay/src/api/bridge.rs:699 — crates/buzz-relay/src/api/bridge.rs:699-708 | crates/buzz-relay/src/handlers/req.rs:1312-1320 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-cli/src/commands/channel_unread.rs:78 — crates/buzz-cli/src/commands/channel_unread.rs:78-86 | desktop/src-tauri/src/mesh_llm/coordinator.rs:178-188 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-relay/src/audio/join.rs:155 — crates/buzz-relay/src/audio/join.rs:155-163 | crates/buzz-relay/src/audio/join.rs:165-173 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/managed_agents/storage.rs:45 — desktop/src-tauri/src/managed_agents/storage.rs:45-53 | desktop/src-tauri/src/templates/storage.rs:8-16 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/migration.rs:580 — desktop/src-tauri/src/migration.rs:580-592 | desktop/src-tauri/src/migration/pollen.rs:11-19 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-sdk/src/builders.rs:2336 — crates/buzz-sdk/src/builders.rs:2336-2344 | desktop/src-tauri/src/events.rs:690-698 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/buzz-sdk/src/builders.rs:2357 — crates/buzz-sdk/src/builders.rs:2357-2365 | desktop/src-tauri/src/events.rs:711-719 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/huddle/stt.rs:178 — desktop/src-tauri/src/huddle/stt.rs:178-186 | desktop/src-tauri/src/huddle/tts.rs:287-295 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) desktop/src-tauri/src/commands/personas/snapshot.rs:202 — desktop/src-tauri/src/commands/personas/snapshot.rs:202-210 | desktop/src-tauri/src/commands/team_snapshot.rs:80-88 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D3 · God Classes · TooManyMethods · ×18
  • TooManyMethods: Db crates/buzz-db/src/runtime/mod.rs:265 — TooManyMethods — 404 methods, declared across 47 files: runtime/mod.rs (40), store/channel_members.rs (31), store/event.rs (26), store/relay_admin_actions.rs (26), +43 more file(s). The bar is 30 methods; this is 374 over it, 13.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RelaySessionNotifier mobile/lib/shared/relay/relay_session.dart:38 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DeletionStore REDACTED:771 — TooManyMethods — 64 methods, declared across 2 files: REDACTED (63), deletion/lookup.rs (1). The bar is 30 methods; this is 34 over it, 2.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RelayClient desktop/src/shared/api/relayClientSession.ts:83 — 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: HostedFlow mobile/lib/shared/hosted/hosted_flow.dart:98 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ChannelMessagesNotifier mobile/lib/features/channels/channel_messages_provider.dart:32 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AcpClient crates/buzz-acp/src/acp.rs:148 — 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: PairingSession crates/buzz-core/src/pairing/session.rs:104 — TooManyMethods — 41 methods, declared across 2 files: pairing/session.rs (35), pairing/session_desktop_code.rs (6). The bar is 30 methods; this is 11 over it, 1.37× 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: NativeAttachmentPopoverViewController mobile/ios/Runner/NativeAttachmentPopover.swift:7 — TooManyMethods — 39 methods, declared across 2 files: Runner/NativeAttachmentPopover.swift (37), Runner/NativeAttachmentPopoverMenu.swift (2). The bar is 30 methods; this is 9 over it, 1.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppState crates/buzz-relay/src/state.rs:1422 — 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: NativePhotoZoomViewController mobile/ios/Runner/NativePhotoZoomCoordinator.swift:152 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HuddleTransport mobile/lib/shared/huddle/huddle_transport.dart:135 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BuzzClient crates/buzz-cli/src/client.rs:529 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MeshMembership crates/buzz-relay-mesh/src/membership.rs:55 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ChannelsNotifier mobile/lib/features/channels/channels_provider.dart:43 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ReadStateManager desktop/src/features/channels/readState/readStateManager.ts:271 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PairingNotifier mobile/lib/features/pairing/pairing_provider.dart:44 — 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: ReadStateManager mobile/lib/shared/read_state/read_state_manager.dart:124 — 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×18
  • Edited copy of a member (15 corresponding lines) desktop/src-tauri/src/commands/profile.rs:237 — desktop/src-tauri/src/commands/profile.rs:237-252 | desktop/src-tauri/src/commands/social.rs:130-144 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_storage.dart:41 — mobile/lib/features/channels/channel_mutes/channel_mutes_storage.dart:41-55 | mobile/lib/features/channels/channel_stars/channel_stars_storage.dart:41-55 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-db/src/store/admin_moderation.rs:452 — crates/buzz-db/src/store/admin_moderation.rs:452-466 | crates/buzz-db/src/store/product_feedback.rs:90-119 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-db/src/runtime/mod.rs:1413 — crates/buzz-db/src/runtime/mod.rs:1413-1427 | crates/buzz-db/src/runtime/mod.rs:1436-1452 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) desktop/src-tauri/src/events.rs:67 — desktop/src-tauri/src/events.rs:67-81 | desktop/src-tauri/src/events.rs:727-749 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) desktop/src-tauri/src/commands/personas/mod.rs:81 — desktop/src-tauri/src/commands/personas/mod.rs:81-95 | desktop/src-tauri/src/commands/teams/mod.rs:413-427 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:324 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:324-338 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:324-338 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-db/src/store/event.rs:2384 — crates/buzz-db/src/store/event.rs:2384-2398 | crates/buzz-db/src/store/event.rs:2873-2894 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-acp/src/pool.rs:2315 — crates/buzz-acp/src/pool.rs:2315-2329 | crates/buzz-acp/src/pool.rs:2355-2369 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-push-gateway/src/grant.rs:39 — crates/buzz-push-gateway/src/grant.rs:39-53 | crates/buzz-push-gateway/src/token.rs:35-49 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) desktop/src-tauri/src/mesh_llm/mod.rs:684 — desktop/src-tauri/src/mesh_llm/mod.rs:684-698 | desktop/src-tauri/src/mesh_llm/mod.rs:700-714 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs:99 — desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs:99-113 | desktop/src-tauri/src/commands/channels/fetch.rs:33-50 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-feature-flags/src/environment.rs:159 — crates/buzz-feature-flags/src/environment.rs:159-173 | crates/buzz-feature-flags/src/environment.rs:175-189 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) desktop/src-tauri/src/deep_link.rs:240 — desktop/src-tauri/src/deep_link.rs:240-254 | desktop/src-tauri/src/tray_menu.rs:223-238 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mobile/lib/features/channels/channel_detail_page/banners.dart:100 — mobile/lib/features/channels/channel_detail_page/banners.dart:100-114 | mobile/lib/features/channels/channels_page/badges.dart:8-27 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-relay-mesh/src/gossip.rs:111 — crates/buzz-relay-mesh/src/gossip.rs:111-125 | crates/buzz-relay-mesh/src/membership.rs:351-365 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) desktop/src-tauri/src/commands/personas/pending.rs:127 — desktop/src-tauri/src/commands/personas/pending.rs:127-141 | desktop/src-tauri/src/commands/teams/pending.rs:81-97 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/buzz-db/src/store/admin_moderation.rs:435 — crates/buzz-db/src/store/admin_moderation.rs:435-450 | crates/buzz-db/src/store/relay_admin_actions.rs:1383-1397 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D31 · IaC & Container Security · Medium IaC · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · No assertions · ×16
  • No assertions: capture: add-community choices desktop/tests/e2e/add-community-screenshots.spec.ts:176 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: capture: join an existing community desktop/tests/e2e/add-community-screenshots.spec.ts:183 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: capture: create a new community desktop/tests/e2e/add-community-screenshots.spec.ts:195 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: switches the active community on click desktop/tests/e2e/community-rail.spec.ts:438 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: picker survives cancel, same-file retry, and multiple selection desktop/tests/e2e/file-attachment.spec.ts:99 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: stalled early AUTH signing times out and starts a replacement dial desktop/tests/e2e/relay-reconnect.spec.ts:154 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: ${row.name}: ${row.desc} desktop/src/features/admin-console/adminConsolePanel.test.mjs:1071 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D17 · Explicit Debt · TodoComment · ×16
  • TodoComment web/src/features/repos/use-repo-refs.ts:52 — // TODO: Filter by `authors: [relayPubkey]` once the relay's own pubkey is — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment desktop/src-tauri/src/managed_agents/restore.rs:127 — // TODO: the three sweeps above each walk the PID table independently. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment desktop/src-tauri/src/managed_agents/config_bridge/goose.rs:17 — // TODO: replace hardcoded field extraction with schema_walker once goose publishes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment desktop/src-tauri/src/commands/global_agent_config.rs:308 — // TODO: busy/mid-turn deferral would slot in here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment desktop/src-tauri/src/commands/media.rs:386 — // TODO(v2): Stream large video files to the relay instead of buffering in RAM. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment desktop/src/features/projects/projectEnumeration.ts:91 — // TODO: add a telemetry event here so pathological relay states are — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/buzz-workflow/src/executor.rs:740 — // TODO (WF-07): emit DM event.
  • TodoComment crates/buzz-workflow/src/executor.rs:746 — // TODO (WF-07): update channel topic via DB.
  • TodoComment crates/buzz-workflow/src/executor.rs:821 — // TODO (WF-08): create approval record in DB, emit kind:46010.
  • TodoComment crates/buzz-test-client/tests/conformance_multitenant.rs:1865 — /// the executor's approval gate is an explicit TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/buzz-test-client/tests/conformance_multitenant.rs:1933 — /// the executor approval gate is an explicit TODO (WF-08), and
  • TodoComment crates/buzz-relay/src/main.rs:2086 — // TODO(coverage): `serve`'s shutdown wiring has no automated test. The — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:323 — // TODO(v2): Add persistent per-pubkey storage quotas. Admission limits below — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/buzz-dev-mcp/src/lib.rs:113 — /// todo list survives history truncation. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/buzz-cli/src/commands/users.rs:8 — // TODO(phase-4): Replace raw nostr::EventBuilder usage in cmd_set_presence with buzz-sdk builder — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/buzz-cli/src/commands/workflows.rs:10 — // TODO(phase-4): Replace raw nostr::EventBuilder usage with buzz-sdk builder functions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · buzz_agent · ×16
  • buzz_agent::llm::openrouter_post (cognitive 86) crates/buzz-agent/src/llm.rs:2265 — buzz_agent::llm::openrouter_post has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (66 pts), match/switch 4 (11 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_agent::llm::post (cognitive 58) crates/buzz-agent/src/llm.rs:1869 — buzz_agent::llm::post has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 3 (7 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::model_capabilities::resolve (cognitive 58) crates/buzz-agent/src/model_capabilities.rs:345 — buzz_agent::model_capabilities::resolve has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (36 pts), match/switch 2 (8 pts), boolean chains 7, loops 3 (7 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::databricks_label_grammar::generate_databricks_label (cognitive 42) crates/buzz-agent/src/databricks_label_grammar.rs:28 — buzz_agent::databricks_label_grammar::generate_databricks_label has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (23 pts), match/switch 5 (9 pts), boolean chains 8, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::llm::parse_responses (cognitive 38) crates/buzz-agent/src/llm.rs:1018 — buzz_agent::llm::parse_responses has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 3 (7 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::catalog::fetch_catalog_page (cognitive 32) crates/buzz-agent/src/catalog.rs:514 — buzz_agent::catalog::fetch_catalog_page has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::llm::apply_anthropic_cache_control (cognitive 31) crates/buzz-agent/src/llm.rs:2550 — buzz_agent::llm::apply_anthropic_cache_control has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_agent::llm::anthropic_body (cognitive 30) crates/buzz-agent/src/llm.rs:573 — buzz_agent::llm::anthropic_body has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::model_capabilities::validate_manifest (cognitive 28) crates/buzz-agent/src/model_capabilities.rs:537 — buzz_agent::model_capabilities::validate_manifest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 5 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::llm::parse_anthropic (cognitive 21) crates/buzz-agent/src/llm.rs:1375 — buzz_agent::llm::parse_anthropic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::config::pricing_authority (cognitive 18) crates/buzz-agent/src/config.rs:1012 — buzz_agent::config::pricing_authority has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::llm::responses_body (cognitive 17) crates/buzz-agent/src/llm.rs:869 — buzz_agent::llm::responses_body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::session_new (cognitive 16) crates/buzz-agent/src/lib.rs:432 — buzz_agent::session_new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 6 (7 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_agent::llm::openai_body (cognitive 16) crates/buzz-agent/src/llm.rs:734 — buzz_agent::llm::openai_body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_agent::llm::parse_openai (cognitive 16) crates/buzz-agent/src/llm.rs:1463 — buzz_agent::llm::parse_openai has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 1 (3 pts), match/switch 1 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • buzz_agent::wire::read_bounded_line (cognitive 16) crates/buzz-agent/src/wire.rs:387 — buzz_agent::wire::read_bounded_line has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×16
  • Edited copy of a member (19 corresponding lines) crates/buzz-sdk/src/builders.rs:820 — crates/buzz-sdk/src/builders.rs:820-839 | 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.
  • Edited copy of a member (19 corresponding lines) crates/buzz-dev-mcp/src/view_image.rs:252 — crates/buzz-dev-mcp/src/view_image.rs:252-272 | desktop/src-tauri/src/commands/media.rs:316-334 — 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.
  • Edited copy of a member (19 corresponding lines) crates/buzz-cli/src/commands/mem.rs:91 — crates/buzz-cli/src/commands/mem.rs:91-109 | crates/buzz-cli/src/commands/mod.rs:94-112 — 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.
  • Edited copy of a member (19 corresponding lines) desktop/src-tauri/src/commands/admin/mod.rs:975 — desktop/src-tauri/src/commands/admin/mod.rs:975-995 | desktop/src-tauri/src/commands/admin/mod.rs:1013-1031 — 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.
  • Edited copy of a member (19 corresponding lines) REDACTED:2694 — REDACTED:2694-2712 | REDACTED:3010-3029 — 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.
  • Edited copy of a member (19 corresponding lines) crates/buzz-cli/src/commands/projects.rs:490 — crates/buzz-cli/src/commands/projects.rs:490-508 | crates/buzz-cli/src/commands/repos.rs:309-331 — 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.
  • Edited copy of a member (19 corresponding lines) mobile/ios/Runner/PushEndpointGrantStore.swift:98 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:207-228 | mobile/ios/Runner/PushEndpointGrantStore.swift:98-116 — 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.
  • Edited copy of a member (19 corresponding lines) crates/buzz-acp/src/config.rs:653 — crates/buzz-acp/src/config.rs:653-672 | crates/buzz-acp/src/git.rs:307-325 — 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.
  • Edited copy of a member (19 corresponding lines) mobile/ios/NotificationService/NotificationService.swift:78 — mobile/ios/NotificationService/NotificationService.swift:78-96 | mobile/ios/NotificationService/NotificationService.swift:252-271 — 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.
  • Edited copy of a member (19 corresponding lines) crates/buzz-core/src/pairing/session.rs:281 — crates/buzz-core/src/pairing/session.rs:281-299 | crates/buzz-core/src/pairing/session.rs:504-522 — 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.
  • Edited copy of a member (19 corresponding lines) mobile/lib/features/profile/profile_avatar_draft.dart:42 — mobile/lib/features/profile/profile_avatar_draft.dart:42-60 | mobile/lib/features/profile/profile_avatar_draft.dart:108-131 — 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.
  • Edited copy of a member (19 corresponding lines) crates/buzz-db/src/store/relay_members.rs:166 — crates/buzz-db/src/store/relay_members.rs:166-186 | crates/buzz-db/src/store/relay_members.rs:408-426 — 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.
  • Edited copy of a member (19 corresponding lines) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:736 — mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:736-754 | mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:756-776 — 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.
  • Edited copy of a member (19 corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:161 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:161-179 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:161-179 — 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.
  • Edited copy of a member (19 corresponding lines) crates/buzz-db/src/store/dm.rs:449 — crates/buzz-db/src/store/dm.rs:449-471 | crates/buzz-db/src/store/relay_members.rs:1301-1319 — 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.
  • Edited copy of a member (19 corresponding lines) desktop/src-tauri/src/commands/project_git_recipient_notes.rs:135 — desktop/src-tauri/src/commands/project_git_recipient_notes.rs:135-153 | desktop/src-tauri/src/commands/project_git_recipient_notes.rs:204-222 — 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 (10 corresponding lines) · ×15
  • Edited copy of a member (10 corresponding lines) crates/buzz-cli/src/commands/moderation.rs:40 — crates/buzz-cli/src/commands/moderation.rs:40-49 | crates/buzz-cli/src/commands/moderation.rs:67-77 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-acp/src/prompt_project.rs:150 — crates/buzz-acp/src/prompt_project.rs:150-159 | crates/buzz-cli/src/commands/project_channel.rs:140-152 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) desktop/src-tauri/src/managed_agents/backend.rs:573 — desktop/src-tauri/src/managed_agents/backend.rs:573-585 | desktop/src-tauri/src/managed_agents/backend.rs:614-623 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-push-gateway/src/postgres.rs:325 — crates/buzz-push-gateway/src/postgres.rs:325-335 | crates/buzz-push-gateway/src/postgres.rs:368-377 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-acp/src/prompt_project.rs:93 — crates/buzz-acp/src/prompt_project.rs:93-102 | crates/buzz-acp/src/prompt_project.rs:104-113 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) desktop/src-tauri/src/commands/identity.rs:723 — desktop/src-tauri/src/commands/identity.rs:723-737 | desktop/src-tauri/src/commands/identity.rs:743-752 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) desktop/src-tauri/src/commands/identity_archive.rs:224 — desktop/src-tauri/src/commands/identity_archive.rs:224-234 | desktop/src-tauri/src/commands/identity_archive.rs:245-254 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-media/src/auth.rs:302 — crates/buzz-media/src/auth.rs:302-311 | crates/buzz-media/src/auth.rs:350-366 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-acp/src/relay.rs:3805 — crates/buzz-acp/src/relay.rs:3805-3814 | desktop/src-tauri/src/commands/messages.rs:939-948 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) desktop/src-tauri/src/commands/workflows.rs:203 — desktop/src-tauri/src/commands/workflows.rs:203-212 | desktop/src-tauri/src/commands/workflows.rs:357-367 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-auth/src/nip_fi/command.rs:542 — crates/buzz-auth/src/nip_fi/command.rs:542-551 | crates/buzz-relay/src/api/nip_fi.rs:621-630 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-db/src/store/channel_members.rs:109 — crates/buzz-db/src/store/channel_members.rs:109-122 | crates/buzz-db/src/store/push.rs:40-49 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) desktop/src-tauri/src/archive/store.rs:300 — desktop/src-tauri/src/archive/store.rs:300-313 | desktop/src-tauri/src/archive/store_migrations.rs:450-459 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-db/src/runtime/mod.rs:43 — crates/buzz-db/src/runtime/mod.rs:43-52 | crates/buzz-db/src/store/event.rs:448-458 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/buzz-test-client/src/loadgen/net.rs:120 — crates/buzz-test-client/src/loadgen/net.rs:120-132 | crates/buzz-test-client/src/loadgen/net.rs:135-144 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · buzz_db · ×14
  • buzz_db::store::partition::audit_table_on (cyclomatic 45) crates/buzz-db/src/store/partition.rs:622 — buzz_db::store::partition::audit_table_on has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl (cyclomatic 31) crates/buzz-db/src/store/replaceable.rs:105 — buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_db::store::channel::update_channel_on (cyclomatic 24) crates/buzz-db/src/store/channel.rs:1304 — buzz_db::store::channel::update_channel_on 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.
  • buzz_db::store::event::push_event_filters (cyclomatic 24) crates/buzz-db/src/store/event.rs:785 — buzz_db::store::event::push_event_filters 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.
  • buzz_db::store::event::count_events_sql (cyclomatic 24) crates/buzz-db/src/store/event.rs:1581 — buzz_db::store::event::count_events_sql 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.
  • buzz_db::store::partition::maintenance::attempt_change (cyclomatic 21) crates/buzz-db/src/store/partition/maintenance.rs:586 — buzz_db::store::partition::maintenance::attempt_change has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_db::store::partition::maintenance::plan_maintenance (cyclomatic 20) crates/buzz-db/src/store/partition/maintenance.rs:204 — buzz_db::store::partition::maintenance::plan_maintenance has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_db::store::channel::group_metadata_tags (cyclomatic 19) crates/buzz-db/src/store/channel.rs:840 — buzz_db::store::channel::group_metadata_tags has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_db::store::channel::apply_channel_metadata_event (cyclomatic 18) crates/buzz-db/src/store/channel.rs:1639 — buzz_db::store::channel::apply_channel_metadata_event has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_db::store::thread::get_channel_window_on (cyclomatic 18) crates/buzz-db/src/store/thread.rs:596 — buzz_db::store::thread::get_channel_window_on 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::media::media_reference_query (cyclomatic 17) crates/buzz-db/src/store/media.rs:291 — buzz_db::store::media::media_reference_query has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_db::store::push::accept_lease_event (cyclomatic 17) crates/buzz-db/src/store/push.rs:199 — buzz_db::store::push::accept_lease_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_db::store::relay_admin_actions::finalize_success (cyclomatic 16) crates/buzz-db/src/store/relay_admin_actions.rs:902 — buzz_db::store::relay_admin_actions::finalize_success has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_db::store::thread::get_thread_replies_on (cyclomatic 16) crates/buzz-db/src/store/thread.rs:353 — 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.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×14
  • Edited copy of a member (14 corresponding lines) desktop/src-tauri/src/commands/channel_window.rs:23 — desktop/src-tauri/src/commands/channel_window.rs:23-36 | desktop/src-tauri/src/commands/messages.rs:300-320 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-db/src/store/relay_admin_actions.rs:1941 — crates/buzz-db/src/store/relay_admin_actions.rs:1941-1955 | crates/buzz-db/src/store/relay_admin_actions.rs:1958-1971 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-relay/src/api/admin/mod.rs:1397 — crates/buzz-relay/src/api/admin/mod.rs:1397-1410 | crates/buzz-relay/src/handlers/report_resolution.rs:1019-1036 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-pubsub/src/cache_invalidation.rs:38 — crates/buzz-pubsub/src/cache_invalidation.rs:38-51 | crates/buzz-pubsub/src/conn_control.rs:92-105 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-relay/src/api/git/store.rs:387 — crates/buzz-relay/src/api/git/store.rs:387-400 | crates/buzz-relay/src/api/git/store.rs:413-426 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) desktop/src-tauri/src/huddle/tts_settings.rs:525 — desktop/src-tauri/src/huddle/tts_settings.rs:525-538 | desktop/src-tauri/src/huddle/tts_settings.rs:581-594 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mobile/lib/features/profile/profile_avatar_draft.dart:78 — mobile/lib/features/profile/profile_avatar_draft.dart:78-91 | mobile/lib/features/profile/profile_avatar_draft.dart:93-106 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) desktop/src-tauri/src/commands/personas/pending.rs:147 — desktop/src-tauri/src/commands/personas/pending.rs:147-165 | desktop/src-tauri/src/commands/teams/pending.rs:103-116 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-db/src/store/event.rs:207 — crates/buzz-db/src/store/event.rs:207-225 | crates/buzz-db/src/store/event.rs:232-245 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-db/src/store/reaction.rs:114 — crates/buzz-db/src/store/reaction.rs:114-140 | crates/buzz-db/src/store/reaction.rs:154-167 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-db/src/store/allowlist.rs:49 — crates/buzz-db/src/store/allowlist.rs:49-62 | crates/buzz-db/src/store/channel_members.rs:1220-1238 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-db/src/store/leader_lock.rs:40 — crates/buzz-db/src/store/leader_lock.rs:40-57 | crates/buzz-db/src/store/storage_accounting.rs:103-116 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-relay/src/fenced_cache.rs:138 — crates/buzz-relay/src/fenced_cache.rs:138-153 | crates/buzz-relay/src/host_cache.rs:140-153 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/buzz-sdk/src/builders.rs:2248 — crates/buzz-sdk/src/builders.rs:2248-2261 | desktop/src-tauri/src/events.rs:611-624 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×14
  • Edited copy of a member (16 corresponding lines) desktop/src-tauri/src/deep_link.rs:531 — desktop/src-tauri/src/deep_link.rs:531-551 | desktop/src-tauri/src/nostr_bind.rs:64-79 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) desktop/src-tauri/src/managed_agents/teams.rs:162 — desktop/src-tauri/src/managed_agents/teams.rs:162-177 | desktop/src-tauri/src/managed_agents/teams.rs:179-200 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) desktop/src-tauri/src/native_relay_client.rs:139 — desktop/src-tauri/src/native_relay_client.rs:139-154 | desktop/src-tauri/src/native_relay_client.rs:179-204 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/buzz-deletion/src/lib.rs:1068 — crates/buzz-deletion/src/lib.rs:1068-1086 | crates/buzz-deletion/src/lib.rs:1248-1263 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) desktop/src-tauri/src/huddle/agent_voice.rs:179 — desktop/src-tauri/src/huddle/agent_voice.rs:179-194 | desktop/src-tauri/src/huddle/agent_voice.rs:202-220 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/buzz-acp/src/relay.rs:3735 — crates/buzz-acp/src/relay.rs:3735-3750 | crates/buzz-acp/src/relay.rs:3772-3787 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) desktop/src-tauri/src/migration.rs:1054 — desktop/src-tauri/src/migration.rs:1054-1069 | desktop/src-tauri/src/migration.rs:1121-1144 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/buzz-relay/src/handlers/req.rs:1589 — crates/buzz-relay/src/handlers/req.rs:1589-1604 | crates/buzz-relay/src/handlers/req.rs:1618-1634 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mobile/lib/features/channels/channel.dart:184 — mobile/lib/features/channels/channel.dart:184-205 | mobile/lib/features/channels/channel.dart:300-315 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) desktop/src-tauri/src/relay.rs:372 — desktop/src-tauri/src/relay.rs:372-387 | desktop/src-tauri/src/relay.rs:395-410 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/buzz-db/src/store/storage_accounting.rs:120 — crates/buzz-db/src/store/storage_accounting.rs:120-139 | crates/buzz-db/src/store/storage_accounting.rs:157-172 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) desktop/src-tauri/src/commands/channels.rs:112 — desktop/src-tauri/src/commands/channels.rs:112-128 | desktop/src-tauri/src/commands/workflows.rs:181-196 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/buzz-relay/src/tunnel/reliable.rs:278 — crates/buzz-relay/src/tunnel/reliable.rs:278-294 | crates/buzz-relay/src/tunnel/reliable.rs:309-324 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/buzz-db/src/store/relay_invite.rs:437 — crates/buzz-db/src/store/relay_invite.rs:437-452 | crates/buzz-db/src/store/relay_members.rs:217-232 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×14
  • Edited copy of a member (13 corresponding lines) crates/buzz-push-gateway/src/grant.rs:109 — crates/buzz-push-gateway/src/grant.rs:109-129 | crates/buzz-push-gateway/src/token.rs:56-68 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) desktop/src-tauri/src/commands/agent_discovery.rs:644 — desktop/src-tauri/src/commands/agent_discovery.rs:644-660 | desktop/src-tauri/src/commands/global_agent_config.rs:386-398 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mobile/ios/Runner/HuddleAudioEngine.swift:139 — mobile/ios/Runner/HuddleAudioEngine.swift:139-153 | mobile/ios/Runner/HuddleAudioEngine.swift:220-232 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/buzz-db/src/store/channel_members.rs:718 — crates/buzz-db/src/store/channel_members.rs:718-734 | crates/buzz-db/src/store/event.rs:2208-2220 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) desktop/src-tauri/src/mesh_llm/coordinator.rs:353 — desktop/src-tauri/src/mesh_llm/coordinator.rs:353-365 | desktop/src-tauri/src/mesh_llm/coordinator.rs:371-385 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) desktop/src-tauri/src/commands/admin/reads.rs:171 — desktop/src-tauri/src/commands/admin/reads.rs:171-183 | desktop/src-tauri/src/commands/admin/reads.rs:192-204 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) desktop/src-tauri/src/commands/agent_providers.rs:7 — desktop/src-tauri/src/commands/agent_providers.rs:7-19 | desktop/src-tauri/src/commands/agent_providers.rs:22-34 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/buzz-core/src/pairing/session.rs:302 — crates/buzz-core/src/pairing/session.rs:302-314 | crates/buzz-core/src/pairing/session.rs:531-544 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/buzz-cli/src/commands/dms.rs:8 — crates/buzz-cli/src/commands/dms.rs:8-20 | crates/buzz-cli/src/commands/users.rs:183-196 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mobile/ios/Runner/HuddleAudioEngine.swift:854 — mobile/ios/Runner/HuddleAudioEngine.swift:854-866 | mobile/ios/Runner/HuddleAudioEngine.swift:868-883 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mobile/lib/features/channels/mobile_huddle_controller.dart:140 — mobile/lib/features/channels/mobile_huddle_controller.dart:140-154 | mobile/lib/features/channels/mobile_huddle_controller.dart:287-299 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mobile/lib/features/profile/animated_avatar_capture/capture_controls.dart:118 — mobile/lib/features/profile/animated_avatar_capture/capture_controls.dart:118-130 | mobile/lib/shared/widgets/image_avatar_capture/camera_preview.dart:8-20 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) REDACTED:3672 — REDACTED:3672-3687 | crates/buzz-db/src/store/entity_deletion/approvals.rs:117-129 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/buzz-db/src/store/reaction.rs:582 — crates/buzz-db/src/store/reaction.rs:582-594 | crates/buzz-db/src/store/workflow.rs:1628-1640 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×14
  • Edited copy of a member (8 corresponding lines) desktop/src-tauri/src/archive/agent_usage.rs:635 — desktop/src-tauri/src/archive/agent_usage.rs:635-642 | desktop/src-tauri/src/archive/agent_usage.rs:647-654 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/buzz-pairing-cli/src/main.rs:493 — crates/buzz-pairing-cli/src/main.rs:493-500 | desktop/src-tauri/src/commands/pairing.rs:867-874 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/buzz-sdk/src/builders.rs:1911 — crates/buzz-sdk/src/builders.rs:1911-1918 | crates/buzz-sdk/src/builders.rs:1930-1938 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mobile/lib/features/channels/channels_provider.dart:1186 — mobile/lib/features/channels/channels_provider.dart:1186-1194 | mobile/lib/features/channels/pending_local_messages_provider.dart:27-34 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) desktop/src-tauri/src/relay/submit.rs:105 — desktop/src-tauri/src/relay/submit.rs:105-112 | desktop/src-tauri/src/relay/submit.rs:121-128 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/buzz-sdk/src/builders.rs:1060 — crates/buzz-sdk/src/builders.rs:1060-1067 | desktop/src-tauri/src/events.rs:430-437 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/ifc-core/src/lib.rs:69 — crates/ifc-core/src/lib.rs:69-76 | crates/ifc-core/src/lib.rs:82-89 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:263 — mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:263-270 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:272-279 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) desktop/src-tauri/src/channel_head_cache.rs:52 — desktop/src-tauri/src/channel_head_cache.rs:52-60 | desktop/src-tauri/src/observed_unread.rs:170-177 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/buzz-sdk/src/broker/actions/mod.rs:302 — crates/buzz-sdk/src/broker/actions/mod.rs:302-310 | crates/buzz-sdk/src/builders.rs:69-76 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/git-sign-nostr/src/lib.rs:351 — crates/git-sign-nostr/src/lib.rs:351-360 | crates/git-sign-nostr/src/lib.rs:368-375 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) desktop/src-tauri/src/commands/personas/snapshot/import.rs:287 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:287-294 | desktop/src-tauri/src/managed_agents/agent_snapshot.rs:317-330 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) desktop/src-tauri/src/managed_agents/retention.rs:546 — desktop/src-tauri/src/managed_agents/retention.rs:546-555 | desktop/src-tauri/src/observed_unread.rs:293-300 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mobile/lib/features/channels/channel_sort/channel_sort_manager.dart:227 — mobile/lib/features/channels/channel_sort/channel_sort_manager.dart:227-234 | mobile/lib/shared/theme/community_theme_sync.dart:188-195 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×14
  • Edited copy of a member (4 corresponding lines) docs/formal/nip-rs-unread/model.py:218 — docs/formal/nip-rs-unread/model.py:218-222 | docs/formal/nip-rs-unread/mutation.py:122-125 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) mobile/ios/Runner/NativeCommunityEntry.swift:380 — mobile/ios/Runner/NativeCommunityEntry.swift:380-383 | mobile/ios/Runner/NativeProfileSetup.swift:508-511 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/buzz-sdk/src/builders.rs:572 — crates/buzz-sdk/src/builders.rs:572-575 | desktop/src-tauri/src/events.rs:411-414 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/buzz-sdk/src/builders.rs:872 — crates/buzz-sdk/src/builders.rs:872-875 | desktop/src-tauri/src/events.rs:125-128 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/buzz-sdk/src/builders.rs:1022 — crates/buzz-sdk/src/builders.rs:1022-1025 | desktop/src-tauri/src/events.rs:131-134 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/buzz-sdk/src/builders.rs:1046 — crates/buzz-sdk/src/builders.rs:1046-1049 | desktop/src-tauri/src/events.rs:214-217 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/buzz-relay/src/handlers/community_provisioning.rs:74 — crates/buzz-relay/src/handlers/community_provisioning.rs:74-78 | desktop/src-tauri/src/commands/project_git_workflow.rs:106-109 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) desktop/src-tauri/src/events.rs:768 — desktop/src-tauri/src/events.rs:768-771 | desktop/src-tauri/src/events/workflows.rs:28-32 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) desktop/src-tauri/src/events.rs:527 — desktop/src-tauri/src/events.rs:527-532 | desktop/src-tauri/src/events/workflows.rs:35-38 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/buzz-cli/src/commands/social.rs:157 — crates/buzz-cli/src/commands/social.rs:157-160 | desktop/src-tauri/src/nostr_convert.rs:39-44 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/buzz-dev-mcp/src/shell.rs:461 — crates/buzz-dev-mcp/src/shell.rs:461-465 | desktop/src-tauri/src/managed_agents/git_bash.rs:259-262 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) mobile/lib/shared/hosted/account_identity_store.dart:136 — mobile/lib/shared/hosted/account_identity_store.dart:136-139 | mobile/lib/shared/hosted/browser_auth.dart:71-77 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) mobile/ios/Runner/StickyDateGlassHeader.swift:123 — mobile/ios/Runner/StickyDateGlassHeader.swift:123-126 | mobile/ios/Runner/ThemePaginationGlassControl.swift:302-305 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) mobile/lib/features/channels/local_send_bubble_surface.dart:106 — mobile/lib/features/channels/local_send_bubble_surface.dart:106-109 | mobile/lib/features/channels/local_send_row.dart:59-62 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×14
  • Duplicated block (16 lines × 2) crates/buzz-acp/src/config.rs:1436 — crates/buzz-acp/src/config.rs:1436-1451 | crates/buzz-acp/src/config.rs:1522-1537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/config.rs:1436` 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 (16 lines × 2) crates/buzz-acp/src/filter.rs:265 — crates/buzz-acp/src/filter.rs:265-280 | crates/buzz-workflow/src/executor.rs:236-251 — before extracting anything, compare `crates/buzz-acp/src/filter.rs` and `crates/buzz-workflow/src/executor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) crates/buzz-relay/src/audio/room.rs:782 — crates/buzz-relay/src/audio/room.rs:782-797 | crates/buzz-relay/src/audio/room.rs:809-824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/room.rs:782` 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 (16 lines × 2) crates/buzz-sdk/src/builders.rs:1793 — crates/buzz-sdk/src/builders.rs:1793-1808 | crates/buzz-sdk/src/builders.rs:1872-1887 — both copies are in the same file, so extract the 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 `crates/buzz-sdk/src/builders.rs:1793` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `meta` to `&GitPullRequestMeta` in one and `&GitPrUpdateMeta` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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/managed_agents/backend.rs:113 — desktop/src-tauri/src/managed_agents/backend.rs:113-128 | desktop/src-tauri/src/managed_agents/backend.rs:137-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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/backend.rs:113` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/relay.rs:721` 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 (16 lines × 2) crates/buzz-relay/src/handlers/moderation_commands.rs:224 — crates/buzz-relay/src/handlers/moderation_commands.rs:224-240 | crates/buzz-relay/src/handlers/moderation_commands.rs:336-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/moderation_commands.rs:224` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/buzz-db/src/store/dm.rs:412 — crates/buzz-db/src/store/dm.rs:412-427 | crates/buzz-db/src/store/workflow.rs:848-864 — 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 `crates/buzz-db/src/store/dm.rs:412` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 2) mobile/ios/Runner/InlinePhotoPicker.swift:92 — mobile/ios/Runner/InlinePhotoPicker.swift:92-107 | mobile/ios/Runner/NativeAttachmentPopover.swift:185-200 — 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 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) mobile/lib/features/channels/add_members_sheet.dart:253 — mobile/lib/features/channels/add_members_sheet.dart:253-268 | mobile/lib/features/channels/channels_page/sheets.dart:438-453 — before extracting anything, compare `mobile/lib/features/channels/add_members_sheet.dart` and `mobile/lib/features/channels/channels_page/sheets.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/add_members_sheet.dart:253` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:129 — mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:129-144 | mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:228-243 — both copies are in the same file, so extract the 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/lib/features/channels/agent_activity/transcript_item_widget.dart:129` 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 (16 lines × 2) mobile/lib/features/channels/channel_detail_page/message_list.dart:669 — mobile/lib/features/channels/channel_detail_page/message_list.dart:669-684 | mobile/lib/features/channels/thread_detail_page.dart:793-808 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_list.dart:669` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:122 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:122-137 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:122-137 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (6 lines × 3) · ×14
  • Duplicated block (6 lines × 3) crates/buzz-relay/src/api/bridge.rs:1289 — crates/buzz-relay/src/api/bridge.rs:1289-1295 | crates/buzz-relay/src/api/bridge.rs:1646-1651 | crates/buzz-relay/src/api/bridge.rs:2350-2356 — 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 `crates/buzz-relay/src/api/bridge.rs:1289` 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 (6 lines × 3) crates/buzz-relay/src/handlers/command_executor.rs:458 — crates/buzz-relay/src/handlers/command_executor.rs:458-463 | crates/buzz-relay/src/handlers/command_executor.rs:596-601 | crates/buzz-relay/src/handlers/command_executor.rs:669-674 — 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:3137-3142 | crates/buzz-relay/src/handlers/relay_admin.rs:241-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/identity_archive.rs:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/buzz-sdk/src/builders.rs:1343 — crates/buzz-sdk/src/builders.rs:1343-1348 | crates/buzz-sdk/src/builders.rs:1796-1801 | crates/buzz-sdk/src/builders.rs:1875-1880 — 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 `crates/buzz-sdk/src/builders.rs:1343` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `meta` to `&GitPatchMeta` in one and `&GitPullRequestMeta` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-sdk/src/builders.rs:1342` calls `check_content` and `crates/buzz-sdk/src/builders.rs:1795` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) desktop/src-tauri/src/managed_agents/retention.rs:497 — desktop/src-tauri/src/managed_agents/retention.rs:497-502 | desktop/src-tauri/src/managed_agents/retention.rs:621-626 | desktop/src-tauri/src/managed_agents/retention/legacy_migration.rs:135-140 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/retention.rs:497` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/buzz-relay/src/api/bridge.rs:1165 — crates/buzz-relay/src/api/bridge.rs:1165-1170 | crates/buzz-relay/src/api/bridge/thread_roots.rs:77-82 | crates/buzz-relay/src/handlers/side_effects.rs:1158-1163 — 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/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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/media_proxy.rs:276` 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 (6 lines × 3) crates/buzz-acp/src/lib.rs:2785 — crates/buzz-acp/src/lib.rs:2785-2792 | crates/buzz-acp/src/lib.rs:2797-2802 | crates/buzz-acp/src/lib.rs:2807-2812 — 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 `crates/buzz-acp/src/lib.rs:2785` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/buzz-relay/src/config.rs:824 — crates/buzz-relay/src/config.rs:824-830 | crates/buzz-relay/src/config.rs:1054-1060 | crates/buzz-relay/src/main.rs:889-894 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/config.rs:824` 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 (6 lines × 3) crates/buzz-cli/src/commands/channels.rs:1707 — crates/buzz-cli/src/commands/channels.rs:1707-1712 | crates/buzz-cli/src/commands/messages.rs:937-943 | crates/buzz-cli/src/commands/users.rs:419-425 — 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 `crates/buzz-cli/src/commands/channels.rs:1707` 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 (6 lines × 3) crates/buzz-cli/src/commands/agents.rs:27 — crates/buzz-cli/src/commands/agents.rs:27-32 | crates/buzz-cli/src/commands/agents.rs:70-75 | crates/buzz-cli/src/commands/projects.rs:59-64 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/agents.rs:27` 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 (6 lines × 3) crates/buzz-acp/src/relay.rs:510 — crates/buzz-acp/src/relay.rs:510-515 | crates/buzz-acp/src/relay.rs:523-528 | crates/buzz-acp/src/relay.rs:581-586 — 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 `crates/buzz-acp/src/relay.rs:510` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agent_models.rs:515` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `response` to `OpenAiModelListResponse` in one and `AnthropicModelListResponse` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D1 · Cyclomatic Complexity · buzz_acp · ×13
  • buzz_acp::run_harness (cyclomatic 171) crates/buzz-acp/src/lib.rs:2877 — buzz_acp::run_harness has cyclomatic complexity 171 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_acp::pool::run_prompt_task (cyclomatic 74) crates/buzz-acp/src/pool.rs:2415 — buzz_acp::pool::run_prompt_task has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_acp::relay::run_background_task (cyclomatic 61) crates/buzz-acp/src/relay.rs:1849 — buzz_acp::relay::run_background_task has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_acp::relay::handle_ws_message (cyclomatic 48) crates/buzz-acp/src/relay.rs:2287 — buzz_acp::relay::handle_ws_message has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_acp::handle_prompt_result (cyclomatic 46) crates/buzz-acp/src/lib.rs:5270 — buzz_acp::handle_prompt_result has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_acp::queue::format_context_hints (cyclomatic 27) crates/buzz-acp/src/queue.rs:1951 — buzz_acp::queue::format_context_hints has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_acp::relay::execute_connected_command (cyclomatic 24) crates/buzz-acp/src/relay.rs:1661 — 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 19) crates/buzz-acp/src/relay.rs:2780 — buzz_acp::relay::resubscribe_after_reconnect 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_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::relay::wait_for_reconnect (cyclomatic 17) crates/buzz-acp/src/relay.rs:3317 — buzz_acp::relay::wait_for_reconnect 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.
  • buzz_acp::pool::parse_nostr_thread_response_with_meta (cyclomatic 16) crates/buzz-acp/src/pool.rs:4748 — buzz_acp::pool::parse_nostr_thread_response_with_meta has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_acp::relay::drain_commands (cyclomatic 16) crates/buzz-acp/src/relay.rs:3084 — 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.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×13
  • Duplicated block (20 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:1553 — crates/buzz-db/src/store/relay_admin_actions.rs:1553-1572 | crates/buzz-db/src/store/relay_admin_actions.rs:1640-1659 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/relay_admin_actions.rs:1553` 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 (20 lines × 2) crates/buzz-db/src/store/relay_invite.rs:620 — crates/buzz-db/src/store/relay_invite.rs:620-639 | crates/buzz-db/src/store/relay_invite.rs:678-697 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/relay_invite.rs:620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) crates/buzz-relay/src/api/bridge.rs:1685 — crates/buzz-relay/src/api/bridge.rs:1685-1704 | crates/buzz-relay/src/api/bridge.rs:2383-2402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/buzz-relay/src/api/bridge.rs:2533 — crates/buzz-relay/src/api/bridge.rs:2533-2552 | crates/buzz-relay/src/api/bridge.rs:2606-2625 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/bridge.rs:2533` 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 (20 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:1127 — crates/buzz-relay/src/handlers/command_executor.rs:1127-1146 | crates/buzz-relay/src/handlers/command_executor.rs:1238-1257 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/command_executor.rs:1127` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media_animated.rs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) crates/buzz-db/src/store/api_token.rs:103 — crates/buzz-db/src/store/api_token.rs:103-127 | crates/buzz-db/src/store/api_token.rs:295-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/buzz-db/src/store/reminder.rs:168 — crates/buzz-db/src/store/reminder.rs:168-187 | crates/buzz-db/src/store/workflow.rs:649-672 — 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 `crates/buzz-db/src/store/reminder.rs:168` 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 (20 lines × 2) crates/buzz-db/src/store/channel.rs:183 — crates/buzz-db/src/store/channel.rs:183-203 | crates/buzz-db/src/store/dm.rs:209-228 — 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 `crates/buzz-db/src/store/channel.rs:183` 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 (20 lines × 2) REDACTED:3858 — REDACTED:3858-3877 | REDACTED:3886-3905 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) crates/buzz-relay/src/api/bridge.rs:3019 — crates/buzz-relay/src/api/bridge.rs:3019-3038 | crates/buzz-relay/src/handlers/command_executor.rs:991-1010 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/api/bridge.rs:3019` 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 (20 lines × 2) mobile/lib/features/pairing/pairing_socket.dart:183 — mobile/lib/features/pairing/pairing_socket.dart:183-202 | mobile/lib/shared/relay/relay_socket.dart:199-218 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/pairing/pairing_socket.dart:183` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The 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 (20 lines × 2) mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:41 — mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:41-60 | mobile/lib/shared/widgets/frosted_scaffold.dart:124-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:39` calls `providesSurfaceOf` and `mobile/lib/shared/widgets/frosted_scaffold.dart:122` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D5 · Coupling · Off the main sequence · ×13
  • Off the main sequence: buzz-audio-client — buzz-audio-client: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: buzz-core — buzz-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
  • Off the main sequence: buzz-persona — buzz-persona: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: buzz-voice — buzz-voice: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: buzz-ws-client — buzz-ws-client: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: git-credential-nostr — git-credential-nostr: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: git-sign-nostr — git-sign-nostr: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: buzz-agent — buzz-agent: abstractness 0.03, instability 0.00, distance 0.97 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: buzz-conformance — buzz-conformance: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: buzz-terminal — buzz-terminal: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: buzz-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-db — buzz-db: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 6 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.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×12
  • Edited copy of a member (18 corresponding lines) crates/buzz-media/src/bucket_index.rs:147 — crates/buzz-media/src/bucket_index.rs:147-164 | crates/buzz-media/src/bucket_index.rs:167-188 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) desktop/src-tauri/src/managed_agents/agent_snapshot.rs:370 — desktop/src-tauri/src/managed_agents/agent_snapshot.rs:370-387 | desktop/src-tauri/src/managed_agents/team_snapshot.rs:148-168 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/buzz-relay/src/audio/room.rs:780 — crates/buzz-relay/src/audio/room.rs:780-797 | crates/buzz-relay/src/audio/room.rs:804-824 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/buzz-db/src/store/channel.rs:1450 — crates/buzz-db/src/store/channel.rs:1450-1467 | crates/buzz-db/src/store/channel.rs:1494-1511 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/buzz-acp/src/lib.rs:4513 — crates/buzz-acp/src/lib.rs:4513-4530 | crates/buzz-acp/src/lib.rs:4544-4563 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) desktop/src-tauri/src/commands/profile.rs:20 — desktop/src-tauri/src/commands/profile.rs:20-37 | desktop/src-tauri/src/commands/profile.rs:184-205 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) desktop/src-tauri/src/commands/teams/pending.rs:492 — desktop/src-tauri/src/commands/teams/pending.rs:492-509 | desktop/src-tauri/src/event_sync.rs:554-571 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mobile/lib/shared/emoji/emoji_picker/emoji_grid.dart:118 — mobile/lib/shared/emoji/emoji_picker/emoji_grid.dart:118-135 | mobile/lib/shared/emoji/emoji_picker/emoji_grid.dart:152-169 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:187 — mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:187-206 | mobile/lib/shared/read_state/read_state_manager.dart:342-359 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/buzz-auth/src/scope.rs:68 — crates/buzz-auth/src/scope.rs:68-87 | crates/buzz-auth/src/scope.rs:94-111 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) desktop/src-tauri/src/managed_agents/git_bash.rs:38 — desktop/src-tauri/src/managed_agents/git_bash.rs:38-55 | desktop/src-tauri/src/managed_agents/git_bash.rs:65-82 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) desktop/src-tauri/src/archive/mod.rs:579 — desktop/src-tauri/src/archive/mod.rs:579-596 | desktop/src-tauri/src/archive/mod.rs:612-631 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×12
  • Edited copy of a member (11 corresponding lines) crates/buzz-push-gateway/src/postgres.rs:383 — crates/buzz-push-gateway/src/postgres.rs:383-393 | crates/buzz-push-gateway/src/postgres.rs:399-411 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/buzz-agent/src/types.rs:313 — crates/buzz-agent/src/types.rs:313-325 | crates/buzz-agent/src/types.rs:467-477 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/buzz-push-gateway/src/strict_json.rs:58 — crates/buzz-push-gateway/src/strict_json.rs:58-69 | crates/buzz-relay/src/handlers/push_lease.rs:417-427 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/buzz-cli/src/commands/read_state.rs:130 — crates/buzz-cli/src/commands/read_state.rs:130-140 | crates/buzz-relay/src/handlers/auth.rs:502-512 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) desktop/src-tauri/src/commands/agents/provider_access.rs:121 — desktop/src-tauri/src/commands/agents/provider_access.rs:121-131 | desktop/src-tauri/src/managed_agents/restore.rs:616-626 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/buzz-relay/src/state.rs:906 — crates/buzz-relay/src/state.rs:906-916 | crates/buzz-relay/src/state.rs:975-985 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/buzz-relay/src/handlers/req.rs:1294 — crates/buzz-relay/src/handlers/req.rs:1294-1304 | crates/buzz-relay/src/handlers/req.rs:1606-1616 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mobile/lib/features/channels/thread_detail_helpers.dart:156 — mobile/lib/features/channels/thread_detail_helpers.dart:156-166 | mobile/lib/features/channels/thread_detail_helpers.dart:168-181 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/buzz-relay/src/state.rs:529 — crates/buzz-relay/src/state.rs:529-542 | crates/buzz-relay/src/state.rs:587-597 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:281 — mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:281-291 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:293-303 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) desktop/src-tauri/src/archive/store.rs:218 — desktop/src-tauri/src/archive/store.rs:218-236 | desktop/src-tauri/src/managed_agents/retention.rs:523-533 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/buzz-db/src/store/relay_invite.rs:317 — crates/buzz-db/src/store/relay_invite.rs:317-327 | crates/buzz-db/src/store/relay_invite/revocation.rs:10-27 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×12
  • Duplicated block (17 lines × 2) crates/buzz-acp/src/lib.rs:6250 — crates/buzz-acp/src/lib.rs:6250-6266 | crates/buzz-acp/src/lib.rs:6298-6314 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/lib.rs:6250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `AuthMethodsArgs` in one and `AuthenticateArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/issues.rs:504` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:175 — crates/buzz-db/src/store/relay_admin_actions.rs:175-191 | crates/buzz-db/src/store/relay_admin_actions.rs:316-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/relay_admin_actions.rs:175` 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 (17 lines × 2) crates/buzz-db/src/store/relay_invite.rs:659 — crates/buzz-db/src/store/relay_invite.rs:659-675 | crates/buzz-db/src/store/relay_invite/claim_owner.rs:125-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/relay_invite.rs: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/relay_invite/claim_owner.rs:124` calls `bind` and `crates/buzz-db/src/store/relay_invite.rs:658` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/project_git_diff.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/huddle/tts.rs:753` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/buzz-sdk/src/builders.rs:821 — crates/buzz-sdk/src/builders.rs:821-837 | desktop/src-tauri/src/events.rs:449-465 — 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 (17 lines × 2) crates/buzz-db/src/store/reaction.rs:373 — crates/buzz-db/src/store/reaction.rs:373-394 | crates/buzz-db/src/store/reminder.rs:127-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-db/src/store/reaction.rs:395` calls `bind` and `crates/buzz-db/src/store/reminder.rs:144` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) crates/buzz-db/src/store/moderation.rs:323 — crates/buzz-db/src/store/moderation.rs:323-339 | crates/buzz-db/src/store/relay_admin_actions.rs:146-164 — before extracting anything, compare `crates/buzz-db/src/store/moderation.rs` and `crates/buzz-db/src/store/relay_admin_actions.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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-db/src/store/moderation.rs:340` calls `bind` and `crates/buzz-db/src/store/relay_admin_actions.rs:165` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) REDACTED:2615 — REDACTED:2615-2631 | REDACTED:2665-2681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:2632` calls `bind` and `REDACTED:2682` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:161 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:161-177 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:161-177 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) mobile/lib/shared/widgets/image_avatar_capture.dart:510 — mobile/lib/shared/widgets/image_avatar_capture.dart:510-526 | mobile/lib/shared/widgets/image_avatar_capture.dart:585-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. 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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×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:5543 — crates/buzz-acp/src/lib.rs:5543-5561 | crates/buzz-acp/src/lib.rs:5583-5601 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/lib.rs:5543` 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 (19 lines × 2) crates/buzz-admin/src/communities.rs:265 — crates/buzz-admin/src/communities.rs:265-283 | crates/buzz-relay/src/handlers/community_provisioning.rs:184-202 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) crates/buzz-relay/src/conformance/mod.rs:277 — crates/buzz-relay/src/conformance/mod.rs:277-295 | crates/buzz-relay/src/conformance/mod.rs:312-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/conformance/mod.rs:277` 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 (19 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:474 — crates/buzz-relay/src/handlers/command_executor.rs:474-492 | crates/buzz-relay/src/handlers/command_executor.rs:605-623 — both copies are in the same file, so extract the 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 (19 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:1543 — crates/buzz-relay/src/handlers/ingest.rs:1543-1561 | crates/buzz-relay/src/handlers/side_effects.rs:3777-3795 — 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 42 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 `crates/buzz-relay/src/handlers/ingest.rs:1543` 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 (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:245-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/side_effects.rs:137` 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 (19 lines × 2) desktop/src-tauri/src/commands/project_git.rs:274 — desktop/src-tauri/src/commands/project_git.rs:274-292 | desktop/src-tauri/src/commands/project_git.rs:344-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) desktop/src-tauri/src/migration.rs:900 — desktop/src-tauri/src/migration.rs:900-918 | desktop/src-tauri/src/migration.rs:966-984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/migration.rs:900` 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 (19 lines × 2) crates/buzz-cli/src/commands/agents.rs:27 — crates/buzz-cli/src/commands/agents.rs:27-45 | crates/buzz-cli/src/commands/agents.rs:70-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/agents.rs:27` 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 (19 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:230 — crates/buzz-db/src/store/relay_admin_actions.rs:230-248 | crates/buzz-db/src/store/relay_admin_actions.rs:1291-1309 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/relay_admin_actions.rs:230` 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 (19 lines × 2) mobile/lib/hosted_app_gate.dart:93 — mobile/lib/hosted_app_gate.dart:93-111 | mobile/lib/hosted_app_gate.dart:150-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
X2 · Cancellation propagation · Async function without AbortSignal · ×11
  • Async function without AbortSignal: resolveBuzzDownloadUrlForPlatform web/src/shared/lib/buzz-download.ts:159 — `resolveBuzzDownloadUrlForPlatform` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: ensureClone web/src/features/repos/git-client.ts:68 — `ensureClone` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: acceptPolicy web/src/features/invite/ui/InvitePage.tsx:101 — `acceptPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: setupLogo previews/invite-video/preview.js:19 — `setupLogo` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getJoinPolicy desktop/src/shared/api/invites.ts:131 — `getJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: acceptJoinPolicy desktop/src/shared/api/invites.ts:170 — `acceptJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: moderationGet desktop/src/shared/api/moderation.ts:237 — `moderationGet` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: tick desktop/src/features/sidebar/lib/useStaleReaderRecovery.ts:89 — `tick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchAvatarDataUrl desktop/src/features/profile/lib/selfProfileStorage.ts:378 — `fetchAvatarDataUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: doRequest admin-web/src/api.ts:94 — `doRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: probeAuthMode admin-web/src/api.ts:157 — `probeAuthMode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
AC6 · Visual & motion safety · Focus outline removed inline · ×10
  • Focus outline removed inline desktop/src/features/agents/ui/PersonaModelCombobox.tsx:159 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/communities/ui/CommunitySwitcher.tsx:410 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/projects/ui/ProjectsSectionSearch.tsx:104 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/search/ui/SearchScopeControls.tsx:74 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/sidebar/ui/CommunityRail.tsx:123 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/sidebar/ui/CommunityRail.tsx:417 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/sidebar/ui/SidebarProfileCard.tsx:113 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/sidebar/ui/SidebarProfileCard.tsx:191 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/sidebar/ui/SidebarProfileCard.tsx:211 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline desktop/src/features/user-status/ui/SetStatusDialog.tsx:407 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
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:757 — 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:525 — 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:308 — 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:886 — 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:431 — 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:682 — 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:615 — 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:835 — 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_core · ×10
  • buzz_core::filter::filter_match_one (cognitive 40) crates/buzz-core/src/filter.rs:108 — buzz_core::filter::filter_match_one has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 4, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_core::artifact::validate (cognitive 34) crates/buzz-core/src/artifact.rs:80 — buzz_core::artifact::validate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_core::media::reference_hashes (cognitive 34) crates/buzz-core/src/media.rs:91 — buzz_core::media::reference_hashes has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (10 pts), match/switch 1 (2 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.
  • 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::artifact::parse_predicates (cognitive 20) crates/buzz-core/src/artifact.rs:369 — buzz_core::artifact::parse_predicates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_core::pairing::qr::decode_qr (cognitive 20) crates/buzz-core/src/pairing/qr.rs:104 — buzz_core::pairing::qr::decode_qr has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3 (6 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • buzz_core::git_perms::parse_protection_tag_with_warnings (cognitive 19) crates/buzz-core/src/git_perms.rs:327 — buzz_core::git_perms::parse_protection_tag_with_warnings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_core::channel::decide_member_put (cognitive 17) crates/buzz-core/src/channel.rs:312 — buzz_core::channel::decide_member_put has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • buzz_core::private_managed_agent::validate_envelope (cognitive 16) crates/buzz-core/src/private_managed_agent.rs:262 — buzz_core::private_managed_agent::validate_envelope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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::rg::walk (cognitive 33) crates/buzz-dev-mcp/src/rg.rs:345 — buzz_dev_mcp::rg::walk has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 3 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_dev_mcp::shell::run (cognitive 33) crates/buzz-dev-mcp/src/shell.rs:134 — buzz_dev_mcp::shell::run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 10 (15 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_dev_mcp::view_image::gif_has_two_image_descriptors (cognitive 26) crates/buzz-dev-mcp/src/view_image.rs:445 — buzz_dev_mcp::view_image::gif_has_two_image_descriptors has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_dev_mcp::rg::fallback (cognitive 22) crates/buzz-dev-mcp/src/rg.rs:168 — buzz_dev_mcp::rg::fallback has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_dev_mcp::view_image::fetch_url (cognitive 20) crates/buzz-dev-mcp/src/view_image.rs:321 — buzz_dev_mcp::view_image::fetch_url has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_dev_mcp::paths::msys_to_windows (cognitive 18) crates/buzz-dev-mcp/src/paths.rs:157 — buzz_dev_mcp::paths::msys_to_windows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_dev_mcp::shell::resolve_bash (cognitive 17) crates/buzz-dev-mcp/src/shell.rs:406 — buzz_dev_mcp::shell::resolve_bash has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_dev_mcp::shell::read_capped (cognitive 16) crates/buzz-dev-mcp/src/shell.rs:863 — buzz_dev_mcp::shell::read_capped has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFields · ×10
  • TooManyFields: Config crates/buzz-relay/src/config.rs:118 — TooManyFields — 75 stored fields beside 1 method. The bar is 30 stored fields; this is 45 over it, 2.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: AppState crates/buzz-relay/src/state.rs:1422 — TooManyFields — 67 stored fields beside 39 methods. The bar is 30 stored fields; this is 37 over it, 2.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ManagedAgentRecord desktop/src-tauri/src/managed_agents/types.rs:247 — TooManyFields — 58 stored fields beside 1 method. The bar is 30 stored fields; this is 28 over it, 1.93× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: CliArgs crates/buzz-acp/src/config.rs:250 — TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Config crates/buzz-acp/src/config.rs:547 — TooManyFields — 45 stored fields beside 3 methods. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ManagedAgentSummary desktop/src-tauri/src/managed_agents/types.rs:535 — TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Config crates/buzz-agent/src/config.rs:544 — TooManyFields — 34 stored fields beside 3 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: KnownAcpRuntime desktop/src-tauri/src/managed_agents/discovery/runtime_metadata.rs:68 — TooManyFields — 33 stored fields beside 1 method. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DeletionRequest REDACTED:289 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AppState desktop/src-tauri/src/app_state.rs:19 — TooManyFields — 32 stored fields beside 14 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×10
  • 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:257-275 | crates/buzz-cli/src/commands/repos.rs:20-31 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-db/src/store/api_token.rs:164 — crates/buzz-db/src/store/api_token.rs:164-215 | crates/buzz-db/src/store/api_token.rs:228-282 | crates/buzz-db/src/store/api_token.rs:397-430 | crates/buzz-db/src/store/api_token.rs:560-591 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-relay/src/handlers/identity_archive.rs:141 — crates/buzz-relay/src/handlers/identity_archive.rs:141-154 | crates/buzz-relay/src/handlers/ingest.rs:2690-3994 | crates/buzz-relay/src/handlers/moderation_commands.rs:132-158 | crates/buzz-relay/src/handlers/relay_admin.rs:233-520 — 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/archive/metric_store.rs:378 — desktop/src-tauri/src/archive/metric_store.rs:378-438 | desktop/src-tauri/src/archive/store.rs:733-767 | desktop/src-tauri/src/archive/store_migrations.rs:140-179 | desktop/src-tauri/src/channel_head_cache.rs:134-172 — 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:250-308 | desktop/src-tauri/src/commands/teams/mod.rs:350-410 | 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/retention.rs:481 — desktop/src-tauri/src/managed_agents/retention.rs:481-507 | desktop/src-tauri/src/managed_agents/retention.rs:574-594 | desktop/src-tauri/src/managed_agents/retention.rs:605-631 | desktop/src-tauri/src/managed_agents/retention/legacy_migration.rs:119-145 — 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:27 — mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:27-88 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:27-92 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:30-95 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:27-88 — 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:485 — mobile/lib/shared/community/community_provider.dart:485-510 | mobile/lib/shared/community/community_provider.dart:575-612 | mobile/lib/shared/community/community_provider.dart:643-686 | mobile/lib/shared/community/community_provider.dart:688-703 — 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/widgets/ios_glass_navigation_action.dart:43 — mobile/lib/shared/widgets/ios_glass_navigation_action.dart:43-107 | mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:39-113 | mobile/lib/shared/widgets/ios_native_segmented_control.dart:35-85 | mobile/lib/shared/widgets/ios_native_skin_tone_control.dart:35-77 — These 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 · Edited copy of a member (6 corresponding lines) · ×10
  • Edited copy of a member (6 corresponding lines) crates/buzz-cli/src/commands/project_channel.rs:74 — crates/buzz-cli/src/commands/project_channel.rs:74-79 | crates/buzz-cli/src/commands/projects.rs:163-168 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mobile/lib/shared/channels/channel_list_snapshot.dart:166 — mobile/lib/shared/channels/channel_list_snapshot.dart:166-172 | mobile/lib/shared/profile/profile_snapshot.dart:136-141 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mobile/ios/NotificationService/NotificationService.swift:132 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:787-792 | mobile/ios/NotificationService/NotificationService.swift:132-137 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) desktop/src-tauri/src/commands/agent_models_env.rs:19 — desktop/src-tauri/src/commands/agent_models_env.rs:19-26 | desktop/src-tauri/src/relay.rs:32-37 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/buzz-cli/src/commands/huddles.rs:213 — crates/buzz-cli/src/commands/huddles.rs:213-218 | desktop/src-tauri/src/commands/workflows.rs:413-418 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/buzz-db/src/error.rs:144 — crates/buzz-db/src/error.rs:144-149 | crates/buzz-search/src/error.rs:18-23 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) desktop/src-tauri/src/huddle/tts_settings.rs:223 — desktop/src-tauri/src/huddle/tts_settings.rs:223-228 | desktop/src-tauri/src/huddle/tts_voice_import.rs:8-13 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/buzz-acp/src/pool.rs:1171 — crates/buzz-acp/src/pool.rs:1171-1176 | desktop/src-tauri/src/native_websocket_batch.rs:54-59 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mobile/ios/Runner/IosNavigationBar.swift:275 — mobile/ios/Runner/IosNavigationBar.swift:275-282 | mobile/ios/Runner/NativeProfileSetup.swift:454-459 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/buzz-db/src/store/partition/maintenance.rs:818 — crates/buzz-db/src/store/partition/maintenance.rs:818-823 | crates/buzz-db/src/store/relay_invite.rs:248-257 — These two members are one piece of code written twice and then edited apart: 6 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 · Duplicated block (8 lines × 3) · ×10
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/issues.rs:515` 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 (8 lines × 3) crates/buzz-relay/src/audio/handler.rs:3784 — crates/buzz-relay/src/audio/handler.rs:3784-3792 | crates/buzz-relay/src/audio/handler.rs:3986-3994 | crates/buzz-relay/src/handlers/event.rs:1244-1251 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/handler.rs:3784` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 3) desktop/src-tauri/src/commands/project_git_workflow.rs:571 — desktop/src-tauri/src/commands/project_git_workflow.rs:571-578 | desktop/src-tauri/src/commands/project_terminal.rs:211-218 | desktop/src-tauri/src/commands/project_terminal.rs:234-241 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/project_git_workflow.rs:571` 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 (8 lines × 3) desktop/src-tauri/src/managed_agents/nest.rs:300 — desktop/src-tauri/src/managed_agents/nest.rs:300-307 | desktop/src-tauri/src/managed_agents/nest.rs:313-320 | desktop/src-tauri/src/managed_agents/nest.rs:340-347 — 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:6259 — crates/buzz-acp/src/lib.rs:6259-6266 | crates/buzz-acp/src/lib.rs:6307-6314 | crates/buzz-acp/src/lib.rs:6382-6389 — 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 `crates/buzz-acp/src/lib.rs:6259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/buzz-db/src/store/community.rs:365 — crates/buzz-db/src/store/community.rs:365-372 | crates/buzz-db/src/store/community_auth.rs:174-181 | crates/buzz-db/src/store/community_auth.rs:299-306 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/community.rs:365` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-db/src/store/community_auth.rs:310` calls `bind`, `to_string` and `crates/buzz-db/src/store/community_auth.rs:183` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) 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_theme_pagination.dart:57-65 | mobile/lib/shared/widgets/ios_native_segmented_control.dart:51-58 — 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/lib/shared/widgets/ios_glass_navigation_action.dart:59` 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.
D1 · Cyclomatic Complexity · buzz_agent · ×9
  • buzz_agent::llm::openrouter_post (cyclomatic 36) crates/buzz-agent/src/llm.rs:2265 — buzz_agent::llm::openrouter_post has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::databricks_label_grammar::generate_databricks_label (cyclomatic 34) crates/buzz-agent/src/databricks_label_grammar.rs:28 — buzz_agent::databricks_label_grammar::generate_databricks_label has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::llm::post (cyclomatic 28) crates/buzz-agent/src/llm.rs:1869 — buzz_agent::llm::post has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::model_capabilities::resolve (cyclomatic 28) crates/buzz-agent/src/model_capabilities.rs:345 — buzz_agent::model_capabilities::resolve has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::catalog::fetch_catalog_page (cyclomatic 23) crates/buzz-agent/src/catalog.rs:514 — buzz_agent::catalog::fetch_catalog_page has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::model_capabilities::validate_manifest (cyclomatic 19) crates/buzz-agent/src/model_capabilities.rs:537 — buzz_agent::model_capabilities::validate_manifest has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::llm::parse_responses (cyclomatic 18) crates/buzz-agent/src/llm.rs:1018 — buzz_agent::llm::parse_responses has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::llm::anthropic_body (cyclomatic 17) crates/buzz-agent/src/llm.rs:573 — buzz_agent::llm::anthropic_body has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_agent::session_new (cyclomatic 16) crates/buzz-agent/src/lib.rs:432 — buzz_agent::session_new has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · buzz_sdk · ×9
  • 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:1153 — buzz_sdk::builders::build_repo_announcement has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_sdk::mentions::extract_at_names (cognitive 30) crates/buzz-sdk/src/mentions.rs:64 — buzz_sdk::mentions::extract_at_names has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_sdk::builders::build_update_channel (cognitive 22) crates/buzz-sdk/src/builders.rs:889 — buzz_sdk::builders::build_update_channel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2, match/switch 1 (2 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.
  • buzz_sdk::builders::validate_project_envelope (cognitive 18) crates/buzz-sdk/src/builders.rs:2490 — 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:358 — 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:1083 — 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:1666 — 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.
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 21) crates/buzz-cli/src/commands/messages.rs:671 — buzz_cli::commands::messages::cmd_send_message has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 4 (7 pts), boolean chains 2, loops 1 (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.
  • buzz_cli::commands::mem::cmd_ls (cognitive 19) crates/buzz-cli/src/commands/mem.rs:230 — buzz_cli::commands::mem::cmd_ls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 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.
  • buzz_cli::commands::projects::cmd_update (cognitive 19) crates/buzz-cli/src/commands/projects.rs:589 — buzz_cli::commands::projects::cmd_update has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_cli::commands::mem::cmd_patch (cognitive 18) crates/buzz-cli/src/commands/mem.rs:570 — buzz_cli::commands::mem::cmd_patch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • buzz_cli::commands::users::search_by_name (cognitive 18) crates/buzz-cli/src/commands/users.rs:289 — buzz_cli::commands::users::search_by_name has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_cli::commands::issues::reduce_assignment_operations (cognitive 17) crates/buzz-cli/src/commands/issues.rs:143 — buzz_cli::commands::issues::reduce_assignment_operations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_cli::commands::notes::cmd_get (cognitive 17) crates/buzz-cli/src/commands/notes.rs:612 — buzz_cli::commands::notes::cmd_get has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_cli::commands::projects::cmd_create (cognitive 16) crates/buzz-cli/src/commands/projects.rs:361 — 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.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×9
  • Edited copy of a member (20 corresponding lines) desktop/src-tauri/src/commands/project_git.rs:628 — desktop/src-tauri/src/commands/project_git.rs:628-657 | desktop/src-tauri/src/commands/project_git_file_content.rs:132-158 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/buzz-admin/src/communities.rs:264 — crates/buzz-admin/src/communities.rs:264-308 | crates/buzz-relay/src/handlers/community_provisioning.rs:183-205 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) mobile/ios/Runner/PushEndpointGrantStore.swift:18 — mobile/ios/Runner/PushEndpointGrantStore.swift:18-37 | mobile/ios/Runner/PushEndpointGrantStore.swift:77-96 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/buzz-relay/src/api/gifs.rs:168 — crates/buzz-relay/src/api/gifs.rs:168-203 | desktop/src-tauri/src/commands/join_policy.rs:61-80 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/buzz-relay/src/audio/room.rs:449 — crates/buzz-relay/src/audio/room.rs:449-468 | crates/buzz-relay/src/audio/room.rs:674-701 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/buzz-relay-mesh/src/gossip.rs:127 — crates/buzz-relay-mesh/src/gossip.rs:127-147 | crates/buzz-relay-mesh/src/membership.rs:371-390 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/buzz-dev-mcp/src/shell.rs:645 — crates/buzz-dev-mcp/src/shell.rs:645-668 | desktop/src-tauri/src/managed_agents/git_bash.rs:302-321 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/buzz-db/src/store/channel_members.rs:1662 — crates/buzz-db/src/store/channel_members.rs:1662-1685 | crates/buzz-db/src/store/channel_members.rs:1843-1862 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/buzz-db/src/store/channel.rs:535 — crates/buzz-db/src/store/channel.rs:535-555 | crates/buzz-db/src/store/channel_members.rs:1976-1995 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×9
  • Duplicated block (18 lines × 2) crates/buzz-cli/src/client.rs:1497 — crates/buzz-cli/src/client.rs:1497-1514 | crates/buzz-cli/src/client.rs:1542-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/client.rs:1497` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/buzz-relay/src/handlers/event.rs:357 — crates/buzz-relay/src/handlers/event.rs:357-374 | crates/buzz-relay/src/handlers/event.rs:440-457 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/event.rs:357` 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 (18 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:3669 — crates/buzz-relay/src/handlers/ingest.rs:3669-3686 | crates/buzz-relay/src/handlers/ingest.rs:3960-3977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) crates/buzz-relay/src/tunnel/directory.rs:357 — crates/buzz-relay/src/tunnel/directory.rs:357-374 | crates/buzz-relay/src/tunnel/directory.rs:400-417 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/tunnel/directory.rs:357` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/tunnel/directory.rs:356` calls `arg` and `crates/buzz-relay/src/tunnel/directory.rs:399` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) desktop/src-tauri/src/managed_agents/discovery.rs:386 — desktop/src-tauri/src/managed_agents/discovery.rs:386-403 | desktop/src-tauri/src/managed_agents/managed_node_paths.rs:84-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (18 lines × 2) desktop/src-tauri/src/commands/project_git.rs:632 — desktop/src-tauri/src/commands/project_git.rs:632-649 | desktop/src-tauri/src/commands/project_git_file_content.rs:136-153 — 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 `desktop/src-tauri/src/commands/project_git.rs:632` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/buzz-db/src/store/channel_members.rs:1285 — crates/buzz-db/src/store/channel_members.rs:1285-1302 | crates/buzz-db/src/store/moderation.rs:646-670 — 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 `crates/buzz-db/src/store/channel_members.rs:1285` 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 (18 lines × 2) mobile/lib/features/channels/add_members_sheet.dart:228 — mobile/lib/features/channels/add_members_sheet.dart:228-245 | mobile/lib/features/channels/channels_page/sheets.dart:412-429 — before extracting anything, compare `mobile/lib/features/channels/add_members_sheet.dart` and `mobile/lib/features/channels/channels_page/sheets.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/add_members_sheet.dart:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) mobile/lib/shared/widgets/buzz_sheet_header.dart:130 — mobile/lib/shared/widgets/buzz_sheet_header.dart:130-147 | mobile/lib/shared/widgets/modal_presentation.dart:308-325 — 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 (9–10 lines × 2) · ×9
  • Duplicated block (9–10 lines × 2) crates/buzz-acp/src/filter.rs:283 — crates/buzz-acp/src/filter.rs:283-292 | crates/buzz-workflow/src/executor.rs:254-262 — before extracting anything, compare `crates/buzz-acp/src/filter.rs` and `crates/buzz-workflow/src/executor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9–10 lines × 2) crates/buzz-acp/src/filter.rs:295 — crates/buzz-acp/src/filter.rs:295-304 | crates/buzz-workflow/src/executor.rs:265-273 — before extracting anything, compare `crates/buzz-acp/src/filter.rs` and `crates/buzz-workflow/src/executor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9–10 lines × 2) crates/buzz-db/src/store/nip_fi_binding.rs:76 — crates/buzz-db/src/store/nip_fi_binding.rs:76-85 | crates/buzz-db/src/store/nip_fi_binding.rs:113-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) crates/buzz-relay/src/handlers/event.rs:1110 — crates/buzz-relay/src/handlers/event.rs:1110-1119 | crates/buzz-relay/src/handlers/event.rs:1473-1481 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/event.rs:1110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/handlers/event.rs:1099` calls `Some`, `extract_channel_id`, `publish_channel_ephemeral` and `crates/buzz-relay/src/handlers/event.rs:1471` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–10 lines × 2) desktop/src-tauri/src/commands/channel_templates.rs:147 — desktop/src-tauri/src/commands/channel_templates.rs:147-155 | desktop/src-tauri/src/commands/channel_templates.rs:173-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media_transcode.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) desktop/src-tauri/src/commands/project_git_diff.rs:419 — desktop/src-tauri/src/commands/project_git_diff.rs:419-427 | desktop/src-tauri/src/commands/project_git_workflow.rs:544-553 — 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 `desktop/src-tauri/src/commands/project_git_diff.rs:419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) desktop/src-tauri/src/huddle/commands.rs:59 — desktop/src-tauri/src/huddle/commands.rs:59-67 | desktop/src-tauri/src/huddle/commands.rs:157-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.
  • Duplicated block (9–10 lines × 2) mobile/lib/features/channels/add_members_sheet.dart:217 — mobile/lib/features/channels/add_members_sheet.dart:217-226 | mobile/lib/features/channels/channels_page/sheets.dart:400-408 — before extracting anything, compare `mobile/lib/features/channels/add_members_sheet.dart` and `mobile/lib/features/channels/channels_page/sheets.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/add_members_sheet.dart:217` 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 × 3) · ×9
  • Duplicated block (5 lines × 3) crates/buzz-cli/src/commands/mem.rs:397 — crates/buzz-cli/src/commands/mem.rs:397-401 | crates/buzz-cli/src/commands/mem.rs:721-725 | crates/buzz-cli/src/commands/mem.rs:756-760 — 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:1351 — crates/buzz-sdk/src/builders.rs:1351-1355 | crates/buzz-sdk/src/builders.rs:1804-1808 | crates/buzz-sdk/src/builders.rs:1883-1887 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `meta` to `&GitPatchMeta` in one and `&GitPullRequestMeta` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-ws-client/src/message.rs:92` calls `to_string`, `get`, `and_then` and `crates/buzz-ws-client/src/message.rs:122` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) desktop/src-tauri/src/archive/metric_store.rs:402 — desktop/src-tauri/src/archive/metric_store.rs:402-406 | desktop/src-tauri/src/archive/store_migrations.rs:153-157 | desktop/src-tauri/src/channel_head_cache.rs:145-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/archive/metric_store.rs:402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `ProjectPullRequestReviewRequestInput` in one and `ProjectIssueAssigneeOperationInput` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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 6 separate duplicated blocks between them, totalling at least 51 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 `desktop/src-tauri/src/persona_catalog.rs:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) 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:154-161 — 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-db/src/store/relay_invite.rs:127 — crates/buzz-db/src/store/relay_invite.rs:127-132 | crates/buzz-media/src/bucket_index.rs:76-80 | crates/buzz-push-gateway/src/http.rs:71-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere 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 (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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×8
  • Edited copy of a member (30 corresponding lines) desktop/src-tauri/src/commands/project_git_workflow.rs:245 — desktop/src-tauri/src/commands/project_git_workflow.rs:245-276 | desktop/src-tauri/src/commands/project_git_workflow.rs:285-314 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) desktop/src-tauri/src/commands/personas/sharing.rs:35 — desktop/src-tauri/src/commands/personas/sharing.rs:35-64 | desktop/src-tauri/src/commands/teams/sharing.rs:51-81 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) desktop/src-tauri/src/managed_agents/runtime/process.rs:316 — desktop/src-tauri/src/managed_agents/runtime/process.rs:316-346 | desktop/src-tauri/src/managed_agents/runtime/process.rs:351-380 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) mobile/lib/features/channels/composer_dock_size_reporter.dart:18 — mobile/lib/features/channels/composer_dock_size_reporter.dart:18-49 | mobile/lib/features/channels/thread_detail_page/head_layout.dart:10-39 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/buzz-relay/src/api/bridge.rs:3289 — crates/buzz-relay/src/api/bridge.rs:3289-3323 | crates/buzz-relay/src/api/bridge.rs:3331-3360 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/buzz-relay/src/api/operator.rs:209 — crates/buzz-relay/src/api/operator.rs:209-243 | crates/buzz-relay/src/api/operator.rs:254-283 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/buzz-db/src/store/thread.rs:522 — crates/buzz-db/src/store/thread.rs:522-551 | crates/buzz-db/src/store/thread.rs:1024-1062 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) REDACTED:2147 — REDACTED:2147-2176 | REDACTED:2262-2296 — These two members are one piece of code written twice and then edited apart: 30 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 · Duplicated block (7 lines × 3) · ×8
  • Duplicated block (7 lines × 3) crates/buzz-admin/src/communities.rs:275 — crates/buzz-admin/src/communities.rs:275-281 | crates/buzz-relay/src/handlers/community_provisioning.rs:110-120 | crates/buzz-relay/src/handlers/community_provisioning.rs:194-200 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-admin/src/communities.rs:275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-admin/src/communities.rs:283` calls `normalize_host` and `crates/buzz-relay/src/handlers/community_provisioning.rs:125` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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-cli/src/commands/users.rs:474 — crates/buzz-cli/src/commands/users.rs:474-480 | crates/buzz-cli/src/commands/workflows.rs:18-24 | crates/buzz-cli/src/commands/workflows.rs:77-83 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/users.rs:474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-cli/src/commands/users.rs:481` calls `presence_subject` and `crates/buzz-cli/src/commands/workflows.rs:84` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) desktop/src-tauri/src/commands/admin/mod.rs:553 — desktop/src-tauri/src/commands/admin/mod.rs:553-559 | desktop/src-tauri/src/commands/admin/mod.rs:580-586 | desktop/src-tauri/src/commands/admin/mod.rs:607-613 — 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 `desktop/src-tauri/src/commands/admin/mod.rs:553` 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 (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/commands/link_preview_cancellation.rs:39 — desktop/src-tauri/src/commands/link_preview_cancellation.rs:39-45 | desktop/src-tauri/src/commands/media_fetch_cancellation.rs:45-51 | desktop/src-tauri/src/commands/media_upload_progress.rs:39-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) desktop/src-tauri/src/archive/store_migrations.rs:117 — desktop/src-tauri/src/archive/store_migrations.rs:117-124 | desktop/src-tauri/src/archive/store_migrations.rs:240-247 | desktop/src-tauri/src/archive/store_migrations.rs:317-323 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/archive/store_migrations.rs:117` 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) crates/buzz-acp/src/pool.rs:2002 — crates/buzz-acp/src/pool.rs:2002-2008 | crates/buzz-acp/src/pool.rs:2090-2096 | crates/buzz-acp/src/pool.rs:2195-2201 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/pool.rs:2002` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-acp/src/pool.rs:1998` calls `Ok`, `Applied` and `crates/buzz-acp/src/pool.rs:2191` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D1 · Cyclomatic Complexity · buzz_core · ×7
  • buzz_core::network::is_not_global_unicast (cyclomatic 27) crates/buzz-core/src/network.rs:50 — buzz_core::network::is_not_global_unicast has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • buzz_core::artifact::validate (cyclomatic 25) crates/buzz-core/src/artifact.rs:80 — buzz_core::artifact::validate has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_core::filter::filter_match_one (cyclomatic 23) crates/buzz-core/src/filter.rs:108 — buzz_core::filter::filter_match_one 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_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::pairing::qr::decode_qr (cyclomatic 18) crates/buzz-core/src/pairing/qr.rs:104 — buzz_core::pairing::qr::decode_qr has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_core::channel::decide_member_put (cyclomatic 17) crates/buzz-core/src/channel.rs:312 — buzz_core::channel::decide_member_put has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • buzz_core::media::reference_hashes (cyclomatic 17) crates/buzz-core/src/media.rs:91 — buzz_core::media::reference_hashes 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.
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
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: channel_detail_page.dart → members_sheet.dart, thread_message.dart, forum_thread_page.dart mobile/lib/features/channels/channel_detail_page.dart — `mobile/lib/features/channels/channel_detail_page.dart` changes together with 3 other files — `mobile/lib/features/channels/members_sheet.dart`, `mobile/lib/features/channels/thread_detail_page/thread_message.dart`, `mobile/lib/features/forum/forum_thread_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, desktop.ts, ProfilePopover.tsx, TopbarSearch.tsx, SettingsView.tsx, SidebarProfileCard.tsx, kinds.ts, ViewLoadingFallback.tsx desktop/src/app/AppShell.tsx — `desktop/src/app/AppShell.tsx` changes together with 10 other files — `desktop/src/features/channels/ui/ChannelBrowserDialog.tsx`, `desktop/src/features/chat/ui/ChatHeader.tsx`, `desktop/src/features/messages/types.ts`, `desktop/src/features/notifications/lib/desktop.ts`, `desktop/src/features/profile/ui/ProfilePopover.tsx`, `desktop/src/features/search/ui/TopbarSearch.tsx`, `desktop/src/features/settings/ui/SettingsView.tsx`, `desktop/src/features/sidebar/ui/SidebarProfileCard.tsx`, `desktop/src/shared/constants/kinds.ts`, `desktop/src/shared/ui/ViewLoadingFallback.tsx` — none of which declares a dependency on it: one file is the hub of 10 separate couplings, not 10 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 10.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×7
  • Edited copy of a member (29 corresponding lines) crates/buzz-cli/src/commands/feed.rs:16 — crates/buzz-cli/src/commands/feed.rs:16-48 | crates/buzz-cli/src/commands/messages.rs:340-368 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/buzz-cli/src/commands/patches.rs:24 — crates/buzz-cli/src/commands/patches.rs:24-57 | crates/buzz-cli/src/commands/pr.rs:86-114 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/buzz-relay/src/handlers/moderation_commands.rs:267 — crates/buzz-relay/src/handlers/moderation_commands.rs:267-295 | crates/buzz-relay/src/handlers/moderation_commands.rs:374-402 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) mobile/lib/shared/read_state/read_state_storage.dart:184 — mobile/lib/shared/read_state/read_state_storage.dart:184-214 | mobile/lib/shared/read_state/read_state_storage.dart:242-270 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/buzz-relay/src/api/operator.rs:761 — crates/buzz-relay/src/api/operator.rs:761-789 | crates/buzz-relay/src/api/operator.rs:798-835 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/buzz-relay/src/api/admin/mod.rs:1283 — crates/buzz-relay/src/api/admin/mod.rs:1283-1311 | crates/buzz-relay/src/api/admin/mod.rs:1326-1354 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/buzz-db/src/store/workflow.rs:336 — crates/buzz-db/src/store/workflow.rs:336-364 | crates/buzz-db/src/store/workflow.rs:919-948 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×7
  • Edited copy of a member (21 corresponding lines) crates/buzz-relay/src/api/git/store.rs:282 — crates/buzz-relay/src/api/git/store.rs:282-302 | crates/buzz-relay/src/api/git/store.rs:317-339 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/buzz-db/src/store/user.rs:425 — crates/buzz-db/src/store/user.rs:425-445 | crates/buzz-db/src/store/user.rs:456-481 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/buzz-db/src/store/workflow.rs:1312 — crates/buzz-db/src/store/workflow.rs:1312-1336 | crates/buzz-db/src/store/workflow.rs:1367-1387 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) desktop/src-tauri/src/commands/export_util.rs:11 — desktop/src-tauri/src/commands/export_util.rs:11-31 | desktop/src-tauri/src/commands/media.rs:667-689 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/buzz-db/src/store/channel.rs:580 — crates/buzz-db/src/store/channel.rs:580-600 | crates/buzz-db/src/store/dm.rs:410-438 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) desktop/src-tauri/src/archive/agent_usage.rs:372 — desktop/src-tauri/src/archive/agent_usage.rs:372-393 | desktop/src-tauri/src/archive/agent_usage.rs:418-438 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) desktop/src-tauri/src/managed_agents/personas.rs:293 — desktop/src-tauri/src/managed_agents/personas.rs:293-313 | desktop/src-tauri/src/managed_agents/personas.rs:320-340 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×7
  • Edited copy of a member (23 corresponding lines) REDACTED:1522 — REDACTED:1522-1544 | REDACTED:1800-1829 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/buzz-relay/src/handlers/ingest.rs:1531 — crates/buzz-relay/src/handlers/ingest.rs:1531-1561 | crates/buzz-relay/src/handlers/side_effects.rs:3773-3795 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/buzz-db/src/store/channel_members.rs:1496 — crates/buzz-db/src/store/channel_members.rs:1496-1518 | crates/buzz-db/src/store/event.rs:271-322 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) mobile/lib/shared/theme/app_theme.dart:34 — mobile/lib/shared/theme/app_theme.dart:34-56 | mobile/lib/shared/theme/app_theme.dart:58-83 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) desktop/src-tauri/src/prevent_sleep.rs:72 — desktop/src-tauri/src/prevent_sleep.rs:72-97 | desktop/src-tauri/src/prevent_sleep.rs:169-191 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) mobile/lib/features/pairing/pairing_socket.dart:180 — mobile/lib/features/pairing/pairing_socket.dart:180-202 | mobile/lib/shared/relay/relay_socket.dart:191-218 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) REDACTED:3720 — REDACTED:3720-3742 | REDACTED:3749-3779 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×7
  • Edited copy of a member (17 corresponding lines) crates/buzz-acp/src/pool.rs:2292 — crates/buzz-acp/src/pool.rs:2292-2308 | crates/buzz-acp/src/pool.rs:2332-2348 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mobile/lib/shared/huddle/huddle_session.dart:356 — mobile/lib/shared/huddle/huddle_session.dart:356-372 | mobile/lib/shared/huddle/huddle_session.dart:374-392 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/buzz-voice/src/pocket.rs:140 — crates/buzz-voice/src/pocket.rs:140-156 | crates/buzz-voice/src/pocket.rs:169-186 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) desktop/src-tauri/src/archive/mod.rs:453 — desktop/src-tauri/src/archive/mod.rs:453-470 | desktop/src-tauri/src/archive/mod.rs:491-507 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mobile/lib/features/channels/channel_management_actions.dart:454 — mobile/lib/features/channels/channel_management_actions.dart:454-472 | mobile/lib/features/channels/channel_management_actions.dart:474-490 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) desktop/src-tauri/src/commands/agent_auth.rs:398 — desktop/src-tauri/src/commands/agent_auth.rs:398-414 | desktop/src-tauri/src/commands/project_terminal.rs:73-92 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mobile/lib/shared/widgets/concentric_sheet_surface.dart:83 — mobile/lib/shared/widgets/concentric_sheet_surface.dart:83-99 | mobile/lib/shared/widgets/concentric_sheet_surface.dart:101-117 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×7
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/issues.rs:582` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/buzz-cli/src/commands/mem.rs:92 — crates/buzz-cli/src/commands/mem.rs:92-100 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/mem.rs:92` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) desktop/src-tauri/src/commands/agents.rs:273 — desktop/src-tauri/src/commands/agents.rs:273-281 | desktop/src-tauri/src/managed_agents/restore.rs:451-459 | desktop/src-tauri/src/shutdown.rs:140-148 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `desktop/src-tauri/src/commands/agents.rs:272` calls `admit`, `as_str` and `desktop/src-tauri/src/shutdown.rs:139` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) desktop/src-tauri/src/managed_agents/runtime_commands.rs:151 — desktop/src-tauri/src/managed_agents/runtime_commands.rs:151-159 | desktop/src-tauri/src/managed_agents/runtime_commands.rs:343-351 | desktop/src-tauri/src/shutdown.rs:135-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/managed_agents/runtime_commands.rs:353` calls `find_managed_agent_mut` and `desktop/src-tauri/src/managed_agents/runtime_commands.rs:161` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) crates/buzz-acp/src/acp.rs:2520 — crates/buzz-acp/src/acp.rs:2520-2528 | crates/buzz-agent/src/mcp.rs:1040-1048 | crates/buzz-dev-mcp/src/lib.rs:203-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `cmd` to `&mut tokio::process::Command` in one and `&mut Command` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/migration.rs:494` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:250 — mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:250-258 | mobile/ios/Runner/NativeEmojiPicker.swift:169-177 | mobile/ios/Runner/NativeProfileTextEditor.swift:246-254 — 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_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:525 — 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:757 — 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:682 — buzz_media::validation::validate_webp_metadata_free has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: buzz_media::validation::file_mime_to_ext (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • buzz_media::upload::process_video_upload (cyclomatic 16) crates/buzz-media/src/upload.rs:292 — buzz_media::upload::process_video_upload has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_media::validation::validate_video_file (cyclomatic 16) crates/buzz-media/src/validation.rs:308 — 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.
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.
D30 · Dependency Vulnerabilities · Medium CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×6
  • Edited copy of a member (49 corresponding lines) desktop/src-tauri/src/commands/media_animated.rs:103 — desktop/src-tauri/src/commands/media_animated.rs:103-151 | desktop/src-tauri/src/commands/media_animated.rs:212-264 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) desktop/src-tauri/src/commands/personas/snapshot/import.rs:831 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:831-879 | desktop/src-tauri/src/commands/team_snapshot.rs:926-974 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) crates/buzz-ws-client/src/connection.rs:266 — crates/buzz-ws-client/src/connection.rs:266-321 | crates/buzz-ws-client/src/connection.rs:327-375 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) desktop/src-tauri/src/commands/identity.rs:392 — desktop/src-tauri/src/commands/identity.rs:392-440 | desktop/src-tauri/src/commands/identity.rs:520-573 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) crates/buzz-push-gateway/src/http.rs:462 — crates/buzz-push-gateway/src/http.rs:462-521 | crates/buzz-push-gateway/src/http.rs:584-632 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) desktop/src-tauri/src/commands/admin/helpers.rs:339 — desktop/src-tauri/src/commands/admin/helpers.rs:339-391 | desktop/src-tauri/src/commands/admin/reads.rs:40-88 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×6
  • Edited copy of a member (26 corresponding lines) crates/buzz-relay/src/invite_token.rs:181 — crates/buzz-relay/src/invite_token.rs:181-212 | crates/buzz-relay/src/invite_token.rs:385-410 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/buzz-db/src/store/feed.rs:92 — crates/buzz-db/src/store/feed.rs:92-120 | crates/buzz-db/src/store/feed.rs:182-207 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) desktop/src-tauri/src/managed_agents/agent_snapshot.rs:403 — desktop/src-tauri/src/managed_agents/agent_snapshot.rs:403-435 | desktop/src-tauri/src/managed_agents/team_snapshot.rs:196-221 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/buzz-relay/src/api/bridge.rs:247 — crates/buzz-relay/src/api/bridge.rs:247-275 | crates/buzz-relay/src/api/gifs.rs:141-166 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/buzz-db/src/store/relay_members.rs:318 — crates/buzz-db/src/store/relay_members.rs:318-343 | crates/buzz-db/src/store/relay_members.rs:363-398 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/buzz-relay/src/api/bridge.rs:1684 — crates/buzz-relay/src/api/bridge.rs:1684-1709 | crates/buzz-relay/src/api/bridge.rs:2382-2407 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×6
  • Edited copy of a member (24 corresponding lines) docs/formal/nip-rs-unread/model.py:299 — docs/formal/nip-rs-unread/model.py:299-345 | docs/formal/nip-rs-unread/mutation.py:429-452 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/buzz-relay/src/connection.rs:265 — crates/buzz-relay/src/connection.rs:265-288 | crates/buzz-relay/src/state.rs:1339-1366 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:711 — mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:711-734 | mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:778-807 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/buzz-db/src/store/channel_members.rs:1890 — crates/buzz-db/src/store/channel_members.rs:1890-1950 | crates/buzz-db/src/store/push.rs:1034-1057 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/buzz-cli/src/commands/messages.rs:922 — crates/buzz-cli/src/commands/messages.rs:922-945 | crates/buzz-cli/src/commands/messages.rs:952-976 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/buzz-db/src/store/community.rs:426 — crates/buzz-db/src/store/community.rs:426-451 | crates/buzz-db/src/store/community.rs:950-973 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×6
  • Edited copy of a member (28 corresponding lines) desktop/src-tauri/src/commands/messages.rs:252 — desktop/src-tauri/src/commands/messages.rs:252-289 | desktop/src-tauri/src/commands/messages.rs:370-397 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/buzz-media/src/storage.rs:220 — crates/buzz-media/src/storage.rs:220-256 | crates/buzz-relay/src/api/git/store.rs:214-241 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/buzz-voice/src/pocket_april.rs:734 — crates/buzz-voice/src/pocket_april.rs:734-761 | crates/buzz-voice/src/pocket_april.rs:783-818 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/buzz-deletion/src/lib.rs:1702 — crates/buzz-deletion/src/lib.rs:1702-1729 | crates/buzz-relay-mesh/src/registry.rs:313-343 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/buzz-media/src/bucket_index.rs:378 — crates/buzz-media/src/bucket_index.rs:378-405 | crates/buzz-media/src/bucket_index.rs:843-872 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/buzz-db/src/store/reminder.rs:166 — crates/buzz-db/src/store/reminder.rs:166-193 | crates/buzz-db/src/store/workflow.rs:647-677 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/buzz-acp/src/relay.rs:508 — crates/buzz-acp/src/relay.rs:508-515 | crates/buzz-acp/src/relay.rs:521-528 | crates/buzz-acp/src/relay.rs:579-586 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/buzz-cli/src/commands/messages.rs:278 — crates/buzz-cli/src/commands/messages.rs:278-289 | crates/buzz-cli/src/commands/repos.rs:33-44 | crates/buzz-db/src/store/verified_profiles.rs:216-223 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) mobile/lib/shared/community/community_provider.dart:207 — mobile/lib/shared/community/community_provider.dart:207-214 | mobile/lib/shared/community/community_provider.dart:260-267 | mobile/lib/shared/push/push_lease_revocation_outbox.dart:255-262 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/buzz-cli/src/commands/agents.rs:399 — crates/buzz-cli/src/commands/agents.rs:399-406 | crates/buzz-cli/src/links.rs:97-104 | crates/buzz-cli/src/validate.rs:29-36 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/buzz-db/src/store/dm.rs:71 — crates/buzz-db/src/store/dm.rs:71-94 | crates/buzz-db/src/store/moderation.rs:272-288 | crates/buzz-db/src/store/relay_members.rs:47-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/buzz-db/src/store/event.rs:1529 — crates/buzz-db/src/store/event.rs:1529-1536 | crates/buzz-db/src/store/feed.rs:299-306 | crates/buzz-db/src/store/thread.rs:572-588 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×6
  • Duplicated block (15–16 lines × 2) crates/buzz-agent/src/llm.rs:1893 — crates/buzz-agent/src/llm.rs:1893-1908 | crates/buzz-agent/src/llm.rs:2288-2302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-agent/src/llm.rs:1893` 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 (15–16 lines × 2) desktop/src-tauri/src/commands/agents.rs:1158 — desktop/src-tauri/src/commands/agents.rs:1158-1173 | desktop/src-tauri/src/commands/personas/mod.rs:189-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15–16 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:723 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:723-737 | 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 139 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/personas/snapshot/import.rs:723` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:129` 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 (15–16 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:239 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:239-253 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:206-221 — 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 6 separate duplicated blocks between them, totalling at least 172 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_bubble.dart:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–16 lines × 2) mobile/lib/features/channels/channels_page/channel_tile.dart:159 — mobile/lib/features/channels/channels_page/channel_tile.dart:159-173 | mobile/lib/features/search/search_page.dart:645-660 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/search/search_page.dart:645` 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. 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×6
  • Duplicated block (13–14 lines × 2) crates/buzz-acp/src/relay.rs:2379 — crates/buzz-acp/src/relay.rs:2379-2391 | crates/buzz-acp/src/relay.rs:2418-2431 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/relay.rs:2379` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) crates/buzz-db/src/store/moderation.rs:451 — crates/buzz-db/src/store/moderation.rs:451-464 | crates/buzz-db/src/store/moderation.rs:507-519 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/moderation.rs:451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) crates/buzz-relay/src/connection.rs:1468 — crates/buzz-relay/src/connection.rs:1468-1481 | crates/buzz-relay/src/connection.rs:1523-1535 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/connection.rs:1468` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) desktop/src-tauri/src/managed_agents/runtime_commands.rs:562 — desktop/src-tauri/src/managed_agents/runtime_commands.rs:562-574 | desktop/src-tauri/src/managed_agents/runtime_commands.rs:587-600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) mobile/lib/features/agents/agent_avatar_choices.dart:155 — mobile/lib/features/agents/agent_avatar_choices.dart:155-167 | mobile/lib/features/agents/agent_avatar_choices.dart:206-219 — both copies are in the same file, so extract the 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/lib/features/agents/agent_avatar_choices.dart:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) mobile/lib/features/channels/channel_detail_page/app_bar.dart:99 — mobile/lib/features/channels/channel_detail_page/app_bar.dart:99-111 | mobile/lib/features/channels/channel_detail_page/app_bar.dart:155-168 — both copies are in the same file, so extract the 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/lib/features/channels/channel_detail_page/app_bar.dart:99` 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–13 lines × 2) · ×6
  • Duplicated block (12–13 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:181 — crates/buzz-db/src/store/relay_admin_actions.rs:181-193 | crates/buzz-db/src/store/workflow.rs:1146-1157 — 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 `crates/buzz-db/src/store/relay_admin_actions.rs:181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) crates/buzz-relay/src/audio/handler.rs:1504 — crates/buzz-relay/src/audio/handler.rs:1504-1516 | crates/buzz-relay/src/audio/handler.rs:1529-1540 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:1504` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12–13 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:1751 — crates/buzz-relay/src/handlers/side_effects.rs:1751-1762 | crates/buzz-relay/src/handlers/side_effects.rs:1808-1820 — both copies are in the same file, so extract the block into 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/relay.rs:583` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `desktop/src-tauri/src/relay.rs:582` calls `timeout`, `from_secs` and `desktop/src-tauri/src/relay.rs:712` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) mobile/lib/features/channels/channels_page/sections.dart:71 — mobile/lib/features/channels/channels_page/sections.dart:71-82 | mobile/lib/features/channels/channels_page/sections.dart:433-445 — both copies are in the same file, so extract the 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/lib/features/channels/channels_page/sections.dart:71` 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 (12–13 lines × 2) mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:49 — mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:49-61 | mobile/lib/shared/widgets/ios_native_skin_tone_control.dart:41-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×6
  • Duplicated block (11 lines × 3) REDACTED:1530 — REDACTED:1530-1540 | REDACTED:1815-1825 | REDACTED:2569-2579 — 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 `REDACTED:1530` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:1541` calls `upsert_executor_heartbeat` and `REDACTED:2580` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) crates/buzz-relay/src/handlers/command_executor.rs:475 — crates/buzz-relay/src/handlers/command_executor.rs:475-485 | crates/buzz-relay/src/handlers/command_executor.rs:606-616 | crates/buzz-relay/src/handlers/command_executor.rs:684-695 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/command_executor.rs:475` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) crates/buzz-db/src/store/community.rs:514 — crates/buzz-db/src/store/community.rs:514-524 | crates/buzz-db/src/store/community.rs:831-842 | crates/buzz-db/src/store/community.rs:890-901 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-db/src/store/community.rs:843` calls `bind` and `crates/buzz-db/src/store/community.rs:525` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:29 — mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:29-39 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:29-39 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:29-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 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) mobile/lib/features/forum/forum_post_card.dart:310 — mobile/lib/features/forum/forum_post_card.dart:310-320 | mobile/lib/features/forum/forum_thread_page.dart:180-190 | mobile/lib/features/forum/forum_thread_page.dart:642-652 — before extracting anything, compare `mobile/lib/features/forum/forum_post_card.dart` and `mobile/lib/features/forum/forum_thread_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/forum/forum_post_card.dart:310` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:82 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:82-92 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:85-95 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:82-92 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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.
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.
D1 · Cyclomatic Complexity · Db · ×5
  • Db::media_access (cyclomatic 23) crates/buzz-db/src/store/media.rs:156 — Db::media_access 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.
  • Db::route_read (cyclomatic 21) crates/buzz-db/src/runtime/mod.rs:1949 — Db::route_read 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.
  • Db::accept_artifact (cyclomatic 19) crates/buzz-db/src/store/artifact.rs:97 — Db::accept_artifact 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.
  • Db::set_community_nip_fi_policy (cyclomatic 18) crates/buzz-db/src/store/community_auth.rs:289 — Db::set_community_nip_fi_policy 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.
  • Db::sidebar (cyclomatic 16) crates/buzz-db/src/store/personal_read/projection.rs:58 — Db::sidebar has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · buzz_sdk · ×5
  • buzz_sdk::builders::build_repo_announcement (cyclomatic 23) crates/buzz-sdk/src/builders.rs:1153 — 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:358 — 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_update_channel (cyclomatic 17) crates/buzz-sdk/src/builders.rs:889 — buzz_sdk::builders::build_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_sdk::builders::build_git_status (cyclomatic 16) crates/buzz-sdk/src/builders.rs:1666 — 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×5
  • Fixed-sleep synchronisation: an orphaned metadata load is cancelled after its re-entry grace period desktop/src/shared/lib/useResolvedLinkPreviews.test.mjs:629 — This test starts work it did not wait for (`rejection`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 1_050))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: hard-caps active work and removes queued work on cancellation desktop/src/features/messages/lib/audioMediaLoadScheduler.test.mjs:32 — This test starts work it did not wait for (`settlements`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: settled work promotes only enough queued work to refill the cap desktop/src/features/messages/lib/audioMediaLoadScheduler.test.mjs:58 — This test starts work it did not wait for (`settlements`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: supported transitions wait for target readiness desktop/src/app/communityViewTransition.test.mjs:51 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: a newer transition releases the previous transition desktop/src/app/communityViewTransition.test.mjs:71 — This test starts work it did not wait for (`first`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D2 · Cognitive Complexity · Db · ×5
  • Db::media_access (cognitive 41) crates/buzz-db/src/store/media.rs:156 — Db::media_access has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 9, 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.
  • Db::sidebar (cognitive 35) crates/buzz-db/src/store/personal_read/projection.rs:58 — Db::sidebar has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Db::route_read (cognitive 23) crates/buzz-db/src/runtime/mod.rs:1949 — Db::route_read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 5 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Db::accept_artifact (cognitive 20) crates/buzz-db/src/store/artifact.rs:97 — Db::accept_artifact has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Db::set_community_nip_fi_policy (cognitive 20) crates/buzz-db/src/store/community_auth.rs:289 — Db::set_community_nip_fi_policy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 15+ corresponding lines) mobile/lib/features/activity/feed_item.dart:30 — mobile/lib/features/activity/feed_item.dart:30-44 | mobile/lib/features/forum/forum_models.dart:28-44 | mobile/lib/features/forum/forum_models.dart:122-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/buzz-voice/src/imported.rs:284 — crates/buzz-voice/src/imported.rs:284-298 | desktop/src-tauri/src/app_state.rs:968-991 | desktop/src-tauri/src/managed_agents/storage.rs:640-659 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/buzz-cli/src/commands/channels.rs:288 — crates/buzz-cli/src/commands/channels.rs:288-304 | crates/buzz-cli/src/commands/channels.rs:314-328 | crates/buzz-cli/src/commands/channels.rs:621-636 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/buzz-db/src/store/channel_members.rs:1249 — crates/buzz-db/src/store/channel_members.rs:1249-1267 | crates/buzz-db/src/store/channel_members.rs:1702-1724 | crates/buzz-db/src/store/community.rs:176-190 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/buzz-db/src/store/channel.rs:2045 — crates/buzz-db/src/store/channel.rs:2045-2059 | crates/buzz-db/src/store/relay_admin_actions.rs:1989-2004 | crates/buzz-db/src/store/thread.rs:883-898 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/buzz-relay/src/handlers/identity_archive.rs:189 — crates/buzz-relay/src/handlers/identity_archive.rs:189-198 | crates/buzz-relay/src/handlers/moderation_commands.rs:618-626 | crates/buzz-relay/src/handlers/relay_admin.rs:50-58 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) desktop/src-tauri/src/commands/admin/mod.rs:508 — desktop/src-tauri/src/commands/admin/mod.rs:508-516 | desktop/src-tauri/src/commands/admin/mod.rs:646-654 | desktop/src-tauri/src/commands/admin/restrictions.rs:53-65 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) desktop/src-tauri/src/commands/bestie.rs:41 — desktop/src-tauri/src/commands/bestie.rs:41-51 | desktop/src-tauri/src/commands/teams/adopt.rs:95-103 | desktop/src-tauri/src/managed_agents/types/team_catalog_source.rs:12-20 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) desktop/src-tauri/src/managed_agents/global_config/mod.rs:201 — desktop/src-tauri/src/managed_agents/global_config/mod.rs:201-210 | desktop/src-tauri/src/managed_agents/teams.rs:205-213 | desktop/src-tauri/src/templates/storage.rs:52-61 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) desktop/src-tauri/src/commands/agent_models.rs:347 — desktop/src-tauri/src/commands/agent_models.rs:347-355 | desktop/src-tauri/src/commands/agent_models_databricks.rs:89-97 | desktop/src-tauri/src/commands/agent_models_openrouter.rs:25-33 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×5
  • Duplicated block (21 lines × 2) crates/buzz-admin/src/communities.rs:311 — crates/buzz-admin/src/communities.rs:311-331 | crates/buzz-relay/src/handlers/community_provisioning.rs:154-174 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) crates/buzz-cli/src/client.rs:983 — crates/buzz-cli/src/client.rs:983-1003 | crates/buzz-cli/src/client.rs:1012-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/client.rs:983` 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 (21 lines × 2) crates/buzz-db/src/store/channel.rs:181 — crates/buzz-db/src/store/channel.rs:181-201 | crates/buzz-db/src/store/channel.rs:243-264 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/channel.rs:181` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-voice/src/pocket_april.rs:513` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) mobile/lib/features/channels/channels_page/body.dart:111 — mobile/lib/features/channels/channels_page/body.dart:111-131 | mobile/lib/features/channels/channels_page/body.dart:134-154 — both copies are in the same file, so extract the 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_cli · ×4
  • buzz_cli::commands::projects::cmd_update (cyclomatic 20) crates/buzz-cli/src/commands/projects.rs:589 — 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::messages::cmd_send_message (cyclomatic 17) crates/buzz-cli/src/commands/messages.rs:671 — buzz_cli::commands::messages::cmd_send_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_cli::commands::mem::cmd_patch (cyclomatic 16) crates/buzz-cli/src/commands/mem.rs:570 — 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.
D10 · Test Quality · Skipped test · ×4
  • Skipped test: (unnamed test) desktop/tests/e2e/agents-everywhere.live.spec.ts:87 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) desktop/tests/e2e/composer-link-shortcut.spec.ts:112 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) desktop/tests/e2e/composer-link-shortcut.spec.ts:133 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) desktop/tests/e2e/relay-restart.live.spec.ts:135 — Skipped — switched off by test.skip
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_deletion · ×4
  • buzz_deletion::enumerate_tenant_prefixes (cognitive 27) crates/buzz-deletion/src/lib.rs:761 — buzz_deletion::enumerate_tenant_prefixes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_deletion::run_loop (cognitive 24) crates/buzz-deletion/src/lib.rs:972 — buzz_deletion::run_loop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_deletion::execute_stage (cognitive 21) crates/buzz-deletion/src/lib.rs:1432 — buzz_deletion::execute_stage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (7 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_deletion::prepare_owner_claim_with (cognitive 20) crates/buzz-deletion/src/lib.rs:1088 — buzz_deletion::prepare_owner_claim_with has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 5 (7 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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::gc::plan (cognitive 19) crates/buzz-backend-kubernetes/src/gc.rs:51 — buzz_backend_kubernetes::gc::plan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_backend_kubernetes::observe::decode_startup (cognitive 19) crates/buzz-backend-kubernetes/src/observe.rs:74 — buzz_backend_kubernetes::observe::decode_startup has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 4 (7 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • buzz_backend_kubernetes::reconcile::try_preflight_gc (cognitive 18) crates/buzz-backend-kubernetes/src/reconcile.rs:162 — buzz_backend_kubernetes::reconcile::try_preflight_gc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×4
  • Edited copy of a member (43 corresponding lines) mobile/ios/Runner/InlinePhotoPicker.swift:127 — mobile/ios/Runner/InlinePhotoPicker.swift:127-169 | mobile/ios/Runner/NativeAttachmentPopover.swift:575-621 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) desktop/src-tauri/src/commands/teams/mod.rs:430 — desktop/src-tauri/src/commands/teams/mod.rs:430-477 | desktop/src-tauri/src/commands/teams/mod.rs:480-522 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) mobile/lib/shared/emoji/emoji_picker/category_rail.dart:92 — mobile/lib/shared/emoji/emoji_picker/category_rail.dart:92-135 | mobile/lib/shared/widgets/emoji_avatar_controls.dart:275-317 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) crates/buzz-deletion/src/lib.rs:197 — crates/buzz-deletion/src/lib.rs:197-239 | crates/buzz-deletion/src/lib.rs:1346-1394 — These two members are one piece of code written twice and then edited apart: 43 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 (32 corresponding lines) · ×4
  • Edited copy of a member (32 corresponding lines) crates/buzz-db/src/store/channel_members.rs:2271 — crates/buzz-db/src/store/channel_members.rs:2271-2302 | crates/buzz-db/src/store/event.rs:1730-1761 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:968 — mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:968-999 | mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:1011-1056 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/buzz-db/src/store/event.rs:351 — crates/buzz-db/src/store/event.rs:351-382 | crates/buzz-db/src/store/event.rs:403-435 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/buzz-db/src/store/user.rs:97 — crates/buzz-db/src/store/user.rs:97-128 | crates/buzz-db/src/store/user.rs:216-249 — These two members are one piece of code written twice and then edited apart: 32 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 (22 corresponding lines) · ×4
  • Edited copy of a member (22 corresponding lines) crates/buzz-db/src/runtime/mod.rs:362 — crates/buzz-db/src/runtime/mod.rs:362-389 | crates/buzz-db/src/store/thread_window.rs:452-473 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/buzz-push-gateway/src/grant.rs:59 — crates/buzz-push-gateway/src/grant.rs:59-80 | crates/buzz-push-gateway/src/token.rs:69-94 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) desktop/src-tauri/src/deep_link.rs:316 — desktop/src-tauri/src/deep_link.rs:316-338 | desktop/src-tauri/src/deep_link.rs:344-365 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mobile/lib/features/channels/channels_page/sections.dart:459 — mobile/lib/features/channels/channels_page/sections.dart:459-483 | mobile/lib/features/channels/message_content.dart:977-998 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 22+ corresponding lines) crates/buzz-cli/src/commands/issues.rs:498 — crates/buzz-cli/src/commands/issues.rs:498-522 | crates/buzz-cli/src/commands/patches.rs:92-113 | crates/buzz-cli/src/commands/pr.rs:134-158 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_storage.dart:76 — mobile/lib/features/channels/channel_mutes/channel_mutes_storage.dart:76-97 | mobile/lib/features/channels/channel_sections/channel_sections_storage.dart:102-123 | mobile/lib/features/channels/channel_stars/channel_stars_storage.dart:76-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) crates/buzz-pubsub/src/cache_invalidation.rs:112 — crates/buzz-pubsub/src/cache_invalidation.rs:112-135 | crates/buzz-pubsub/src/conn_control.rs:163-184 | crates/buzz-pubsub/src/conn_control.rs:243-264 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) crates/buzz-db/src/store/channel.rs:718 — crates/buzz-db/src/store/channel.rs:718-743 | crates/buzz-db/src/store/nip_fi_binding.rs:310-331 | crates/buzz-db/src/store/nip_fi_binding.rs:388-411 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/buzz-relay/src/handlers/moderation_commands.rs:571 — crates/buzz-relay/src/handlers/moderation_commands.rs:571-583 | crates/buzz-relay/src/handlers/moderation_commands.rs:586-598 | crates/buzz-relay/src/handlers/relay_admin.rs:34-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) desktop/src-tauri/src/events/message_tags.rs:74 — desktop/src-tauri/src/events/message_tags.rs:74-86 | desktop/src-tauri/src/events/message_tags.rs:91-103 | desktop/src-tauri/src/events/message_tags.rs:108-123 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/buzz-relay/src/membership_cache.rs:330 — crates/buzz-relay/src/membership_cache.rs:330-342 | crates/buzz-relay/src/state.rs:2177-2192 | crates/buzz-relay/src/state.rs:2223-2236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) desktop/src-tauri/src/migration/backfill.rs:34 — desktop/src-tauri/src/migration/backfill.rs:34-47 | desktop/src-tauri/src/migration/fold.rs:22-35 | desktop/src-tauri/src/migration/team_suffix.rs:48-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×4
  • Edited copy of a member (5 corresponding lines) crates/buzz-sdk/src/builders.rs:527 — crates/buzz-sdk/src/builders.rs:527-537 | crates/buzz-sdk/src/builders.rs:2000-2004 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) mobile/ios/Runner/NativePhotoZoomCoordinator.swift:532 — mobile/ios/Runner/NativePhotoZoomCoordinator.swift:532-536 | mobile/ios/Runner/NativeAttachmentPopover.swift:897-905 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) docs/formal/nip-rs-unread/model.py:211 — docs/formal/nip-rs-unread/model.py:211-215 | docs/formal/nip-rs-unread/mutation.py:115-119 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/buzz-cli/src/commands/dms.rs:25 — crates/buzz-cli/src/commands/dms.rs:25-29 | crates/buzz-cli/src/commands/users.rs:721-725 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×4
  • Duplicated block (22 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:2298 — crates/buzz-relay/src/handlers/side_effects.rs:2298-2319 | crates/buzz-relay/src/handlers/side_effects.rs:3300-3321 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/side_effects.rs:2298` 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 lines × 2) crates/buzz-db/src/store/event.rs:354 — crates/buzz-db/src/store/event.rs:354-375 | crates/buzz-db/src/store/event.rs:406-428 — both copies are in the same file, so extract the block into 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:99 — mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:99-120 | mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:198-219 — both copies are in the same file, so extract the 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/lib/features/channels/agent_activity/transcript_item_widget.dart:99` 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 (22 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:99 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:99-120 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:73-94 — 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 6 separate duplicated blocks between them, totalling at least 172 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_bubble.dart:99` 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 (19–21 lines × 2) · ×4
  • Duplicated block (19–21 lines × 2) crates/buzz-acp/src/queue.rs:740 — crates/buzz-acp/src/queue.rs:740-760 | crates/buzz-acp/src/queue.rs:805-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/queue.rs:740` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–21 lines × 2) crates/buzz-relay/src/audio/room.rs:390 — crates/buzz-relay/src/audio/room.rs:390-410 | crates/buzz-relay/src/audio/room.rs:573-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19–21 lines × 2) desktop/src-tauri/src/huddle/tts.rs:542 — desktop/src-tauri/src/huddle/tts.rs:542-562 | desktop/src-tauri/src/huddle/tts.rs:607-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (19–21 lines × 2) crates/buzz-db/src/store/api_token.rs:28 — crates/buzz-db/src/store/api_token.rs:28-46 | crates/buzz-db/src/store/api_token.rs:88-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×4
  • Duplicated block (19–20 lines × 2) crates/buzz-acp/src/lib.rs:3646 — crates/buzz-acp/src/lib.rs:3646-3665 | crates/buzz-acp/src/lib.rs:3699-3717 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/lib.rs:3646` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–20 lines × 2) crates/buzz-db/src/store/moderation.rs:493 — crates/buzz-db/src/store/moderation.rs:493-512 | crates/buzz-db/src/store/moderation.rs:584-602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19–20 lines × 2) crates/buzz-relay/src/api/bridge.rs:2766 — crates/buzz-relay/src/api/bridge.rs:2766-2785 | crates/buzz-relay/src/handlers/req.rs:977-995 — 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 4 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. 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/api/bridge.rs:2766` 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 (19–20 lines × 2) mobile/lib/features/channels/composer_dock_size_reporter.dart:30 — mobile/lib/features/channels/composer_dock_size_reporter.dart:30-49 | mobile/lib/features/channels/thread_detail_page/head_layout.dart:21-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/composer_dock_size_reporter.dart:30` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The 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 (13–15 lines × 2) · ×4
  • Duplicated block (13–15 lines × 2) crates/buzz-pairing-cli/src/main.rs:574 — crates/buzz-pairing-cli/src/main.rs:574-588 | desktop/src-tauri/src/commands/pairing.rs:770-782 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13–15 lines × 2) crates/buzz-relay/src/invite_token.rs:183 — crates/buzz-relay/src/invite_token.rs:183-197 | crates/buzz-relay/src/invite_token.rs:387-399 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/invite_token.rs:183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `desktop/src-tauri/src/mesh_llm/mod.rs:383` calls `Some`, `max_vram_gb` and `desktop/src-tauri/src/mesh_llm/mod.rs:419` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13–15 lines × 2) mobile/lib/features/agents/agent_card.dart:75 — mobile/lib/features/agents/agent_card.dart:75-87 | mobile/lib/shared/widgets/agent_artwork_panel.dart:31-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/agents/agent_card.dart:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mobile/lib/shared/widgets/agent_artwork_panel.dart:30` calls `IgnorePointer` and `mobile/lib/features/agents/agent_card.dart:74` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×4
  • Duplicated block (12 lines × 3) crates/buzz-db/src/store/event.rs:2489 — crates/buzz-db/src/store/event.rs:2489-2500 | crates/buzz-db/src/store/event.rs:2556-2567 | crates/buzz-db/src/store/event.rs:2625-2636 — 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 `crates/buzz-db/src/store/event.rs:2489` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/buzz-db/src/store/workflow.rs:747 — crates/buzz-db/src/store/workflow.rs:747-758 | crates/buzz-db/src/store/workflow.rs:784-795 | crates/buzz-db/src/store/workflow.rs:821-832 — 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 `crates/buzz-db/src/store/workflow.rs:747` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/workflow.rs:744` calls `bind` and `crates/buzz-db/src/store/workflow.rs:819` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 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) crates/buzz-relay/src/handlers/req.rs:156 — crates/buzz-relay/src/handlers/req.rs:156-167 | crates/buzz-relay/src/handlers/req.rs:187-199 | crates/buzz-relay/src/handlers/req.rs:239-255 — 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 `crates/buzz-relay/src/handlers/req.rs:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/handlers/req.rs:238` calls `ids` and `crates/buzz-relay/src/handlers/req.rs:186` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×4
  • Duplicated block (7–8 lines × 2) crates/buzz-cli/src/client.rs:1557 — crates/buzz-cli/src/client.rs:1557-1564 | crates/buzz-cli/src/client.rs:1587-1593 — both copies are in the same file, so extract the 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 `crates/buzz-cli/src/client.rs:1557` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7–8 lines × 2) crates/buzz-cli/src/commands/projects.rs:176 — crates/buzz-cli/src/commands/projects.rs:176-182 | crates/buzz-cli/src/commands/projects.rs:528-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7–8 lines × 2) crates/buzz-relay/src/config.rs:611 — crates/buzz-relay/src/config.rs:611-617 | crates/buzz-relay/src/storage_usage_delivery.rs:42-49 — 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 `crates/buzz-relay/src/config.rs:611` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) desktop/src-tauri/src/commands/agent_config.rs:485 — desktop/src-tauri/src/commands/agent_config.rs:485-492 | desktop/src-tauri/src/commands/agent_config.rs:520-526 — both copies are in the same file, so extract the 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 `desktop/src-tauri/src/commands/agent_config.rs:485` 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. 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×4
  • 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:3137-3141 | crates/buzz-relay/src/handlers/moderation_commands.rs:136-140 | crates/buzz-relay/src/handlers/relay_admin.rs:241-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 all 4 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/handlers/relay_admin.rs:235` calls `to_hex` and `crates/buzz-relay/src/handlers/moderation_commands.rs:133` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 4) desktop/src-tauri/src/managed_agents/retention.rs:497 — desktop/src-tauri/src/managed_agents/retention.rs:497-501 | desktop/src-tauri/src/managed_agents/retention.rs:585-589 | desktop/src-tauri/src/managed_agents/retention.rs:621-625 | desktop/src-tauri/src/managed_agents/retention/legacy_migration.rs:135-139 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/retention.rs:497` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/events/message_tags.rs:82` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) mobile/lib/shared/community/community_provider.dart:489 — mobile/lib/shared/community/community_provider.dart:489-494 | mobile/lib/shared/community/community_provider.dart:578-583 | mobile/lib/shared/community/community_provider.dart:650-654 | mobile/lib/shared/community/community_provider.dart:690-694 — 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.
AC1 · Text alternatives · <video> without a captions track · ×3
  • <video> without a captions track desktop/src/features/messages/ui/ComposerAttachments.tsx:432 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track desktop/src/shared/ui/VideoPlayer.tsx:992 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track desktop/src/shared/ui/VideoPlayer.tsx:1698 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC2 · Forms & labels · <Textarea> field component without a label · ×3
  • <Textarea> field component without a label desktop/src/features/agents/ui/AgentCardMintDialog.tsx:306 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label desktop/src/features/agents/ui/RespondToField.tsx:501 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label desktop/src/features/settings/ui/SendFeedbackDialog.tsx:234 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels · <fieldset> without a <legend> · ×3
  • <fieldset> without a <legend> desktop/src/features/forum/ui/ForumComposer.tsx:681 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> desktop/src/features/onboarding/ui/DefaultConfigStep.tsx:231 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:454 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×3
  • Focus outline removed in CSS without a :focus replacement desktop/src/shared/styles/globals/animations.css:433 — `.buzz-avatar-hue-scrubber` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement desktop/src/shared/styles/globals/composer.css:97 — `.rich-text-composer .tiptap` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement desktop/src/shared/styles/globals/media-controls.css:11 — `.video-volume-slider:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D1 · Cyclomatic Complexity · Config · ×3
  • Config::from_env (cyclomatic 79) crates/buzz-relay/src/config.rs:712 — Config::from_env has cyclomatic complexity 79 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • Config::from_args (cyclomatic 38) crates/buzz-acp/src/config.rs:965 — Config::from_args has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Config::validate (cyclomatic 20) crates/buzz-agent/src/config.rs:812 — Config::validate has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AcpClient · ×3
  • AcpClient::read_until_response_with_idle_timeout (cyclomatic 46) crates/buzz-acp/src/acp.rs:1399 — AcpClient::read_until_response_with_idle_timeout has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AcpClient::spawn_with_env (cyclomatic 18) crates/buzz-acp/src/acp.rs:476 — AcpClient::spawn_with_env has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AcpClient::read_until_response (cyclomatic 16) crates/buzz-acp/src/acp.rs:1275 — 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 · huddlePresenceRuntime.startHuddlePresenceRuntime · ×3
  • huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile (cyclomatic 19) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:435 — huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds (cyclomatic 17) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:284 — huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness (cyclomatic 17) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:363 — huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AcpClient · ×3
  • AcpClient::read_until_response_with_idle_timeout (cognitive 155) crates/buzz-acp/src/acp.rs:1399 — 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:1275 — AcpClient::read_until_response has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AcpClient::spawn_with_env (cognitive 22) crates/buzz-acp/src/acp.rs:476 — AcpClient::spawn_with_env has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config · ×3
  • Config::from_env (cognitive 87) crates/buzz-relay/src/config.rs:712 — Config::from_env has cognitive complexity 87 (threshold 15). Drivers by points: if/else 28 (44 pts), boolean chains 22, match/switch 16 (18 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Config::from_args (cognitive 54) crates/buzz-acp/src/config.rs:965 — Config::from_args has cognitive complexity 54 (threshold 15). Drivers by points: if/else 38 (45 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Config::validate (cognitive 20) crates/buzz-agent/src/config.rs:812 — Config::validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
D2 · Cognitive Complexity · huddlePresenceRuntime.startHuddlePresenceRuntime · ×3
  • huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds (cognitive 26) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:284 — huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness (cognitive 26) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:363 — huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile (cognitive 25) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:435 — huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×3
  • Edited copy of a member (41 corresponding lines) REDACTED:2596 — REDACTED:2596-2637 | REDACTED:2646-2686 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) mobile/ios/Runner/PushSnapshotBridge.swift:142 — mobile/ios/Runner/PushSnapshotBridge.swift:142-182 | mobile/ios/Runner/PushSnapshotBridge.swift:186-229 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) crates/buzz-acp/src/relay.rs:3466 — crates/buzz-acp/src/relay.rs:3466-3523 | crates/buzz-acp/src/relay.rs:3532-3572 — These two members are one piece of code written twice and then edited apart: 41 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 (31 corresponding lines) · ×3
  • Edited copy of a member (31 corresponding lines) crates/buzz-db/src/store/moderation.rs:356 — crates/buzz-db/src/store/moderation.rs:356-387 | crates/buzz-db/src/store/moderation.rs:545-575 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/buzz-db/src/store/channel_members.rs:1339 — crates/buzz-db/src/store/channel_members.rs:1339-1369 | crates/buzz-db/src/store/channel_members.rs:1456-1486 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/buzz-db/src/store/replaceable.rs:611 — crates/buzz-db/src/store/replaceable.rs:611-642 | crates/buzz-db/src/store/replaceable.rs:676-706 — These two members are one piece of code written twice and then edited apart: 31 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 (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) crates/buzz-db/src/store/push.rs:999 — crates/buzz-db/src/store/push.rs:999-1031 | crates/buzz-db/src/store/workflow.rs:689-715 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/buzz-db/src/store/workflow.rs:730 — crates/buzz-db/src/store/workflow.rs:730-758 | crates/buzz-db/src/store/workflow.rs:769-795 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/buzz-test-client/src/loadgen/desktop.rs:712 — crates/buzz-test-client/src/loadgen/desktop.rs:712-748 | crates/buzz-test-client/src/loadgen/desktop.rs:874-900 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/buzz-cli/src/commands/dms.rs:140 — crates/buzz-cli/src/commands/dms.rs:140-150 | crates/buzz-cli/src/commands/workflows.rs:152-161 | crates/buzz-cli/src/commands/workflows.rs:209-223 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/buzz-pubsub/src/lib.rs:374 — crates/buzz-pubsub/src/lib.rs:374-383 | crates/buzz-pubsub/src/lib.rs:394-403 | crates/buzz-pubsub/src/lib.rs:414-424 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) mobile/ios/Runner/PushEndpointGrantStore.swift:118 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:230-240 | mobile/ios/Runner/PushEndpointGrantStore.swift:118-128 | mobile/ios/Runner/PushNativeState.swift:115-124 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 8+ corresponding lines) crates/buzz-sdk/src/builders.rs:329 — crates/buzz-sdk/src/builders.rs:329-337 | crates/buzz-sdk/src/builders.rs:346-355 | desktop/src-tauri/src/events.rs:323-330 | desktop/src-tauri/src/events.rs:340-348 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) desktop/src-tauri/src/key_backup.rs:224 — desktop/src-tauri/src/key_backup.rs:224-231 | desktop/src-tauri/src/managed_agents/bestie_assignment.rs:158-168 | desktop/src-tauri/src/managed_agents/storage.rs:687-699 | desktop/src-tauri/src/reset.rs:50-57 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) mobile/ios/Runner/NativeAddMembersSheet.swift:15 — mobile/ios/Runner/NativeAddMembersSheet.swift:15-22 | mobile/ios/Runner/NativeConfirmationDialog.swift:12-20 | mobile/ios/Runner/NativeEmojiPicker.swift:17-31 | mobile/ios/Runner/NativeMessagePresentationCoordinator.swift:13-21 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×3
  • Edited copy of a member (3 corresponding lines) mobile/ios/Runner/JumpToLatestGlassButton.swift:33 — mobile/ios/Runner/JumpToLatestGlassButton.swift:33-40 | mobile/ios/Runner/NativeReactionDetails.swift:354-356 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) mobile/ios/Runner/NativeCommunityEntry.swift:70 — mobile/ios/Runner/NativeCommunityEntry.swift:70-75 | mobile/ios/Runner/NativeProfileSetup.swift:247-249 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) crates/buzz-relay/src/api/git/manifest_event.rs:136 — crates/buzz-relay/src/api/git/manifest_event.rs:136-138 | desktop/src-tauri/src/deep_link.rs:375-377 — These two members are one piece of code written twice and then edited apart: 3 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 · Duplicated block (40 lines × 2) · ×3
  • Duplicated block (40 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:778 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:778-817 | desktop/src-tauri/src/commands/team_snapshot.rs:873-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 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (40 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:840 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:840-879 | 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 139 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/personas/snapshot/import.rs:840` 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 (40 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:340 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:340-379 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:340-379 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:340` 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 (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) crates/buzz-relay/src/api/git/transport.rs:1567 — crates/buzz-relay/src/api/git/transport.rs:1567-1591 | crates/buzz-relay/src/api/git/transport.rs:1864-1888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:242 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:242-266 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:242-266 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (25 lines × 2) mobile/lib/features/forum/forum_post_card.dart:139 — mobile/lib/features/forum/forum_post_card.dart:139-163 | mobile/lib/features/forum/forum_thread_page.dart:400-424 — before extracting anything, compare `mobile/lib/features/forum/forum_post_card.dart` and `mobile/lib/features/forum/forum_thread_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/forum/forum_post_card.dart:139` 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 (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) crates/buzz-acp/src/relay.rs:3978 — crates/buzz-acp/src/relay.rs:3978-4000 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/relay.rs:3978` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/archive/store.rs:637` 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 (23 lines × 2) mobile/lib/features/profile/profile_edit_page.dart:708 — mobile/lib/features/profile/profile_edit_page.dart:708-730 | mobile/lib/shared/widgets/text_editor.dart:137-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/profile/profile_edit_page.dart:708` 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 (16–20 lines × 2) · ×3
  • Duplicated block (16–20 lines × 2) crates/buzz-relay/src/audio/room.rs:326 — crates/buzz-relay/src/audio/room.rs:326-345 | crates/buzz-relay/src/audio/room.rs:516-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/room.rs:326` 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 (16–20 lines × 2) desktop/src-tauri/src/commands/admin/mod.rs:184 — desktop/src-tauri/src/commands/admin/mod.rs:184-203 | desktop/src-tauri/src/commands/admin/mod.rs:232-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/admin/mod.rs:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16–20 lines × 2) mobile/ios/Runner/AppDelegate.swift:1067 — mobile/ios/Runner/AppDelegate.swift:1067-1086 | 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:1067` 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–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) crates/buzz-acp/src/pool.rs:3308 — crates/buzz-acp/src/pool.rs:3308-3325 | crates/buzz-acp/src/pool.rs:3614-3630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/pool.rs:3308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) crates/buzz-relay/src/api/bridge.rs:3295 — crates/buzz-relay/src/api/bridge.rs:3295-3312 | crates/buzz-relay/src/api/bridge.rs:3337-3353 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/bridge.rs:3295` 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 (17–18 lines × 2) mobile/lib/features/channels/channels_page/sections.dart:120 — mobile/lib/features/channels/channels_page/sections.dart:120-136 | mobile/lib/features/channels/channels_page/sections.dart:501-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channels_page/sections.dart:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×3
  • Duplicated block (14–15 lines × 2) REDACTED:2699 — REDACTED:2699-2712 | REDACTED:3015-3029 — both copies are in the same file, so extract the 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 `REDACTED:2699` 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 (14–15 lines × 2) crates/buzz-workflow/src/lib.rs:511 — crates/buzz-workflow/src/lib.rs:511-525 | crates/buzz-workflow/src/lib.rs:809-822 — both copies are in the same file, so extract the 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 `crates/buzz-workflow/src/lib.rs:511` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:77 — mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:77-91 | mobile/ios/Runner/NativeProfileTextEditor.swift:15-28 — 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) · ×3
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/issues.rs:499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-cli/src/commands/issues.rs:515` calls `Some` and `crates/buzz-cli/src/commands/patches.rs:107` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media_transcode.rs:254` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:205 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:205-218 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:305-318 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:205-218 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) crates/buzz-relay/src/api/bridge.rs:1275 — crates/buzz-relay/src/api/bridge.rs:1275-1287 | crates/buzz-relay/src/api/bridge.rs:1631-1643 | crates/buzz-relay/src/api/bridge.rs:2336-2348 — 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 `crates/buzz-relay/src/api/bridge.rs:1275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/api/bridge.rs:1628` calls `is_ok_and`, `requested` and `crates/buzz-relay/src/api/bridge.rs:1270` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 3) crates/buzz-relay/src/handlers/side_effects.rs:2296 — crates/buzz-relay/src/handlers/side_effects.rs:2296-2308 | crates/buzz-relay/src/handlers/side_effects.rs:3017-3029 | crates/buzz-relay/src/handlers/side_effects.rs:3298-3310 — 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 `crates/buzz-relay/src/handlers/side_effects.rs:2296` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 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:296-308 | desktop/src-tauri/src/commands/teams/mod.rs:398-410 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agents_pending.rs:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) crates/buzz-cli/src/commands/channels.rs:713 — crates/buzz-cli/src/commands/channels.rs:713-724 | crates/buzz-cli/src/commands/channels.rs:1500-1510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-cli/src/commands/channels.rs:1511` calls `as_deref` and `crates/buzz-cli/src/commands/channels.rs:725` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–12 lines × 2) desktop/src-tauri/src/nostr_convert/agent_directory.rs:30 — desktop/src-tauri/src/nostr_convert/agent_directory.rs:30-41 | desktop/src-tauri/src/nostr_convert/agent_directory.rs:107-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:152 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:152-162 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:156-167 — 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 6 separate duplicated blocks between them, totalling at least 172 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_bubble.dart:152` 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 (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) crates/buzz-pair-relay/src/lib.rs:392 — crates/buzz-pair-relay/src/lib.rs:392-401 | crates/buzz-relay/src/handlers/ingest.rs:2247-2257 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) crates/buzz-relay/src/handlers/imeta.rs:406 — crates/buzz-relay/src/handlers/imeta.rs:406-416 | 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `desktop/src-tauri/src/link_preview_tags.rs:41` calls `contains` and `crates/buzz-relay/src/handlers/imeta.rs:417` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:751 — crates/buzz-relay/src/handlers/ingest.rs:751-760 | crates/buzz-relay/src/handlers/ingest.rs:3596-3606 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/ingest.rs:751` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×3
  • Duplicated block (16 lines × 3) crates/buzz-db/src/store/feed.rs:137 — crates/buzz-db/src/store/feed.rs:137-152 | crates/buzz-db/src/store/feed.rs:226-241 | crates/buzz-db/src/store/thread.rs:332-347 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/feed.rs:137` 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 (16 lines × 3) crates/buzz-db/src/store/moderation.rs:443 — crates/buzz-db/src/store/moderation.rs:443-460 | crates/buzz-db/src/store/moderation.rs:500-515 | crates/buzz-db/src/store/relay_admin_actions.rs:335-350 — before extracting anything, compare `crates/buzz-db/src/store/moderation.rs` and `crates/buzz-db/src/store/relay_admin_actions.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. 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 `crates/buzz-db/src/store/moderation.rs:443` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:164 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:164-179 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:191-206 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:164-179 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:164` 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience desktop/src-tauri/src/app_state.rs:183 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience desktop/src-tauri/src/app_state.rs:208 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience desktop/src-tauri/src/app_state.rs:213 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×3
  • Sync-over-async blocking desktop/src/testing/e2eBridge.ts:12950 — a busy-wait on the clock in `handleMockCommand` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking desktop/test-loader-hooks.mjs:168 — `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking desktop/test-loader-hooks.mjs:184 — `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication · Duplicated block with local edits (153 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (153 matched lines × 2 locations) desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119 — desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119 · desktop/src/features/agents/ui/PersonaAdvancedFields.tsx:100 — the two spans are one implementation copied and then locally edited — 607 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (153 matched lines × 2 locations) desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277 — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277 · desktop/src/features/settings/ui/BackupTestFlow.tsx:160 — the two spans are one implementation copied and then locally edited — 823 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (153 matched lines × 2 locations) desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114 — desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114 · desktop/src/features/workflows/ui/WorkflowMessagePicker.tsx:195 — the two spans are one implementation copied and then locally edited — 720 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×2
  • Modal dialog does not manage focus web/src/features/invite/ui/InvitePage.tsx:294 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/features/invite/ui/InvitePage.tsx:351 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D1 · Cyclomatic Complexity · buzz_pair_relay · ×2
  • buzz_pair_relay::handle_conn (cyclomatic 41) crates/buzz-pair-relay/src/lib.rs:622 — buzz_pair_relay::handle_conn has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_pair_relay::validate_nip44_content (cyclomatic 16) crates/buzz-pair-relay/src/lib.rs:345 — buzz_pair_relay::validate_nip44_content has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · buzz_deletion · ×2
  • buzz_deletion::execute_stage (cyclomatic 19) crates/buzz-deletion/src/lib.rs:1432 — buzz_deletion::execute_stage has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • buzz_deletion::prepare_owner_claim_with (cyclomatic 16) crates/buzz-deletion/src/lib.rs:1088 — buzz_deletion::prepare_owner_claim_with has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
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.
D10 · Test Quality · Races the wall clock · ×2
  • Races the wall clock: shows a large elapsed for a turn that started well in the past desktop/src/features/agents/activeAgentTurnsStore.test.mjs:1126 — This test reads `Date.now()` and compares it against the value the code under test computed from its own clock read, compared exactly in `assert.equal(Date.now() - summary.anchorAt, 5 * 60_000 - 1_000, " ",)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: resurrects a pruned turn at startedAt from the first recovered ACP frame desktop/src/features/agents/activeAgentTurnsStore.test.mjs:1265 — This test reads `Date.now()` and compares it against the value the code under test computed from its own clock read, compared exactly in `assert.equal(Date.now() - resurrected.anchorAt, 45_000, " ",)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
D2 · Cognitive Complexity · buzz_pair_relay · ×2
  • buzz_pair_relay::handle_conn (cognitive 106) crates/buzz-pair-relay/src/lib.rs:622 — buzz_pair_relay::handle_conn has cognitive complexity 106 (threshold 15). Drivers by points: if/else 16 (60 pts), match/switch 13 (44 pts), boolean chains 1, loops 1 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_pair_relay::validate_nip44_content (cognitive 17) crates/buzz-pair-relay/src/lib.rs:345 — buzz_pair_relay::validate_nip44_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowEngine · ×2
  • WorkflowEngine::cron_tick (cognitive 41) crates/buzz-workflow/src/lib.rs:586 — WorkflowEngine::cron_tick has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 10 (24 pts), if/else 7 (16 pts), loops 1 (nesting depth added 23). 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:405 — 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 · McpRegistry · ×2
  • McpRegistry::call_hooks (cognitive 26) crates/buzz-agent/src/mcp.rs:345 — McpRegistry::call_hooks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • McpRegistry::spawn_all (cognitive 22) crates/buzz-agent/src/mcp.rs:202 — McpRegistry::spawn_all has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:124 — 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 · buzz_pairing_cli · ×2
  • buzz_pairing_cli::cmd_target (cognitive 16) crates/buzz-pairing-cli/src/main.rs:216 — 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:542 — 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 (38 shared lines) · ×2
  • Near-duplicate member pair (38 shared lines) crates/buzz-relay/src/audio/handler.rs:282 — crates/buzz-relay/src/audio/handler.rs:282-405 | crates/buzz-relay/src/connection.rs:381-523 — 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.
  • Near-duplicate member pair (38 shared lines) desktop/src-tauri/src/archive/store.rs:608 — desktop/src-tauri/src/archive/store.rs:608-689 | desktop/src-tauri/src/archive/store.rs:784-840 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (70 corresponding lines) · ×2
  • Edited copy of a member (70 corresponding lines) crates/buzz-core/src/engram.rs:283 — crates/buzz-core/src/engram.rs:283-367 | crates/buzz-core/src/private_managed_agent.rs:728-797 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (70 corresponding lines) mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:93 — mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:93-162 | mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:192-271 — These two members are one piece of code written twice and then edited apart: 70 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 (45 corresponding lines) · ×2
  • Edited copy of a member (45 corresponding lines) desktop/src-tauri/src/commands/personas/snapshot/import.rs:777 — desktop/src-tauri/src/commands/personas/snapshot/import.rs:777-821 | desktop/src-tauri/src/commands/team_snapshot.rs:872-916 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) desktop/src-tauri/src/persona_catalog.rs:151 — desktop/src-tauri/src/persona_catalog.rs:151-195 | desktop/src-tauri/src/team_catalog.rs:233-279 — These two members are one piece of code written twice and then edited apart: 45 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 (55 corresponding lines) · ×2
  • Edited copy of a member (55 corresponding lines) crates/buzz-pair-relay/src/lib.rs:345 — crates/buzz-pair-relay/src/lib.rs:345-411 | crates/buzz-relay/src/handlers/ingest.rs:2214-2268 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (55 corresponding lines) crates/buzz-relay/src/handlers/side_effects.rs:2256 — crates/buzz-relay/src/handlers/side_effects.rs:2256-2319 | crates/buzz-relay/src/handlers/side_effects.rs:3267-3321 — These two members are one piece of code written twice and then edited apart: 55 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 (53 corresponding lines) · ×2
  • Edited copy of a member (53 corresponding lines) crates/buzz-pairing-cli/src/main.rs:438 — crates/buzz-pairing-cli/src/main.rs:438-490 | desktop/src-tauri/src/commands/pairing.rs:705-761 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) crates/buzz-relay/src/handlers/ingest.rs:1738 — crates/buzz-relay/src/handlers/ingest.rs:1738-1790 | crates/buzz-relay/src/handlers/ingest.rs:2281-2344 — These two members are one piece of code written twice and then edited apart: 53 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 (40 corresponding lines) · ×2
  • Edited copy of a member (40 corresponding lines) crates/buzz-relay/src/tunnel/directory.rs:347 — crates/buzz-relay/src/tunnel/directory.rs:347-388 | crates/buzz-relay/src/tunnel/directory.rs:392-431 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) crates/buzz-db/src/store/api_token.rs:27 — crates/buzz-db/src/store/api_token.rs:27-66 | crates/buzz-db/src/store/api_token.rs:87-143 — These two members are one piece of code written twice and then edited apart: 40 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 (38 corresponding lines) · ×2
  • Edited copy of a member (38 corresponding lines) desktop/src-tauri/src/persona_catalog.rs:75 — desktop/src-tauri/src/persona_catalog.rs:75-120 | desktop/src-tauri/src/team_catalog.rs:66-103 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) desktop/src-tauri/src/commands/media_animated.rs:64 — desktop/src-tauri/src/commands/media_animated.rs:64-101 | desktop/src-tauri/src/commands/media_animated.rs:164-205 — These two members are one piece of code written twice and then edited apart: 38 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 (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) desktop/src-tauri/src/commands/personas/pending.rs:172 — desktop/src-tauri/src/commands/personas/pending.rs:172-213 | desktop/src-tauri/src/commands/teams/pending.rs:154-188 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/buzz-relay/src/handlers/admin_action_worker.rs:33 — crates/buzz-relay/src/handlers/admin_action_worker.rs:33-67 | crates/buzz-relay/src/handlers/admin_outbox_worker.rs:34-68 — These two members are one piece of code written twice and then edited apart: 35 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 (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) mobile/ios/Runner/InlinePhotoPicker.swift:179 — mobile/ios/Runner/InlinePhotoPicker.swift:179-230 | mobile/ios/Runner/NativeAttachmentPopover.swift:495-538 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) crates/buzz-acp/src/relay.rs:2963 — crates/buzz-acp/src/relay.rs:2963-3010 | crates/buzz-acp/src/relay.rs:3023-3066 — These two members are one piece of code written twice and then edited apart: 44 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 (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) desktop/src-tauri/src/relay.rs:559 — desktop/src-tauri/src/relay.rs:559-606 | desktop/src-tauri/src/relay.rs:700-736 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) crates/buzz-push-gateway/src/app_attest.rs:86 — crates/buzz-push-gateway/src/app_attest.rs:86-122 | crates/buzz-push-gateway/src/app_attest.rs:131-171 — These two members are one piece of code written twice and then edited apart: 37 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 (54 corresponding lines) · ×2
  • Edited copy of a member (54 corresponding lines) mobile/lib/features/channels/me/solo_working_dots.dart:12 — mobile/lib/features/channels/me/solo_working_dots.dart:12-65 | mobile/lib/shared/widgets/bouncing_dots_indicator.dart:29-83 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) crates/buzz-db/src/store/relay_admin_actions.rs:1115 — crates/buzz-db/src/store/relay_admin_actions.rs:1115-1168 | crates/buzz-db/src/store/relay_admin_actions.rs:1189-1252 — These two members are one piece of code written twice and then edited apart: 54 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) · ×2
  • Edited copy of a member (33 corresponding lines) crates/buzz-relay/src/handlers/event.rs:345 — crates/buzz-relay/src/handlers/event.rs:345-378 | crates/buzz-relay/src/handlers/event.rs:429-461 — 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.
  • Edited copy of a member (33 corresponding lines) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:473 — mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:473-510 | mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:636-668 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 17+ corresponding lines) crates/buzz-push-gateway/src/postgres.rs:234 — crates/buzz-push-gateway/src/postgres.rs:234-250 | crates/buzz-push-gateway/src/postgres.rs:255-281 | crates/buzz-push-gateway/src/postgres.rs:290-319 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) crates/buzz-relay/src/config.rs:536 — crates/buzz-relay/src/config.rs:536-555 | crates/buzz-relay/src/config.rs:557-578 | crates/buzz-relay/src/storage_usage_delivery.rs:39-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) crates/buzz-pubsub/src/nip98_replay.rs:41 — crates/buzz-pubsub/src/nip98_replay.rs:41-89 | crates/buzz-pubsub/src/nip_fi_command_replay.rs:48-72 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/buzz-relay/src/conformance/mod.rs:271 — crates/buzz-relay/src/conformance/mod.rs:271-295 | crates/buzz-relay/src/conformance/mod.rs:306-330 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 25+ corresponding lines) crates/buzz-cli/src/client.rs:979 — crates/buzz-cli/src/client.rs:979-1003 | crates/buzz-cli/src/client.rs:1008-1032 | crates/buzz-cli/src/client.rs:1071-1100 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 25+ corresponding lines) mobile/lib/features/forum/forum_post_card.dart:309 — mobile/lib/features/forum/forum_post_card.dart:309-333 | mobile/lib/features/forum/forum_thread_page.dart:179-210 | mobile/lib/features/forum/forum_thread_page.dart:641-670 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) desktop/src-tauri/src/commands/project_git_recipient_notes.rs:229 — desktop/src-tauri/src/commands/project_git_recipient_notes.rs:229-246 | desktop/src-tauri/src/commands/project_git_recipient_notes.rs:271-290 | desktop/src-tauri/src/commands/project_git_workflow.rs:448-466 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) crates/buzz-db/src/store/channel_members.rs:1578 — crates/buzz-db/src/store/channel_members.rs:1578-1595 | crates/buzz-db/src/store/moderation.rs:246-265 | crates/buzz-db/src/store/workflow.rs:1211-1228 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/buzz-cli/src/client.rs:1650 — crates/buzz-cli/src/client.rs:1650-1667 | crates/buzz-cli/src/client.rs:1671-1688 | crates/buzz-cli/src/commands/channels.rs:641-656 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) desktop/src-tauri/src/commands/bestie.rs:81 — desktop/src-tauri/src/commands/bestie.rs:81-96 | desktop/src-tauri/src/commands/bestie.rs:105-122 | desktop/src-tauri/src/commands/bestie.rs:130-145 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) mobile/ios/Runner/ConcentricSheetSurface.swift:248 — mobile/ios/Runner/ConcentricSheetSurface.swift:248-254 | mobile/ios/Runner/JumpToLatestGlassButton.swift:661-667 | mobile/ios/Runner/NativeEmojiPickerModel.swift:30-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/buzz-acp/src/relay.rs:35 — crates/buzz-acp/src/relay.rs:35-41 | crates/buzz-deletion/src/lib.rs:1786-1793 | crates/buzz-voice/src/pocket.rs:45-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/buzz-sdk/src/builders.rs:846 — crates/buzz-sdk/src/builders.rs:846-856 | crates/buzz-sdk/src/builders.rs:2105-2115 | desktop/src-tauri/src/events.rs:226-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/buzz-relay/src/main.rs:1997 — crates/buzz-relay/src/main.rs:1997-2007 | crates/buzz-relay/src/readiness.rs:618-630 | crates/buzz-relay/src/readiness.rs:651-661 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) desktop/src-tauri/src/terminal_runtime.rs:605 — desktop/src-tauri/src/terminal_runtime.rs:605-618 | desktop/src-tauri/src/terminal_runtime.rs:758-771 | desktop/src-tauri/src/terminal_runtime.rs:779-792 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/buzz-db/src/store/artifact.rs:78 — crates/buzz-db/src/store/artifact.rs:78-91 | crates/buzz-db/src/store/community.rs:483-501 | REDACTED:3334-3348 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/buzz-db/src/store/archived_identities.rs:36 — crates/buzz-db/src/store/archived_identities.rs:36-49 | crates/buzz-db/src/store/channel_members.rs:2312-2329 | crates/buzz-db/src/store/relay_members.rs:240-253 | crates/buzz-db/src/store/user.rs:524-539 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/buzz-db/src/store/allowlist.rs:30 — crates/buzz-db/src/store/allowlist.rs:30-45 | crates/buzz-db/src/store/artifact.rs:58-71 | crates/buzz-db/src/store/channel_members.rs:2247-2261 | crates/buzz-db/src/store/git_repo.rs:159-174 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 4+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 4+ corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:20 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:20-23 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:23-26 | mobile/lib/features/channels/channel_sort/channel_sort_manager.dart:23-26 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:20-23 | mobile/lib/shared/reminders/reminder_service.dart:85-88 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 4+ corresponding lines) desktop/src-tauri/src/archive/mod.rs:65 — desktop/src-tauri/src/archive/mod.rs:65-68 | desktop/src-tauri/src/commands/agents.rs:24-27 | desktop/src-tauri/src/commands/profile.rs:395-398 | desktop/src-tauri/src/commands/workflows.rs:408-411 | desktop/src-tauri/src/huddle/audio_output.rs:52-59 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×2
  • Duplicated block (24–25 lines × 2) crates/buzz-relay/src/api/bridge.rs:1747 — crates/buzz-relay/src/api/bridge.rs:1747-1771 | crates/buzz-relay/src/api/bridge.rs:2426-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. 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 (24–25 lines × 2) mobile/lib/features/activity/activity_page.dart:109 — mobile/lib/features/activity/activity_page.dart:109-132 | mobile/lib/features/channels/channels_page.dart:261-285 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channels_page.dart:261` 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 (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) crates/buzz-relay/src/audio/handler.rs:1922 — crates/buzz-relay/src/audio/handler.rs:1922-1945 | crates/buzz-relay/src/audio/handler.rs:1965-1988 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:1922` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/runtime/process.rs:323` 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 (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:713 — crates/buzz-db/src/store/relay_admin_actions.rs:713-733 | crates/buzz-db/src/store/relay_admin_actions.rs:1723-1744 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/relay_admin_actions.rs:713` 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 (21–22 lines × 2) crates/buzz-search/src/query.rs:411 — crates/buzz-search/src/query.rs:411-432 | crates/buzz-search/src/query.rs:584-604 — both copies are in the same file, so extract the 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 `crates/buzz-search/src/query.rs:411` 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 (22–25 lines × 2) · ×2
  • Duplicated block (22–25 lines × 2) crates/buzz-audio-client/src/wire.rs:98 — crates/buzz-audio-client/src/wire.rs:98-122 | crates/buzz-relay/src/audio/wire.rs:65-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22–25 lines × 2) crates/buzz-db/src/store/event_deletion.rs:376 — crates/buzz-db/src/store/event_deletion.rs:376-400 | crates/buzz-db/src/store/thread.rs:281-302 — 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 `crates/buzz-db/src/store/event_deletion.rs:376` 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 (16–17 lines × 3) · ×2
  • Duplicated block (16–17 lines × 3) crates/buzz-acp/src/pool.rs:3474 — crates/buzz-acp/src/pool.rs:3474-3489 | crates/buzz-acp/src/pool.rs:3533-3549 | crates/buzz-acp/src/pool.rs:3587-3603 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/pool.rs:3474` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. 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.
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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-agent/src/auth.rs:696` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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) crates/buzz-relay/src/handlers/count.rs:239 — crates/buzz-relay/src/handlers/count.rs:239-252 | crates/buzz-relay/src/handlers/count.rs:325-341 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/count.rs:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/teams/pending.rs:316` 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 (15–16 lines × 3) · ×2
  • Duplicated block (15–16 lines × 3) crates/buzz-relay/src/audio/handler.rs:2062 — crates/buzz-relay/src/audio/handler.rs:2062-2076 | crates/buzz-relay/src/audio/handler.rs:2091-2106 | crates/buzz-relay/src/audio/handler.rs:2120-2134 — 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 `crates/buzz-relay/src/audio/handler.rs:2062` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/project_git_diff.rs:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×2
  • Duplicated block (14–16 lines × 2) crates/buzz-relay/src/api/git/cas_publish.rs:1292 — crates/buzz-relay/src/api/git/cas_publish.rs:1292-1305 | crates/buzz-relay/src/api/git/cas_publish.rs:1315-1330 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/git/cas_publish.rs:1315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–16 lines × 2) crates/buzz-relay/src/handlers/req.rs:655 — crates/buzz-relay/src/handlers/req.rs:655-668 | crates/buzz-relay/src/handlers/req.rs:1111-1126 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/req.rs:655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) crates/buzz-cli/src/client.rs:984 — crates/buzz-cli/src/client.rs:984-998 | crates/buzz-cli/src/client.rs:1013-1027 | crates/buzz-cli/src/client.rs:1076-1090 — 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 `crates/buzz-cli/src/client.rs:984` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-cli/src/client.rs:1093` calls `status`, `Ok` and `crates/buzz-cli/src/client.rs:999` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 3) mobile/lib/features/channels/channels_page/body.dart:376 — mobile/lib/features/channels/channels_page/body.dart:376-390 | mobile/lib/features/channels/channels_page/body.dart:492-506 | mobile/lib/features/channels/channels_page/body.dart:508-522 — 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–13 lines × 3) · ×2
  • Duplicated block (12–13 lines × 3) crates/buzz-db/src/store/moderation.rs:335 — crates/buzz-db/src/store/moderation.rs:335-346 | crates/buzz-db/src/store/reaction.rs:270-282 | crates/buzz-db/src/store/reaction.rs:392-403 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/moderation.rs:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/reaction.rs:391` calls `bind`, `as_uuid` and `crates/buzz-db/src/store/reaction.rs:270` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 3) crates/buzz-relay/src/audio/room.rs:360 — crates/buzz-relay/src/audio/room.rs:360-372 | crates/buzz-relay/src/audio/room.rs:426-438 | crates/buzz-relay/src/audio/room.rs:651-662 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/room.rs:360` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/git-sign-nostr/src/lib.rs:221` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–13 lines × 2) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:982 — mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:982-990 | mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:1030-1042 — both copies are in the same file, so extract the 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/huddle/tts.rs:541` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/migration.rs:1210` 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 (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) crates/buzz-pairing-cli/src/main.rs:172 — crates/buzz-pairing-cli/src/main.rs:172-183 | crates/buzz-pairing-cli/src/main.rs:303-312 — both copies are in the same file, so extract the 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 (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `desktop/src-tauri/src/archive/store.rs:666` calls `Some`, `push` and `desktop/src-tauri/src/archive/store.rs:821` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×2
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/huddle/playout.rs:544` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–10 lines × 2) mobile/ios/Runner/InlinePhotoPicker.swift:127 — mobile/ios/Runner/InlinePhotoPicker.swift:127-134 | mobile/ios/Runner/NativeAttachmentPopover.swift:575-584 — 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 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/Runner/InlinePhotoPicker.swift:127` 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 (10 lines × 3) · ×2
  • 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:1758 — crates/buzz-relay/src/handlers/ingest.rs:1758-1767 | crates/buzz-relay/src/handlers/ingest.rs:2303-2315 | crates/buzz-relay/src/handlers/ingest.rs:2321-2330 — 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 `crates/buzz-relay/src/handlers/ingest.rs:2303` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `event` to `&Event` in one and `&nostr::Event` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) 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 | desktop/src-tauri/src/managed_agents/config_bridge/goose.rs:141-147 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/config_bridge/goose.rs:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 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:369-375 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/channels/fetch.rs:369` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • 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:259-275 | desktop/src-tauri/src/commands/teams/mod.rs:360-375 | 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:144 — mobile/lib/shared/theme/app_theme.dart:144-153 | mobile/lib/shared/theme/app_theme.dart:159-168 | mobile/lib/shared/theme/app_theme.dart:174-183 | mobile/lib/shared/theme/app_theme.dart:187-196 — 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/lib/shared/theme/app_theme.dart:144` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×2
  • Duplicated block (12 lines × 6) crates/buzz-db/src/store/event.rs:2960 — crates/buzz-db/src/store/event.rs:2960-2972 | crates/buzz-db/src/store/git_repo.rs:192-203 | crates/buzz-db/src/store/moderation.rs:400-416 | crates/buzz-db/src/store/moderation.rs:588-603 | crates/buzz-db/src/store/push.rs:1262-1274 | crates/buzz-db/src/store/push.rs:1318-1330 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/event.rs:2960` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 6) mobile/ios/Runner/JumpToLatestGlassButton.swift:16 — mobile/ios/Runner/JumpToLatestGlassButton.swift:16-27 | mobile/ios/Runner/JumpToLatestGlassButton.swift:210-221 | mobile/ios/Runner/JumpToLatestGlassButton.swift:686-697 | 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: Provider (LCOM4 5) crates/buzz-cli/src/desktop_provider.rs:426 — Provider's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AppState (LCOM4 4) desktop/src-tauri/src/app_state.rs:19 — AppState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
R10 · Code Duplication · Duplicated block with local edits (92 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (92 matched lines × 2 locations) desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89 — desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89 · desktop/src/features/agents/ui/TeamSnapshotExportDialog.tsx:72 — the two spans are one implementation copied and then locally edited — 401 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (92 matched lines × 2 locations) desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141 — desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141 · desktop/src/features/search/ui/SearchPromptPlaceholder.tsx:62 — the two spans are one implementation copied and then locally edited — 526 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (65 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (65 matched lines × 2 locations) desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76 — desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76 · desktop/src/features/projects/ui/ProjectsAgentPromptPage.tsx:427 — the two spans are one implementation copied and then locally edited — 284 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (65 matched lines × 2 locations) desktop/src/shared/ui/rich-link-preview-attachment.tsx:168 — desktop/src/shared/ui/rich-link-preview-attachment.tsx:168 · desktop/src/shared/ui/rich-link-preview-attachment.tsx:267 — the two spans are one implementation copied and then locally edited — 282 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (~23 LoC) · ×2
  • Dead file (~23 LoC) desktop/src/features/profile/ui/ProfileAvatarUploadPreview.tsx — no import path from any entry point (107 application, 34 tooling, 967 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
  • Dead file (~23 LoC) desktop/src/features/projects/ui/ProjectsWorkItemTable.tsx — no import path from any entry point (107 application, 34 tooling, 967 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
AC4 · Keyboard semantics · Anchor without href · ×1
  • Anchor without href previews/invite-video/index.html:60 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.3 · ×1
  • Low contrast Tailwind colour pair (3.3:1) desktop/src/features/settings/ui/MobilePairingCard.tsx:74 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.9 · ×1
  • Low contrast colour pair in CSS (3.9:1) previews/invite-video/preview.css:119 — `.bubble` sets color: white on background-color: #087eff — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · _MessageList.build (cyclomatic 219) · ×1
  • _MessageList.build (cyclomatic 219) mobile/lib/features/channels/channel_detail_page/message_list.dart:60 — _MessageList.build has cyclomatic complexity 219 (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 · ThreadDetailPage.build (cyclomatic 174) · ×1
  • ThreadDetailPage.build (cyclomatic 174) mobile/lib/features/channels/thread_detail_page.dart:115 — ThreadDetailPage.build has cyclomatic complexity 174 (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 · 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, 108 points are the body's own statements and 62 belong to 17 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · 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 148) · ×1
  • UserProfilePanel.UserProfilePanel (cyclomatic 148) desktop/src/features/profile/ui/UserProfilePanel.tsx:105 — UserProfilePanel.UserProfilePanel has cyclomatic complexity 148 (threshold 15). Of this number, 93 points are the body's own statements and 55 belong to 22 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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, 85 points are the body's own statements and 53 belong to 18 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComposeBar.build (cyclomatic 136) · ×1
  • ComposeBar.build (cyclomatic 136) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:51 — ComposeBar.build has cyclomatic complexity 136 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ChannelPane.ChannelPane (cyclomatic 129) · ×1
  • ChannelPane.ChannelPane (cyclomatic 129) desktop/src/features/channels/ui/ChannelPane.tsx:79 — ChannelPane.ChannelPane has cyclomatic complexity 129 (threshold 15). Of this number, 97 points are the body's own statements and 32 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentDefinitionDialog.AgentDefinitionDialog (cyclomatic 124) · ×1
  • AgentDefinitionDialog.AgentDefinitionDialog (cyclomatic 124) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128 — AgentDefinitionDialog.AgentDefinitionDialog has cyclomatic complexity 124 (threshold 15). Of this number, 65 points are the body's own statements and 59 belong to 14 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 items inside it that branch (a function literal at line 398, a function literal at line 685, a function literal at line 190, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · _ResolvedChannelDetailPage.build (cyclomatic 121) · ×1
  • _ResolvedChannelDetailPage.build (cyclomatic 121) mobile/lib/features/channels/channel_detail_page.dart:203 — _ResolvedChannelDetailPage.build has cyclomatic complexity 121 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ImageAvatarCapture.build (cyclomatic 114) · ×1
  • ImageAvatarCapture.build (cyclomatic 114) mobile/lib/shared/widgets/image_avatar_capture.dart:89 — 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 · MessageTimeline.MessageTimelineBase (cyclomatic 113) · ×1
  • MessageTimeline.MessageTimelineBase (cyclomatic 113) desktop/src/features/messages/ui/MessageTimeline.tsx:166 — MessageTimeline.MessageTimelineBase has cyclomatic complexity 113 (threshold 15). Of this number, 75 points are the body's own statements and 38 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 · 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 · HostedCommunityOnboarding.HostedCommunityOnboarding (cyclomatic 103) · ×1
  • HostedCommunityOnboarding.HostedCommunityOnboarding (cyclomatic 103) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:76 — HostedCommunityOnboarding.HostedCommunityOnboarding has cyclomatic complexity 103 (threshold 15). Of this number, 54 points are the body's own statements and 49 belong to 21 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HuddleBar.HuddleBar (cyclomatic 103) · ×1
  • HuddleBar.HuddleBar (cyclomatic 103) desktop/src/features/huddle/components/HuddleBar.tsx:150 — HuddleBar.HuddleBar has cyclomatic complexity 103 (threshold 15). Of this number, 34 points are the body's own statements and 69 belong to 28 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChannelsPage.build (cyclomatic 102) · ×1
  • ChannelsPage.build (cyclomatic 102) mobile/lib/features/channels/channels_page.dart:171 — ChannelsPage.build has cyclomatic complexity 102 (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 · 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 · AgentsPage.build (cyclomatic 99) · ×1
  • AgentsPage.build (cyclomatic 99) mobile/lib/features/agents/agents_page.dart:345 — AgentsPage.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 · ProfileAvatarEditor.build (cyclomatic 98) · ×1
  • ProfileAvatarEditor.build (cyclomatic 98) mobile/lib/features/profile/profile_avatar_editor.dart:135 — ProfileAvatarEditor.build has cyclomatic complexity 98 (threshold 15). To reduce it, separate the cases: extract each independent 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 · 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, 43 points are the body's own statements and 53 belong to 20 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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, 38 points are the body's own statements and 57 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedConnectSheet.build (cyclomatic 92) · ×1
  • HostedConnectSheet.build (cyclomatic 92) mobile/lib/features/onboarding/hosted_connect_sheet.dart:36 — HostedConnectSheet.build has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ChannelDetailsPage.build (cyclomatic 91) · ×1
  • ChannelDetailsPage.build (cyclomatic 91) mobile/lib/features/channels/channel_details_page.dart:81 — ChannelDetailsPage.build has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent 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 · OnboardingAppEntry.build (cyclomatic 90) · ×1
  • OnboardingAppEntry.build (cyclomatic 90) mobile/lib/onboarding_app_entry.dart:36 — OnboardingAppEntry.build has cyclomatic complexity 90 (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 · 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 · AnimatedAvatarCapture.build (cyclomatic 87) · ×1
  • AnimatedAvatarCapture.build (cyclomatic 87) mobile/lib/features/profile/animated_avatar_capture.dart:81 — AnimatedAvatarCapture.build has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent 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 · 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 · 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 items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cyclomatic 85) · ×1
  • HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cyclomatic 85) desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:70 — HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard has cyclomatic complexity 85 (threshold 15). Of this number, 39 points are the body's own statements and 46 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · HostedFlow._continue (cyclomatic 84) · ×1
  • HostedFlow._continue (cyclomatic 84) mobile/lib/shared/hosted/hosted_flow.dart:554 — HostedFlow._continue has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · _PairingWelcomeView.build (cyclomatic 83) · ×1
  • _PairingWelcomeView.build (cyclomatic 83) mobile/lib/features/pairing/pairing_page/pairing_welcome_view.dart:62 — _PairingWelcomeView.build has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent 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 · useMentionSendFlow.useMentionSendFlow.completeSend (cyclomatic 82) · ×1
  • useMentionSendFlow.useMentionSendFlow.completeSend (cyclomatic 82) desktop/src/features/messages/ui/useMentionSendFlow.ts:284 — useMentionSendFlow.useMentionSendFlow.completeSend has cyclomatic complexity 82 (threshold 15). Of this number, 37 points are the body's own statements and 45 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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, 37 points are the body's own statements and 44 belong to 20 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ActivityPage.build (cyclomatic 80) · ×1
  • ActivityPage.build (cyclomatic 80) mobile/lib/features/activity/activity_page.dart:98 — ActivityPage.build has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProfileEditPage.build (cyclomatic 80) · ×1
  • ProfileEditPage.build (cyclomatic 80) mobile/lib/features/profile/profile_edit_page.dart:55 — ProfileEditPage.build has cyclomatic complexity 80 (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 · 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, 48 points are the body's own statements and 31 belong to 26 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PairingPage.build (cyclomatic 77) · ×1
  • PairingPage.build (cyclomatic 77) mobile/lib/features/pairing/pairing_page.dart:118 — PairingPage.build has cyclomatic complexity 77 (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 · 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 · 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 · _MessageImageStack.build (cyclomatic 71) · ×1
  • _MessageImageStack.build (cyclomatic 71) mobile/lib/features/channels/message_content/media_stack.dart:22 — _MessageImageStack.build 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.
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 · useAnchoredScroll.useAnchoredScroll (cyclomatic 68) · ×1
  • useAnchoredScroll.useAnchoredScroll (cyclomatic 68) desktop/src/features/messages/ui/useAnchoredScroll.ts:200 — useAnchoredScroll.useAnchoredScroll has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 2 of the 68 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 705, 1028, 293, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · 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:39 — HostedCommunityCreateFlow.HostedCommunityCreateFlow has cyclomatic complexity 66 (threshold 15). Of this number, 33 points are the body's own statements and 33 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · CommunitySwitcherPage.build (cyclomatic 63) · ×1
  • CommunitySwitcherPage.build (cyclomatic 63) mobile/lib/features/channels/channels_page/community_switcher.dart:90 — CommunitySwitcherPage.build has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent 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, 43 points are the body's own statements and 19 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · IosNavigationBar.build (cyclomatic 61) · ×1
  • IosNavigationBar.build (cyclomatic 61) mobile/lib/shared/widgets/ios_navigation_bar.dart:204 — IosNavigationBar.build has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChannelBrowserDialog.ChannelBrowserDialog (cyclomatic 61) · ×1
  • ChannelBrowserDialog.ChannelBrowserDialog (cyclomatic 61) desktop/src/features/channels/ui/ChannelBrowserDialog.tsx:165 — ChannelBrowserDialog.ChannelBrowserDialog has cyclomatic complexity 61 (threshold 15). Of this number, 25 points are the body's own statements and 36 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · 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 · HostedIdentityService._resolve (cyclomatic 60) · ×1
  • HostedIdentityService._resolve (cyclomatic 60) mobile/lib/shared/hosted/hosted_identity_service.dart:70 — HostedIdentityService._resolve 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 · 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 · _AddCommunityConnection.build (cyclomatic 58) · ×1
  • _AddCommunityConnection.build (cyclomatic 58) mobile/lib/features/pairing/add_community_page/add_community_connection.dart:46 — _AddCommunityConnection.build has cyclomatic complexity 58 (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 · 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 · FrostedAppBar._build (cyclomatic 56) · ×1
  • FrostedAppBar._build (cyclomatic 56) mobile/lib/shared/widgets/frosted_app_bar.dart:267 — FrostedAppBar._build has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useRichTextEditor.useRichTextEditor (cyclomatic 56) · ×1
  • useRichTextEditor.useRichTextEditor (cyclomatic 56) desktop/src/features/messages/lib/useRichTextEditor.ts:145 — useRichTextEditor.useRichTextEditor has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 1 of the 56 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 424, exitListIfEmptyLast, a function literal at line 281, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · NativePhotoZoomCoordinator.init (cyclomatic 55) · ×1
  • NativePhotoZoomCoordinator.init (cyclomatic 55) mobile/ios/Runner/NativePhotoZoomCoordinator.swift:12 — NativePhotoZoomCoordinator.init has cyclomatic complexity 55 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MessageContent.build (cyclomatic 55) · ×1
  • MessageContent.build (cyclomatic 55) mobile/lib/features/channels/message_content.dart:232 — MessageContent.build has cyclomatic complexity 55 (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 · 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 · _SystemMessageRow.build (cyclomatic 54) · ×1
  • _SystemMessageRow.build (cyclomatic 54) mobile/lib/features/channels/channel_detail_page/system_rows.dart:26 — _SystemMessageRow.build has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SelfHostedEntrySheet.build (cyclomatic 54) · ×1
  • SelfHostedEntrySheet.build (cyclomatic 54) mobile/lib/features/onboarding/self_hosted_entry_sheet.dart:140 — SelfHostedEntrySheet.build has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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, 34 points are the body's own statements and 20 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IosNavigationBarView.configure (cyclomatic 53) · ×1
  • IosNavigationBarView.configure (cyclomatic 53) mobile/ios/Runner/IosNavigationBar.swift:623 — IosNavigationBarView.configure has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _MeChatDraft.build (cyclomatic 53) · ×1
  • _MeChatDraft.build (cyclomatic 53) mobile/lib/features/channels/me/me_chat_draft.dart:13 — _MeChatDraft.build has cyclomatic complexity 53 (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 · ReadStateManager._publishOnce (cyclomatic 53) · ×1
  • ReadStateManager._publishOnce (cyclomatic 53) mobile/lib/shared/read_state/read_state_manager.dart:587 — ReadStateManager._publishOnce has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · HuddleTracker · ×1
  • HuddleTracker::apply (cyclomatic 52) crates/buzz-cli/src/commands/huddle_tracker.rs:249 — HuddleTracker::apply has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _MessageBubble.build (cyclomatic 52) · ×1
  • _MessageBubble.build (cyclomatic 52) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40 — _MessageBubble.build has cyclomatic complexity 52 (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 · ManageChannelSheet.build (cyclomatic 52) · ×1
  • ManageChannelSheet.build (cyclomatic 52) mobile/lib/features/channels/manage_channel_sheet.dart:218 — ManageChannelSheet.build has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaImageViewerPage.build (cyclomatic 52) · ×1
  • MediaImageViewerPage.build (cyclomatic 52) mobile/lib/features/channels/media_viewer_page.dart:213 — MediaImageViewerPage.build has cyclomatic complexity 52 (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 · 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 · AddChannelMembersSheet.build (cyclomatic 51) · ×1
  • AddChannelMembersSheet.build (cyclomatic 51) mobile/lib/features/channels/add_members_sheet.dart:81 — AddChannelMembersSheet.build 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.
D1 · Cyclomatic Complexity · ChannelsNotifier._fetchChannels (cyclomatic 51) · ×1
  • ChannelsNotifier._fetchChannels (cyclomatic 51) mobile/lib/features/channels/channels_provider.dart:358 — ChannelsNotifier._fetchChannels has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UserProfileSheet.build (cyclomatic 51) · ×1
  • UserProfileSheet.build (cyclomatic 51) mobile/lib/features/profile/user_profile_sheet.dart:126 — UserProfileSheet.build 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.
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 · CreateAgentPage.build (cyclomatic 50) · ×1
  • CreateAgentPage.build (cyclomatic 50) mobile/lib/features/agents/create_agent_page.dart:46 — CreateAgentPage.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 · NativePhotoZoomPreview.open (cyclomatic 50) · ×1
  • NativePhotoZoomPreview.open (cyclomatic 50) mobile/lib/features/channels/native_photo_zoom_preview.dart:29 — NativePhotoZoomPreview.open 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 · _ThreadMessage.build (cyclomatic 50) · ×1
  • _ThreadMessage.build (cyclomatic 50) mobile/lib/features/channels/thread_detail_page/thread_message.dart:41 — _ThreadMessage.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 · AdaptiveConversationPane.build (cyclomatic 50) · ×1
  • AdaptiveConversationPane.build (cyclomatic 50) mobile/lib/shared/widgets/adaptive_conversation_pane.dart:182 — AdaptiveConversationPane.build has cyclomatic complexity 50 (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 · App.CommunityApp (cyclomatic 50) · ×1
  • App.CommunityApp (cyclomatic 50) desktop/src/app/App.tsx:364 — App.CommunityApp has cyclomatic complexity 50 (threshold 15). Of this number, 28 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 · 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 · TimelineMessageList.VirtualizedTimelineRows (cyclomatic 50) · ×1
  • TimelineMessageList.VirtualizedTimelineRows (cyclomatic 50) desktop/src/features/messages/ui/TimelineMessageList.tsx:430 — TimelineMessageList.VirtualizedTimelineRows has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 3 of the 50 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 504, 637, 678, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 items inside it that branch (a function literal at line 275, a function literal at line 177, a function literal at line 154, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · _SasVerificationView.build (cyclomatic 49) · ×1
  • _SasVerificationView.build (cyclomatic 49) mobile/lib/features/pairing/pairing_page/sas_verification_view.dart:30 — _SasVerificationView.build 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.
D1 · Cyclomatic Complexity · ProfileSetupAvatarEditor.build (cyclomatic 49) · ×1
  • ProfileSetupAvatarEditor.build (cyclomatic 49) mobile/lib/features/profile/profile_setup_avatar_editor.dart:35 — ProfileSetupAvatarEditor.build 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.
D1 · Cyclomatic Complexity · useUnreadChannels.useUnreadChannels (cyclomatic 49) · ×1
  • useUnreadChannels.useUnreadChannels (cyclomatic 49) desktop/src/features/channels/useUnreadChannels.ts:126 — useUnreadChannels.useUnreadChannels has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 3 of the 49 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 677, 267, 225, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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: 12 of the 49 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 79, a function literal at line 220, doJoin, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · _NewDirectMessageSheet.build (cyclomatic 47) · ×1
  • _NewDirectMessageSheet.build (cyclomatic 47) mobile/lib/features/channels/channels_page/sheets.dart:304 — _NewDirectMessageSheet.build has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MePage.build (cyclomatic 47) · ×1
  • MePage.build (cyclomatic 47) mobile/lib/features/channels/me/me_page.dart:72 — MePage.build has cyclomatic complexity 47 (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 · _ToastBubble.build (cyclomatic 47) · ×1
  • _ToastBubble.build (cyclomatic 47) mobile/lib/shared/widgets/buzz_toast.dart:153 — _ToastBubble.build has cyclomatic complexity 47 (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 · PresetAgentAvatar.build (cyclomatic 47) · ×1
  • PresetAgentAvatar.build (cyclomatic 47) mobile/lib/shared/widgets/preset_agent_avatar.dart:30 — PresetAgentAvatar.build has cyclomatic complexity 47 (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 · 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 · HuddleControlAcceptor · ×1
  • HuddleControlAcceptor::serve_control_loop (cyclomatic 46) crates/buzz-relay/src/audio/join.rs:1303 — HuddleControlAcceptor::serve_control_loop has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedAppGate.build (cyclomatic 46) · ×1
  • HostedAppGate.build (cyclomatic 46) mobile/lib/hosted_app_gate.dart:37 — HostedAppGate.build 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.
D1 · Cyclomatic Complexity · FrostedScaffold.build (cyclomatic 46) · ×1
  • FrostedScaffold.build (cyclomatic 46) mobile/lib/shared/widgets/frosted_scaffold.dart:67 — FrostedScaffold.build has cyclomatic complexity 46 (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 · MobilePairingCard.MobilePairingCard (cyclomatic 46) · ×1
  • MobilePairingCard.MobilePairingCard (cyclomatic 46) desktop/src/features/settings/ui/MobilePairingCard.tsx:264 — MobilePairingCard.MobilePairingCard has cyclomatic complexity 46 (threshold 15). Of this number, 21 points are the body's own statements and 25 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NavigationGlassButtonPlatformView.applyContent (cyclomatic 45) · ×1
  • NavigationGlassButtonPlatformView.applyContent (cyclomatic 45) mobile/ios/Runner/JumpToLatestGlassButton.swift:488 — NavigationGlassButtonPlatformView.applyContent 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.
D1 · Cyclomatic Complexity · AppShell.AppShell (cyclomatic 45) · ×1
  • AppShell.AppShell (cyclomatic 45) desktop/src/app/AppShell.tsx:111 — AppShell.AppShell has cyclomatic complexity 45 (threshold 15). Of this number, 26 points are the body's own statements and 19 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · modelCapabilities.labelFromModelBody (cyclomatic 45) · ×1
  • modelCapabilities.labelFromModelBody (cyclomatic 45) desktop/src/features/agents/ui/modelCapabilities.ts:541 — modelCapabilities.labelFromModelBody has cyclomatic complexity 45 (threshold 15). Of this number, 42 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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, 23 points are the body's own statements and 22 belong to 8 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ProfileSetupPage.build (cyclomatic 44) · ×1
  • ProfileSetupPage.build (cyclomatic 44) mobile/lib/features/profile/profile_setup_page.dart:33 — ProfileSetupPage.build 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 · 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, 34 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · AgentAvatarPicker.build (cyclomatic 43) · ×1
  • AgentAvatarPicker.build (cyclomatic 43) mobile/lib/features/agents/agent_avatar_picker.dart:100 — AgentAvatarPicker.build 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.
D1 · Cyclomatic Complexity · HomePage.build (cyclomatic 43) · ×1
  • HomePage.build (cyclomatic 43) mobile/lib/features/home/home_page.dart:64 — HomePage.build has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProfileAvatarCropPage.build (cyclomatic 43) · ×1
  • ProfileAvatarCropPage.build (cyclomatic 43) mobile/lib/shared/widgets/profile_avatar_crop_page.dart:27 — ProfileAvatarCropPage.build has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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, 23 points are the body's own statements and 20 belong to 10 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useInboxSelectionAnchor.useInboxSelectionAnchor (cyclomatic 43) · ×1
  • useInboxSelectionAnchor.useInboxSelectionAnchor (cyclomatic 43) desktop/src/features/home/useInboxSelectionAnchor.ts:66 — useInboxSelectionAnchor.useInboxSelectionAnchor has cyclomatic complexity 43 (threshold 15). Of this number, 20 points are the body's own statements and 23 belong to 9 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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:450 — HuddleTransport._handleJoined has cyclomatic complexity 42 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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). Most of this is not in the body itself: 15 of the 42 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 326, handleSave, a function literal at line 410, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 16 function literals inside it that branch (lines 130, 105, 193, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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:51 — InvitePage.InvitePage has cyclomatic complexity 42 (threshold 15). Of this number, 25 points are the body's own statements and 17 belong to 11 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentInstanceEditDialog.AgentInstanceEditDialog (cyclomatic 41) · ×1
  • AgentInstanceEditDialog.AgentInstanceEditDialog (cyclomatic 41) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:102 — AgentInstanceEditDialog.AgentInstanceEditDialog has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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, 21 points are the body's own statements and 20 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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, 29 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · relayReconnectReplay.replayLiveSubscriptions (cyclomatic 41) · ×1
  • relayReconnectReplay.replayLiveSubscriptions (cyclomatic 41) desktop/src/shared/api/relayReconnectReplay.ts:255 — relayReconnectReplay.replayLiveSubscriptions has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 7 of the 41 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 466, a function literal at line 308, a function literal at line 405, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · _CommunityLinkForm.build (cyclomatic 40) · ×1
  • _CommunityLinkForm.build (cyclomatic 40) mobile/lib/features/pairing/pairing_page/community_link_form.dart:29 — _CommunityLinkForm.build has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IosGlassNavigationButton.build (cyclomatic 40) · ×1
  • IosGlassNavigationButton.build (cyclomatic 40) mobile/lib/shared/widgets/ios_glass_navigation_button.dart:120 — IosGlassNavigationButton.build has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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, 17 points are the body's own statements and 23 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeProfileSetupCoordinator.openAvatar (cyclomatic 39) · ×1
  • NativeProfileSetupCoordinator.openAvatar (cyclomatic 39) mobile/ios/Runner/NativeProfileSetup.swift:92 — NativeProfileSetupCoordinator.openAvatar has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminConsoleStaffingTab.RestrictionsSection (cyclomatic 39) · ×1
  • AdminConsoleStaffingTab.RestrictionsSection (cyclomatic 39) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:160 — AdminConsoleStaffingTab.RestrictionsSection has cyclomatic complexity 39 (threshold 15). Of this number, 27 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 220, 252, 274, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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, 20 points are the body's own statements and 19 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminConsoleActionsTab.ActionsSection (cyclomatic 38) · ×1
  • AdminConsoleActionsTab.ActionsSection (cyclomatic 38) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:375 — AdminConsoleActionsTab.ActionsSection has cyclomatic complexity 38 (threshold 15). Of this number, 30 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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, 31 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommunitySwitcher.CommunitySwitcher (cyclomatic 38) · ×1
  • CommunitySwitcher.CommunitySwitcher (cyclomatic 38) desktop/src/features/communities/ui/CommunitySwitcher.tsx:113 — CommunitySwitcher.CommunitySwitcher has cyclomatic complexity 38 (threshold 15). Of this number, 22 points are the body's own statements and 16 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · NsecImportSheet.build (cyclomatic 37) · ×1
  • NsecImportSheet.build (cyclomatic 37) mobile/lib/shared/identity_transfer/nsec_import_sheet.dart:50 — NsecImportSheet.build 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 · 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 · AddMemberDialog.DirectAddMemberForm (cyclomatic 37) · ×1
  • AddMemberDialog.DirectAddMemberForm (cyclomatic 37) desktop/src/features/community-members/ui/AddMemberDialog.tsx:51 — AddMemberDialog.DirectAddMemberForm has cyclomatic complexity 37 (threshold 15). Of this number, 19 points are the body's own statements and 18 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · useVoiceNoteRecorder.useVoiceNoteRecorder.start (cyclomatic 37) · ×1
  • useVoiceNoteRecorder.useVoiceNoteRecorder.start (cyclomatic 37) desktop/src/features/messages/lib/useVoiceNoteRecorder.ts:68 — useVoiceNoteRecorder.useVoiceNoteRecorder.start has cyclomatic complexity 37 (threshold 15). Of this number, 16 points are the body's own statements and 21 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · TopbarSearch.TopbarSearch (cyclomatic 37) · ×1
  • TopbarSearch.TopbarSearch (cyclomatic 37) desktop/src/features/search/ui/TopbarSearch.tsx:376 — TopbarSearch.TopbarSearch has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch::renderSearchResultRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · MessageContent._buildLink (cyclomatic 36) · ×1
  • MessageContent._buildLink (cyclomatic 36) mobile/lib/features/channels/message_content.dart:669 — MessageContent._buildLink 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 · DeviceVoiceNotePlayerController._loadPendingRemote (cyclomatic 35) · ×1
  • DeviceVoiceNotePlayerController._loadPendingRemote (cyclomatic 35) mobile/lib/features/channels/voice_note_recording.dart:592 — DeviceVoiceNotePlayerController._loadPendingRemote has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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). Most of this is not in the body itself: 11 of the 35 points are its own statements and the rest belongs to 12 function items inside it that branch (buildSubmitInput, handleSubmit, a function literal at line 112, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useCommunityInit.useCommunityInit (cyclomatic 35) · ×1
  • useCommunityInit.useCommunityInit (cyclomatic 35) desktop/src/features/communities/useCommunityInit.ts:131 — useCommunityInit.useCommunityInit has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to one function literal inside it that branches (line 186). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
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 · machineOnboarding.useMachineOnboardingState (cyclomatic 35) · ×1
  • machineOnboarding.useMachineOnboardingState (cyclomatic 35) desktop/src/features/onboarding/machineOnboarding.ts:99 — machineOnboarding.useMachineOnboardingState has cyclomatic complexity 35 (threshold 15). Of this number, 23 points are the body's own statements and 12 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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, 17 points are the body's own statements and 18 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SliverChannelsList.build (cyclomatic 34) · ×1
  • _SliverChannelsList.build (cyclomatic 34) mobile/lib/features/channels/channels_page/body.dart:224 — _SliverChannelsList.build has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PresenceCacheNotifier._subscribe (cyclomatic 34) · ×1
  • PresenceCacheNotifier._subscribe (cyclomatic 34) mobile/lib/features/profile/presence_cache_provider.dart:149 — PresenceCacheNotifier._subscribe 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 · useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow (cyclomatic 34) · ×1
  • useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow (cyclomatic 34) desktop/src/features/messages/ui/useMentionSendFlow.ts:723 — useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 items inside it that branch (a function literal at line 467, sendMessage, a function literal at line 357, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
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:84 — 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 · MediaVideoViewerPage.build (cyclomatic 33) · ×1
  • MediaVideoViewerPage.build (cyclomatic 33) mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19 — MediaVideoViewerPage.build has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConcentricSheetSurface.build (cyclomatic 33) · ×1
  • ConcentricSheetSurface.build (cyclomatic 33) mobile/lib/shared/widgets/concentric_sheet_surface.dart:119 — ConcentricSheetSurface.build has cyclomatic complexity 33 (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 · OnboardingStepPage.build (cyclomatic 33) · ×1
  • OnboardingStepPage.build (cyclomatic 33) mobile/lib/shared/widgets/onboarding_step_page.dart:37 — OnboardingStepPage.build has cyclomatic complexity 33 (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 · 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 · AppDelegate.handleQrScannerMethodCall (cyclomatic 32) · ×1
  • AppDelegate.handleQrScannerMethodCall (cyclomatic 32) mobile/ios/Runner/AppDelegate.swift:474 — AppDelegate.handleQrScannerMethodCall has cyclomatic complexity 32 (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 · IosNavigationBarView.layout (cyclomatic 32) · ×1
  • IosNavigationBarView.layout (cyclomatic 32) mobile/ios/Runner/IosNavigationBar.swift:438 — IosNavigationBarView.layout 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 · _InboxRow.build (cyclomatic 32) · ×1
  • _InboxRow.build (cyclomatic 32) mobile/lib/features/activity/activity_page/inbox_row.dart:34 — _InboxRow.build has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _HuddleCallAvatar.build (cyclomatic 32) · ×1
  • _HuddleCallAvatar.build (cyclomatic 32) mobile/lib/features/channels/channel_detail_page/huddle_call_avatar.dart:32 — _HuddleCallAvatar.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 · _HuddleJoinSurface.build (cyclomatic 32) · ×1
  • _HuddleJoinSurface.build (cyclomatic 32) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:327 — _HuddleJoinSurface.build has cyclomatic complexity 32 (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 · ChannelMemberProfileActions.build (cyclomatic 32) · ×1
  • ChannelMemberProfileActions.build (cyclomatic 32) mobile/lib/features/channels/channel_member_profile_actions.dart:26 — ChannelMemberProfileActions.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 · VoiceNoteComposerRecorder.build (cyclomatic 32) · ×1
  • VoiceNoteComposerRecorder.build (cyclomatic 32) mobile/lib/features/channels/voice_note_composer_recorder.dart:35 — VoiceNoteComposerRecorder.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 · _ProfileSetupForm.build (cyclomatic 32) · ×1
  • _ProfileSetupForm.build (cyclomatic 32) mobile/lib/features/profile/profile_setup_page/form.dart:18 — _ProfileSetupForm.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 · AdminConsoleCommunities.CommunitiesTab (cyclomatic 32) · ×1
  • AdminConsoleCommunities.CommunitiesTab (cyclomatic 32) desktop/src/features/admin-console/AdminConsoleCommunities.tsx:37 — AdminConsoleCommunities.CommunitiesTab has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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, 22 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 items inside it that branch (handleModelChange, a function literal at line 80, a function literal at line 66, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useInboxThreadContext.useInboxThreadContext (cyclomatic 32) · ×1
  • useInboxThreadContext.useInboxThreadContext (cyclomatic 32) desktop/src/features/home/useInboxThreadContext.ts:49 — useInboxThreadContext.useInboxThreadContext has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 93, 110, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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, 18 points are the body's own statements and 14 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · ChannelsNotifier.build (cyclomatic 31) · ×1
  • ChannelsNotifier.build (cyclomatic 31) mobile/lib/features/channels/channels_provider.dart:206 — ChannelsNotifier.build has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _IOSInlinePhotoPicker.build (cyclomatic 31) · ×1
  • _IOSInlinePhotoPicker.build (cyclomatic 31) mobile/lib/features/channels/compose_bar/ios_photo_picker.dart:25 — _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 · VoiceNoteAttachment.build (cyclomatic 31) · ×1
  • VoiceNoteAttachment.build (cyclomatic 31) mobile/lib/features/channels/voice_note_attachment.dart:45 — VoiceNoteAttachment.build has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NativeCommunityEntry.show (cyclomatic 31) · ×1
  • NativeCommunityEntry.show (cyclomatic 31) mobile/lib/shared/identity_transfer/native_community_entry.dart:14 — NativeCommunityEntry.show has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentInstanceEditDialog.AgentInstanceEditDialog · ×1
  • AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit (cyclomatic 31) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:649 — AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · useComposerLinkPreviews.useComposerLinkPreviews (cyclomatic 31) · ×1
  • useComposerLinkPreviews.useComposerLinkPreviews (cyclomatic 31) desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:273 — useComposerLinkPreviews.useComposerLinkPreviews has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 443, 457, 385, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 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.
D1 · Cyclomatic Complexity · GitStore · ×1
  • GitStore::run_conformance_probe (cyclomatic 30) crates/buzz-relay/src/api/git/store.rs:597 — GitStore::run_conformance_probe 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.
D1 · Cyclomatic Complexity · AppDelegate.didInitializeImplicitFlutterEngine (cyclomatic 30) · ×1
  • AppDelegate.didInitializeImplicitFlutterEngine (cyclomatic 30) mobile/ios/Runner/AppDelegate.swift:71 — AppDelegate.didInitializeImplicitFlutterEngine 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 · DefaultAgentLauncher.build (cyclomatic 30) · ×1
  • DefaultAgentLauncher.build (cyclomatic 30) mobile/lib/features/channels/default_agent_launcher.dart:28 — DefaultAgentLauncher.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 · _ThreadMessageList.build (cyclomatic 30) · ×1
  • _ThreadMessageList.build (cyclomatic 30) mobile/lib/features/channels/thread_detail_page/message_list.dart:159 — _ThreadMessageList.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 · BrowserAuth.receive (cyclomatic 30) · ×1
  • BrowserAuth.receive (cyclomatic 30) mobile/lib/shared/hosted/browser_auth.dart:183 — BrowserAuth.receive 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 · HostedRelayAuth._issue (cyclomatic 30) · ×1
  • HostedRelayAuth._issue (cyclomatic 30) mobile/lib/shared/hosted/hosted_relay_auth.dart:331 — HostedRelayAuth._issue 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 · AdminConsoleStaffingTab.StaffingTab (cyclomatic 30) · ×1
  • AdminConsoleStaffingTab.StaffingTab (cyclomatic 30) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:442 — AdminConsoleStaffingTab.StaffingTab has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · agentSessionTranscriptHelpers.parseSystemPromptSections (cyclomatic 30) · ×1
  • agentSessionTranscriptHelpers.parseSystemPromptSections (cyclomatic 30) REDACTED:138 — agentSessionTranscriptHelpers.parseSystemPromptSections has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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, 16 points are the body's own statements and 14 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · hooks.useChannelSubscription (cyclomatic 30) · ×1
  • hooks.useChannelSubscription (cyclomatic 30) desktop/src/features/messages/hooks.ts:319 — hooks.useChannelSubscription has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 328, 399, 407, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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, 15 points are the body's own statements and 15 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 items inside it that branch (a function literal at line 94, a function literal at line 140, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · NativeProfileSetupCoordinator.init (cyclomatic 29) · ×1
  • NativeProfileSetupCoordinator.init (cyclomatic 29) mobile/ios/Runner/NativeProfileSetup.swift:26 — NativeProfileSetupCoordinator.init 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 · _MarkdownEditingController._snapSelectionToChips (cyclomatic 29) · ×1
  • _MarkdownEditingController._snapSelectionToChips (cyclomatic 29) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:84 — _MarkdownEditingController._snapSelectionToChips 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 · PairingNotifier._handlePairingEvent (cyclomatic 29) · ×1
  • PairingNotifier._handlePairingEvent (cyclomatic 29) mobile/lib/features/pairing/pairing_provider.dart:499 — PairingNotifier._handlePairingEvent has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoteAgentController.create (cyclomatic 29) · ×1
  • RemoteAgentController.create (cyclomatic 29) mobile/lib/shared/agents/remote_agents.dart:600 — RemoteAgentController.create 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 · IosNavigationMetrics.updateRail (cyclomatic 29) · ×1
  • IosNavigationMetrics.updateRail (cyclomatic 29) mobile/lib/shared/widgets/ios_navigation_metrics.dart:28 — IosNavigationMetrics.updateRail 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 · useHuddlePresentation.useHuddlePresentation (cyclomatic 29) · ×1
  • useHuddlePresentation.useHuddlePresentation (cyclomatic 29) desktop/src/app/useHuddlePresentation.ts:31 — useHuddlePresentation.useHuddlePresentation has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 5 of the 29 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 395, 109, 384, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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: 12 of the 29 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 187, a function literal at line 72, a function literal at line 236, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (openRuntime, a function literal at line 1008, a function literal at line 1035, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · terminalBanner.buildTerminalBanner (cyclomatic 29) · ×1
  • terminalBanner.buildTerminalBanner (cyclomatic 29) desktop/src/features/terminal/terminalBanner.ts:121 — terminalBanner.buildTerminalBanner has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 5 function literals inside it that branch (lines 152, 190, 235, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · bees.stepBees (cyclomatic 29) · ×1
  • bees.stepBees (cyclomatic 29) web/src/features/invite/ui/bees.ts:104 — bees.stepBees 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 one function literal inside it that branches (line 114). 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 · OrganizationAppEntry.build (cyclomatic 28) · ×1
  • OrganizationAppEntry.build (cyclomatic 28) mobile/lib/organization_app_entry.dart:23 — OrganizationAppEntry.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 · _RecentPhotoGalleryPicker.build (cyclomatic 28) · ×1
  • _RecentPhotoGalleryPicker.build (cyclomatic 28) mobile/lib/features/channels/compose_bar/photo_gallery_picker.dart:54 — _RecentPhotoGalleryPicker.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 · ReplySummaryLink.build (cyclomatic 28) · ×1
  • ReplySummaryLink.build (cyclomatic 28) mobile/lib/features/channels/reply_summary_link.dart:38 — ReplySummaryLink.build has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PairingNotifier._continueAfterSas (cyclomatic 28) · ×1
  • PairingNotifier._continueAfterSas (cyclomatic 28) mobile/lib/features/pairing/pairing_provider.dart:188 — PairingNotifier._continueAfterSas has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedBackupService._backup (cyclomatic 28) · ×1
  • HostedBackupService._backup (cyclomatic 28) mobile/lib/shared/hosted/hosted_backup_service.dart:56 — HostedBackupService._backup has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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, 18 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · 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 · TopbarSearch.TopbarSearch · ×1
  • TopbarSearch.TopbarSearch::renderSearchResultRow (cyclomatic 28) desktop/src/features/search/ui/TopbarSearch.tsx:655 — TopbarSearch.TopbarSearch::renderSearchResultRow has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · useSearchResults.useSearchResults (cyclomatic 28) · ×1
  • useSearchResults.useSearchResults (cyclomatic 28) desktop/src/features/search/useSearchResults.ts:102 — useSearchResults.useSearchResults has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · HostedFlow._initialize (cyclomatic 27) · ×1
  • HostedFlow._initialize (cyclomatic 27) mobile/lib/shared/hosted/hosted_flow.dart:280 — HostedFlow._initialize has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedFlow._continueCommunities (cyclomatic 27) · ×1
  • HostedFlow._continueCommunities (cyclomatic 27) mobile/lib/shared/hosted/hosted_flow.dart:900 — HostedFlow._continueCommunities 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 3 function literals inside it that branch (lines 56, 39, 32). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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 · 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 · 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 · _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 · MembersSheet.build (cyclomatic 26) · ×1
  • MembersSheet.build (cyclomatic 26) mobile/lib/features/channels/members_sheet.dart:37 — MembersSheet.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 · DeviceVoiceNotePlayerController._toggle (cyclomatic 26) · ×1
  • DeviceVoiceNotePlayerController._toggle (cyclomatic 26) mobile/lib/features/channels/voice_note_recording.dart:811 — DeviceVoiceNotePlayerController._toggle 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 · HomeScreenShortcutHost.build (cyclomatic 26) · ×1
  • HomeScreenShortcutHost.build (cyclomatic 26) mobile/lib/features/home/home_screen_shortcut_host.dart:32 — HomeScreenShortcutHost.build has cyclomatic complexity 26 (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 · HostedAdmission.prepare (cyclomatic 26) · ×1
  • HostedAdmission.prepare (cyclomatic 26) mobile/lib/shared/hosted/hosted_admission.dart:39 — HostedAdmission.prepare 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 · HostedFlow.signInAccount (cyclomatic 26) · ×1
  • HostedFlow.signInAccount (cyclomatic 26) mobile/lib/shared/hosted/hosted_flow.dart:372 — HostedFlow.signInAccount 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 · _CreateMenuRoute.buildPage (cyclomatic 26) · ×1
  • _CreateMenuRoute.buildPage (cyclomatic 26) mobile/lib/shared/widgets/android_expanding_menu_button.dart:167 — _CreateMenuRoute.buildPage has cyclomatic complexity 26 (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 · usePersonaModelDiscovery.usePersonaModelDiscovery (cyclomatic 26) · ×1
  • usePersonaModelDiscovery.usePersonaModelDiscovery (cyclomatic 26) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:200 — usePersonaModelDiscovery.usePersonaModelDiscovery has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body's own statements and 12 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PersonaModelCombobox.PersonaModelCombobox (cyclomatic 26) · ×1
  • PersonaModelCombobox.PersonaModelCombobox (cyclomatic 26) desktop/src/features/agents/ui/PersonaModelCombobox.tsx:22 — PersonaModelCombobox.PersonaModelCombobox has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 8 function items inside it that branch (handleKeyDown, a function literal at line 182, a function literal at line 104, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · InboxListPane.InboxListPane · ×1
  • InboxListPane.InboxListPane::renderItem (cyclomatic 26) desktop/src/features/home/ui/InboxListPane.tsx:309 — InboxListPane.InboxListPane::renderItem has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 326, handleSubmit, a function literal at line 361, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · 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 · NativePhotoZoomViewController.layoutGallery (cyclomatic 25) · ×1
  • NativePhotoZoomViewController.layoutGallery (cyclomatic 25) mobile/ios/Runner/NativePhotoZoomCoordinator.swift:258 — NativePhotoZoomViewController.layoutGallery 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 · ActivityNotifier._fetch (cyclomatic 25) · ×1
  • ActivityNotifier._fetch (cyclomatic 25) mobile/lib/features/activity/activity_provider.dart:456 — 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 · _ConversationAppBarTitle.build (cyclomatic 25) · ×1
  • _ConversationAppBarTitle.build (cyclomatic 25) mobile/lib/features/channels/channel_detail_page/app_bar.dart:36 — _ConversationAppBarTitle.build has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SearchBody.build (cyclomatic 25) · ×1
  • _SearchBody.build (cyclomatic 25) mobile/lib/features/search/search_page.dart:332 — _SearchBody.build 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 · RelaySessionNotifier._handleClosed (cyclomatic 25) · ×1
  • RelaySessionNotifier._handleClosed (cyclomatic 25) mobile/lib/shared/relay/relay_session.dart:883 — RelaySessionNotifier._handleClosed has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminConsoleReportsTab.ResolveReportForm (cyclomatic 25) · ×1
  • AdminConsoleReportsTab.ResolveReportForm (cyclomatic 25) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:367 — AdminConsoleReportsTab.ResolveReportForm has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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, 14 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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, 16 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 198, a function literal at line 89, authorLabel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · 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). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (submitFeedback, selectCategory, attachImage, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch (a function literal at line 226, a function literal at line 299, handleRemove, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cyclomatic 25) · ×1
  • useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cyclomatic 25) desktop/src/features/sidebar/ui/useSidebarRelayConnectionCard.ts:63 — useSidebarRelayConnectionCard.useSidebarRelayConnectionCard has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · inviteHelpers.parseInviteInput (cyclomatic 25) · ×1
  • inviteHelpers.parseInviteInput (cyclomatic 25) REDACTED:26 — inviteHelpers.parseInviteInput has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RelayClient.handleWsMessage (cyclomatic 25) · ×1
  • RelayClient.handleWsMessage (cyclomatic 25) desktop/src/shared/api/relayClientSession.ts:865 — RelayClient.handleWsMessage 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 · 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 · NipFiRelayConfig · ×1
  • NipFiRelayConfig::from_env (cyclomatic 24) crates/buzz-relay/src/nip_fi_config.rs:305 — NipFiRelayConfig::from_env 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 · ClientMessage · ×1
  • ClientMessage::parse (cyclomatic 24) crates/buzz-relay/src/protocol.rs:70 — ClientMessage::parse 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 · IosNavigationBarView.makeItem (cyclomatic 24) · ×1
  • IosNavigationBarView.makeItem (cyclomatic 24) mobile/ios/Runner/IosNavigationBar.swift:1077 — IosNavigationBarView.makeItem 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 · BestieAgentAction.build (cyclomatic 24) · ×1
  • BestieAgentAction.build (cyclomatic 24) mobile/lib/features/agents/bestie_agent_action.dart:23 — BestieAgentAction.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 · _VideoTransportBar.build (cyclomatic 24) · ×1
  • _VideoTransportBar.build (cyclomatic 24) mobile/lib/features/channels/media_viewer_page/video_controls.dart:64 — _VideoTransportBar.build has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InviteJoinSheet.build (cyclomatic 24) · ×1
  • InviteJoinSheet.build (cyclomatic 24) mobile/lib/features/invites/invite_join_sheet.dart:87 — InviteJoinSheet.build has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RemoteAgentController.deleteAgent (cyclomatic 24) · ×1
  • RemoteAgentController.deleteAgent (cyclomatic 24) mobile/lib/shared/agents/remote_agents.dart:826 — RemoteAgentController.deleteAgent 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 · MeGroups.decode (cyclomatic 24) · ×1
  • MeGroups.decode (cyclomatic 24) mobile/lib/shared/me/me_groups.dart:21 — MeGroups.decode has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _BuzzPushLifecycle.build (cyclomatic 24) · ×1
  • _BuzzPushLifecycle.build (cyclomatic 24) mobile/lib/shared/push/push_bootstrap.dart:323 — _BuzzPushLifecycle.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 · CommunityThemeNotifier.build (cyclomatic 24) · ×1
  • CommunityThemeNotifier.build (cyclomatic 24) mobile/lib/shared/theme/community_theme_provider.dart:23 — 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). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (handleAdd, a function literal at line 43, a function literal at line 53, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM (cyclomatic 24) · ×1
  • plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM (cyclomatic 24) desktop/src/features/messages/lib/plainTextProjection.ts:231 — plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · 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 · 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 items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · localStorageSweep.sweepChunked · ×1
  • localStorageSweep.sweepChunked::processSlice (cyclomatic 24) desktop/src/shared/lib/localStorageSweep.ts:215 — localStorageSweep.sweepChunked::processSlice has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ThemeProvider.ThemeProvider (cyclomatic 24) · ×1
  • ThemeProvider.ThemeProvider (cyclomatic 24) desktop/src/shared/theme/ThemeProvider.tsx:548 — ThemeProvider.ThemeProvider has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 746, 605, 623, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · TypingMotionPreview.build (cyclomatic 23) · ×1
  • TypingMotionPreview.build (cyclomatic 23) mobile/lib/features/channels/typing_motion_preview.dart:18 — TypingMotionPreview.build has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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, 20 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · 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). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · useMentions.useMentions.handleMentionKeyDown (cyclomatic 23) · ×1
  • useMentions.useMentions.handleMentionKeyDown (cyclomatic 23) desktop/src/features/messages/lib/useMentions.ts:839 — useMentions.useMentions.handleMentionKeyDown has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · TimelineMessageRow.MessageRowItem (cyclomatic 23) · ×1
  • TimelineMessageRow.MessageRowItem (cyclomatic 23) desktop/src/features/messages/ui/TimelineMessageRow.tsx:94 — TimelineMessageRow.MessageRowItem has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · hooks.useFirstRunOnboardingGate (cyclomatic 23) · ×1
  • hooks.useFirstRunOnboardingGate (cyclomatic 23) desktop/src/features/onboarding/hooks.ts:282 — hooks.useFirstRunOnboardingGate has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 324, 391, 310, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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 items inside it that branch (a function literal at line 1089, a function literal at line 1008, a function literal at line 1057, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AppDelegate.handleMediaUploadMethodCall (cyclomatic 22) · ×1
  • AppDelegate.handleMediaUploadMethodCall (cyclomatic 22) mobile/ios/Runner/AppDelegate.swift:805 — 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 · _AgentsNavigation.build (cyclomatic 22) · ×1
  • _AgentsNavigation.build (cyclomatic 22) mobile/lib/features/agents/agents_page.dart:133 — _AgentsNavigation.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 · _ReadOnlyNotice.build (cyclomatic 22) · ×1
  • _ReadOnlyNotice.build (cyclomatic 22) mobile/lib/features/channels/channel_detail_page/banners.dart:8 — _ReadOnlyNotice.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 · _MobileHuddleCallPage.build (cyclomatic 22) · ×1
  • _MobileHuddleCallPage.build (cyclomatic 22) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:584 — _MobileHuddleCallPage.build has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsProfileHeader.build (cyclomatic 22) · ×1
  • SettingsProfileHeader.build (cyclomatic 22) mobile/lib/features/profile/settings_profile_header.dart:30 — SettingsProfileHeader.build has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SelfHostedEntry.prepare (cyclomatic 22) · ×1
  • SelfHostedEntry.prepare (cyclomatic 22) mobile/lib/shared/hosted/self_hosted_entry.dart:61 — SelfHostedEntry.prepare 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 · MeSync.update (cyclomatic 22) · ×1
  • MeSync.update (cyclomatic 22) mobile/lib/shared/me/me_sync.dart:380 — MeSync.update has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommunityThemeSyncManager.flush (cyclomatic 22) · ×1
  • CommunityThemeSyncManager.flush (cyclomatic 22) mobile/lib/shared/theme/community_theme_sync.dart:230 — CommunityThemeSyncManager.flush has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useCommunities.resolveCommunityUpdateResult (cyclomatic 22) · ×1
  • useCommunities.resolveCommunityUpdateResult (cyclomatic 22) desktop/src/features/communities/useCommunities.tsx:43 — useCommunities.resolveCommunityUpdateResult has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · 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 · 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_search · ×1
  • buzz_search::query::search (cyclomatic 21) crates/buzz-search/src/query.rs:269 — buzz_search::query::search 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 · WorkflowEngine · ×1
  • WorkflowEngine::cron_tick (cyclomatic 21) crates/buzz-workflow/src/lib.rs:586 — WorkflowEngine::cron_tick 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 · NativeAddMembersSheetCoordinator.handle (cyclomatic 21) · ×1
  • NativeAddMembersSheetCoordinator.handle (cyclomatic 21) mobile/ios/Runner/NativeAddMembersSheet.swift:24 — NativeAddMembersSheetCoordinator.handle 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 · NativeCreateChannelViewController.tableView (cyclomatic 21) · ×1
  • NativeCreateChannelViewController.tableView (cyclomatic 21) mobile/ios/Runner/NativeCreateChannelSheet.swift:204 — NativeCreateChannelViewController.tableView 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:374 — 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 · _SetStatusSheet.build (cyclomatic 21) · ×1
  • _SetStatusSheet.build (cyclomatic 21) mobile/lib/features/profile/set_status_sheet.dart:178 — _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 · BuilderlabBuild.parse (cyclomatic 21) · ×1
  • BuilderlabBuild.parse (cyclomatic 21) mobile/lib/shared/hosted/builderlab_build.dart:72 — BuilderlabBuild.parse has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · IosScrollToTop.build (cyclomatic 21) · ×1
  • IosScrollToTop.build (cyclomatic 21) mobile/lib/shared/widgets/ios_scroll_to_top.dart:17 — IosScrollToTop.build has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useObserverEvents.useLoadArchivedObserverEvents (cyclomatic 21) · ×1
  • useObserverEvents.useLoadArchivedObserverEvents (cyclomatic 21) desktop/src/features/agents/ui/useObserverEvents.ts:115 — useObserverEvents.useLoadArchivedObserverEvents has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 210, 381, 205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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 · 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 2 function literals inside it that branch (lines 88, 85). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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 · CommandVerifier · ×1
  • CommandVerifier::authenticate_at (cyclomatic 20) crates/buzz-auth/src/nip_fi/command.rs:325 — CommandVerifier::authenticate_at has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · IosNavigationBarView.makeControlGroup (cyclomatic 20) · ×1
  • IosNavigationBarView.makeControlGroup (cyclomatic 20) mobile/ios/Runner/IosNavigationBar.swift:990 — IosNavigationBarView.makeControlGroup 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 · ThemePaginationControl.updateDots (cyclomatic 20) · ×1
  • ThemePaginationControl.updateDots (cyclomatic 20) mobile/ios/Runner/ThemePaginationGlassControl.swift:204 — ThemePaginationControl.updateDots has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChannelsBody.build (cyclomatic 20) · ×1
  • _ChannelsBody.build (cyclomatic 20) mobile/lib/features/channels/channels_page/body.dart:38 — _ChannelsBody.build has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MobileHuddleController._finishLeaveLifecycle (cyclomatic 20) · ×1
  • MobileHuddleController._finishLeaveLifecycle (cyclomatic 20) mobile/lib/features/channels/mobile_huddle_controller.dart:450 — MobileHuddleController._finishLeaveLifecycle 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 · _VideoFileDownload._fetch (cyclomatic 20) · ×1
  • _VideoFileDownload._fetch (cyclomatic 20) mobile/lib/features/channels/native_video_files.dart:87 — _VideoFileDownload._fetch 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 · _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 · _PairingCodeEntry.build (cyclomatic 20) · ×1
  • _PairingCodeEntry.build (cyclomatic 20) mobile/lib/features/pairing/pairing_page/pairing_code_entry.dart:22 — _PairingCodeEntry.build has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PresenceCacheNotifier._refresh (cyclomatic 20) · ×1
  • PresenceCacheNotifier._refresh (cyclomatic 20) mobile/lib/features/profile/presence_cache_provider.dart:302 — PresenceCacheNotifier._refresh has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HuddleSessionNotifier._wireMediaAndTransport (cyclomatic 20) · ×1
  • HuddleSessionNotifier._wireMediaAndTransport (cyclomatic 20) mobile/lib/shared/huddle/huddle_session.dart:408 — 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 · ChannelData.fromEvent (cyclomatic 20) · ×1
  • ChannelData.fromEvent (cyclomatic 20) mobile/lib/shared/relay/nostr_models.dart:330 — ChannelData.fromEvent 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 · AndroidTransparentAvatar.build (cyclomatic 20) · ×1
  • AndroidTransparentAvatar.build (cyclomatic 20) mobile/lib/shared/widgets/android_transparent_avatar.dart:20 — AndroidTransparentAvatar.build has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IosMessageCreateButton.build (cyclomatic 20) · ×1
  • IosMessageCreateButton.build (cyclomatic 20) mobile/lib/shared/widgets/ios_message_create_button.dart:81 — IosMessageCreateButton.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 · 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) REDACTED:602 — mentionHighlightExtension.selectionAfterMentionTrailingSpace has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 620, 647). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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, 17 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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, 17 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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:743 — RelayClient.sendRawWithReconnectRetry has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 784, send, isOwned, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch (handlePointerMove, a function literal at line 83, handlePointerDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · installNativeRig.ingest (cyclomatic 20) · ×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 · IosNavigationBarView.reportRailGeometry (cyclomatic 19) · ×1
  • IosNavigationBarView.reportRailGeometry (cyclomatic 19) mobile/ios/Runner/IosNavigationBar.swift:565 — IosNavigationBarView.reportRailGeometry 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 · NativeAddMembersViewController.configure (cyclomatic 19) · ×1
  • NativeAddMembersViewController.configure (cyclomatic 19) mobile/ios/Runner/NativeAddMembersSheet.swift:355 — NativeAddMembersViewController.configure 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 · _CommunityGridAction.build (cyclomatic 19) · ×1
  • _CommunityGridAction.build (cyclomatic 19) mobile/lib/features/channels/channels_page/community_switcher_action.dart:16 — _CommunityGridAction.build has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _AttachmentSurfacePanel.build (cyclomatic 19) · ×1
  • _AttachmentSurfacePanel.build (cyclomatic 19) mobile/lib/features/channels/compose_bar/attachments.dart:175 — _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 · _IOSAttachmentPopoverCoordinator.present (cyclomatic 19) · ×1
  • _IOSAttachmentPopoverCoordinator.present (cyclomatic 19) mobile/lib/features/channels/compose_bar/ios_attachment_popover.dart:42 — _IOSAttachmentPopoverCoordinator.present 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 · _MessageImageCarousel.build (cyclomatic 19) · ×1
  • _MessageImageCarousel.build (cyclomatic 19) mobile/lib/features/channels/message_content/media_carousel.dart:144 — _MessageImageCarousel.build has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _ThreadHeadScrollInput.build (cyclomatic 19) · ×1
  • _ThreadHeadScrollInput.build (cyclomatic 19) mobile/lib/features/channels/thread_detail_page/head_layout.dart:62 — _ThreadHeadScrollInput.build has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TypingAvatarCluster.build (cyclomatic 19) · ×1
  • TypingAvatarCluster.build (cyclomatic 19) mobile/lib/features/channels/typing_avatar_cluster.dart:14 — TypingAvatarCluster.build has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsPage.build (cyclomatic 19) · ×1
  • SettingsPage.build (cyclomatic 19) mobile/lib/features/settings/settings_page.dart:77 — SettingsPage.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 · CoveredRouteKeyboardInsets.build (cyclomatic 19) · ×1
  • CoveredRouteKeyboardInsets.build (cyclomatic 19) mobile/lib/shared/widgets/covered_route_keyboard_insets.dart:38 — CoveredRouteKeyboardInsets.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 · FilterChipBar._chip (cyclomatic 19) · ×1
  • FilterChipBar._chip (cyclomatic 19) mobile/lib/shared/widgets/filter_chip_bar.dart:196 — FilterChipBar._chip 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 · newAppInstallerDownload.reduceInstallerDialog (cyclomatic 19) · ×1
  • newAppInstallerDownload.reduceInstallerDialog (cyclomatic 19) desktop/src/app/newAppInstallerDownload.ts:54 — newAppInstallerDownload.reduceInstallerDialog 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 · 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, 14 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · useNonMemberInvite.useNonMemberInvite.invite (cyclomatic 19) · ×1
  • useNonMemberInvite.useNonMemberInvite.invite (cyclomatic 19) desktop/src/features/messages/ui/useNonMemberInvite.ts:79 — useNonMemberInvite.useNonMemberInvite.invite has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 94, isCurrent, a function literal at line 150, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSubmit, a function literal at line 89, a function literal at line 37, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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, 13 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useChannelMutes.useChannelMutes (cyclomatic 19) · ×1
  • useChannelMutes.useChannelMutes (cyclomatic 19) desktop/src/features/sidebar/lib/useChannelMutes.ts:19 — useChannelMutes.useChannelMutes has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useChannelStars.useChannelStars (cyclomatic 19) · ×1
  • useChannelStars.useChannelStars (cyclomatic 19) desktop/src/features/sidebar/lib/useChannelStars.ts:19 — useChannelStars.useChannelStars has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 items inside it that branch (ensureScene, start, draw, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · markdown.createMarkdownComponents.a (cyclomatic 19) · ×1
  • markdown.createMarkdownComponents.a (cyclomatic 19) desktop/src/shared/ui/markdown.tsx:1220 — markdown.createMarkdownComponents.a has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · buzz_pubsub · ×1
  • buzz_pubsub::subscriber::connect_and_subscribe (cyclomatic 18) crates/buzz-pubsub/src/subscriber.rs:95 — buzz_pubsub::subscriber::connect_and_subscribe 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 · NativePhotoZoomViewController.load (cyclomatic 18) · ×1
  • NativePhotoZoomViewController.load (cyclomatic 18) mobile/ios/Runner/NativePhotoZoomCoordinator.swift:378 — NativePhotoZoomViewController.load 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 · DeleteAgentAction.build (cyclomatic 18) · ×1
  • DeleteAgentAction.build (cyclomatic 18) mobile/lib/features/agents/delete_agent_action.dart:30 — DeleteAgentAction.build has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoteAgentModelControl.build (cyclomatic 18) · ×1
  • RemoteAgentModelControl.build (cyclomatic 18) mobile/lib/features/agents/remote_agent_model_control.dart:35 — RemoteAgentModelControl.build has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _VideoZoomSurface.build (cyclomatic 18) · ×1
  • _VideoZoomSurface.build (cyclomatic 18) mobile/lib/features/channels/media_viewer_page/video_zoom_surface.dart:27 — _VideoZoomSurface.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _MemberTile.build (cyclomatic 18) · ×1
  • _MemberTile.build (cyclomatic 18) mobile/lib/features/channels/members_sheet.dart:227 — _MemberTile.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 · MessageSwipeReply.build (cyclomatic 18) · ×1
  • MessageSwipeReply.build (cyclomatic 18) mobile/lib/features/channels/message_swipe_reply.dart:44 — MessageSwipeReply.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:514 — 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 · InviteJoinNotifier.confirmJoin (cyclomatic 18) · ×1
  • InviteJoinNotifier.confirmJoin (cyclomatic 18) mobile/lib/features/invites/invite_join_provider.dart:176 — InviteJoinNotifier.confirmJoin 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 · _WebsiteBeeMotion.advance (cyclomatic 18) · ×1
  • _WebsiteBeeMotion.advance (cyclomatic 18) mobile/lib/features/pairing/pairing_page/website_bee_motion.dart:68 — _WebsiteBeeMotion.advance 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 · _DynamicIslandQrScannerPortal.build (cyclomatic 18) · ×1
  • _DynamicIslandQrScannerPortal.build (cyclomatic 18) mobile/lib/features/pairing/pairing_qr_scanner/dynamic_island_portal.dart:20 — _DynamicIslandQrScannerPortal.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RemoteAgentController.ensureBinding (cyclomatic 18) · ×1
  • RemoteAgentController.ensureBinding (cyclomatic 18) mobile/lib/shared/agents/remote_agents.dart:415 — RemoteAgentController.ensureBinding 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 · VerifiedProfilesNotifier._syncBatches (cyclomatic 18) · ×1
  • VerifiedProfilesNotifier._syncBatches (cyclomatic 18) mobile/lib/shared/verified_profiles/verified_profile_directory.dart:286 — VerifiedProfilesNotifier._syncBatches 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 · IosMediaCarousel.build (cyclomatic 18) · ×1
  • IosMediaCarousel.build (cyclomatic 18) mobile/lib/shared/widgets/ios_media_carousel.dart:41 — IosMediaCarousel.build has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NewAppInstallerDialog.NewAppInstallerDialog (cyclomatic 18) · ×1
  • NewAppInstallerDialog.NewAppInstallerDialog (cyclomatic 18) desktop/src/app/NewAppInstallerDialog.tsx:71 — NewAppInstallerDialog.NewAppInstallerDialog has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · newAppInstaller.resolveInstallerUrl (cyclomatic 18) · ×1
  • newAppInstaller.resolveInstallerUrl (cyclomatic 18) desktop/src/app/newAppInstaller.ts:42 — newAppInstaller.resolveInstallerUrl 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 · AdminConsoleActionsTab.DirectActionsProvider (cyclomatic 18) · ×1
  • AdminConsoleActionsTab.DirectActionsProvider (cyclomatic 18) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:194 — AdminConsoleActionsTab.DirectActionsProvider has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 229, a function literal at line 257, locked, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AdminConsoleFeedbackTab.AttachmentViewer (cyclomatic 18) · ×1
  • AdminConsoleFeedbackTab.AttachmentViewer (cyclomatic 18) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx:171 — AdminConsoleFeedbackTab.AttachmentViewer has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 217, 278, 207, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useApplyTemplate.useApplyTemplate.applyAgents (cyclomatic 18) · ×1
  • useApplyTemplate.useApplyTemplate.applyAgents (cyclomatic 18) desktop/src/features/channel-templates/useApplyTemplate.ts:57 — useApplyTemplate.useApplyTemplate.applyAgents has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChannelBrowserDialog.selectBrowserChannels (cyclomatic 18) · ×1
  • ChannelBrowserDialog.selectBrowserChannels (cyclomatic 18) desktop/src/features/channels/ui/ChannelBrowserDialog.tsx:68 — ChannelBrowserDialog.selectBrowserChannels 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 2 function literals inside it that branch (lines 93, 110). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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, 10 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · BeeField.BeeField (cyclomatic 18) · ×1
  • BeeField.BeeField (cyclomatic 18) web/src/features/invite/ui/BeeField.tsx:66 — BeeField.BeeField has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 120, 174, 163, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-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 · 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 · NativeMessagePresentationCoordinator.handle (cyclomatic 17) · ×1
  • NativeMessagePresentationCoordinator.handle (cyclomatic 17) mobile/ios/Runner/NativeMessagePresentationCoordinator.swift:23 — NativeMessagePresentationCoordinator.handle 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 · MobileInviteJoinRecovery.ensureStarterChannels (cyclomatic 17) · ×1
  • MobileInviteJoinRecovery.ensureStarterChannels (cyclomatic 17) mobile/lib/app.dart:131 — MobileInviteJoinRecovery.ensureStarterChannels 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 · AgentModelPicker.build (cyclomatic 17) · ×1
  • AgentModelPicker.build (cyclomatic 17) mobile/lib/features/agents/agent_model_picker.dart:27 — AgentModelPicker.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 · _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:67 — _HuddleParticipantCluster.build has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ComposeBarLayout._buildBar (cyclomatic 17) · ×1
  • _ComposeBarLayout._buildBar (cyclomatic 17) mobile/lib/features/channels/compose_bar/layout.dart:88 — _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._maybeDispatch (cyclomatic 17) · ×1
  • _DeepLinkDispatcherState._maybeDispatch (cyclomatic 17) mobile/lib/features/channels/deep_link_dispatcher.dart:99 — _DeepLinkDispatcherState._maybeDispatch 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:439 — _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 · ReplyActivityHandoff.build (cyclomatic 17) · ×1
  • ReplyActivityHandoff.build (cyclomatic 17) mobile/lib/features/channels/reply_activity_handoff.dart:26 — ReplyActivityHandoff.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 · _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 · HostedJoinPolicyView.build (cyclomatic 17) · ×1
  • HostedJoinPolicyView.build (cyclomatic 17) mobile/lib/features/onboarding/hosted_join_policy_view.dart:21 — HostedJoinPolicyView.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 · SearchPage.build (cyclomatic 17) · ×1
  • SearchPage.build (cyclomatic 17) mobile/lib/features/search/search_page.dart:88 — SearchPage.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 · BrowserAuth.start (cyclomatic 17) · ×1
  • BrowserAuth.start (cyclomatic 17) mobile/lib/shared/hosted/browser_auth.dart:120 — BrowserAuth.start 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 · HuddleSessionNotifier.join (cyclomatic 17) · ×1
  • HuddleSessionNotifier.join (cyclomatic 17) mobile/lib/shared/huddle/huddle_session.dart:222 — 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:641 — HuddleTransport._handleRoster has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuzzPushLeaseDescriptor.fromRelayInformation (cyclomatic 17) · ×1
  • BuzzPushLeaseDescriptor.fromRelayInformation (cyclomatic 17) mobile/lib/shared/push/dev_push_lease.dart:50 — BuzzPushLeaseDescriptor.fromRelayInformation 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:379 — 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 · ReadStateManager._mergeEvents (cyclomatic 17) · ×1
  • ReadStateManager._mergeEvents (cyclomatic 17) mobile/lib/shared/read_state/read_state_manager.dart:395 — ReadStateManager._mergeEvents 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 · SkeletonReveal.build (cyclomatic 17) · ×1
  • SkeletonReveal.build (cyclomatic 17) mobile/lib/shared/widgets/skeleton_reveal.dart:36 — SkeletonReveal.build has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · usePersonaSync.startPersonaSync (cyclomatic 17) · ×1
  • usePersonaSync.startPersonaSync (cyclomatic 17) desktop/src/features/agents/lib/usePersonaSync.ts:279 — usePersonaSync.startPersonaSync has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function items inside it that branch (runBackfill, dispatchLive, onLiveEvent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · agentConfigOptions.computeLocalModeGate (cyclomatic 17) · ×1
  • agentConfigOptions.computeLocalModeGate (cyclomatic 17) desktop/src/features/agents/ui/agentConfigOptions.tsx:659 — agentConfigOptions.computeLocalModeGate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · useObserverEvents.useLoadArchivedObserverEvents.fetchOlderArchived (cyclomatic 17) · ×1
  • useObserverEvents.useLoadArchivedObserverEvents.fetchOlderArchived (cyclomatic 17) desktop/src/features/agents/ui/useObserverEvents.ts:272 — useObserverEvents.useLoadArchivedObserverEvents.fetchOlderArchived has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useUnreadChannels.useUnreadChannels.rawUnread (cyclomatic 17) · ×1
  • useUnreadChannels.useUnreadChannels.rawUnread (cyclomatic 17) desktop/src/features/channels/useUnreadChannels.ts:798 — useUnreadChannels.useUnreadChannels.rawUnread has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useChannelUnreadState.useChannelUnreadState (cyclomatic 17) · ×1
  • useChannelUnreadState.useChannelUnreadState (cyclomatic 17) desktop/src/features/channels/ui/useChannelUnreadState.ts:62 — useChannelUnreadState.useChannelUnreadState has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 275, 286, 123, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · hooks.usePresenceSession (cyclomatic 17) · ×1
  • hooks.usePresenceSession (cyclomatic 17) desktop/src/features/presence/hooks.ts:224 — hooks.usePresenceSession has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 392, 405, 410, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (handleSubmit, a function literal at line 99, a function literal at line 59). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · useSearchResults.useSearchResults.userResults (cyclomatic 17) · ×1
  • useSearchResults.useSearchResults.userResults (cyclomatic 17) desktop/src/features/search/useSearchResults.ts:331 — useSearchResults.useSearchResults.userResults has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (addCandidate). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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). Of this number, 9 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · 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 items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 7 function literals inside it that branch (lines 576, 567, 671, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · DeletionStore · ×1
  • DeletionStore::admit_owner_request (cyclomatic 16) REDACTED:976 — DeletionStore::admit_owner_request has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EntityDeletionStore · ×1
  • EntityDeletionStore::transition_stage (cyclomatic 16) REDACTED:214 — EntityDeletionStore::transition_stage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · buzz_push_gateway · ×1
  • buzz_push_gateway::http::deliver (cyclomatic 16) crates/buzz-push-gateway/src/http.rs:634 — buzz_push_gateway::http::deliver has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
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 · NativeProfileTextEditorCoordinator.handle (cyclomatic 16) · ×1
  • NativeProfileTextEditorCoordinator.handle (cyclomatic 16) mobile/ios/Runner/NativeProfileTextEditor.swift:30 — NativeProfileTextEditorCoordinator.handle 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 · App.build (cyclomatic 16) · ×1
  • App.build (cyclomatic 16) mobile/lib/app.dart:351 — App.build has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ActivityNotifier._resurfaceHiddenDm (cyclomatic 16) · ×1
  • ActivityNotifier._resurfaceHiddenDm (cyclomatic 16) mobile/lib/features/activity/activity_provider.dart:314 — 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 · _CreateChannelSheet.build (cyclomatic 16) · ×1
  • _CreateChannelSheet.build (cyclomatic 16) mobile/lib/features/channels/channels_page/sheets.dart:25 — _CreateChannelSheet.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 · _MarkdownEditingController.expandChipDeletion (cyclomatic 16) · ×1
  • _MarkdownEditingController.expandChipDeletion (cyclomatic 16) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:411 — _MarkdownEditingController.expandChipDeletion 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 · _MentionSuggestionInfo.build (cyclomatic 16) · ×1
  • _MentionSuggestionInfo.build (cyclomatic 16) mobile/lib/features/channels/compose_bar/suggestions.dart:164 — _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 · _InlineComponentInputs.== (cyclomatic 16) · ×1
  • _InlineComponentInputs.== (cyclomatic 16) mobile/lib/features/channels/message_content/inline_components.dart:120 — _InlineComponentInputs.== has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _MessageLongPressRegion.build (cyclomatic 16) · ×1
  • _MessageLongPressRegion.build (cyclomatic 16) mobile/lib/features/channels/message_long_press_region.dart:112 — _MessageLongPressRegion.build has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MessageSkeletonBody.build (cyclomatic 16) · ×1
  • MessageSkeletonBody.build (cyclomatic 16) mobile/lib/features/channels/message_skeleton_body.dart:24 — MessageSkeletonBody.build has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _QrScannerCamera.build (cyclomatic 16) · ×1
  • _QrScannerCamera.build (cyclomatic 16) mobile/lib/features/pairing/pairing_qr_scanner/scanner_camera.dart:9 — _QrScannerCamera.build 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.
D1 · Cyclomatic Complexity · _ProfileTextEditSheet.build (cyclomatic 16) · ×1
  • _ProfileTextEditSheet.build (cyclomatic 16) mobile/lib/features/profile/profile_edit_page.dart:669 — _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 · RemoteAgentController.updateModel (cyclomatic 16) · ×1
  • RemoteAgentController.updateModel (cyclomatic 16) mobile/lib/shared/agents/remote_agents.dart:501 — RemoteAgentController.updateModel 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 · AccountIdentityStore._read (cyclomatic 16) · ×1
  • AccountIdentityStore._read (cyclomatic 16) mobile/lib/shared/hosted/account_identity_store.dart:326 — AccountIdentityStore._read has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuilderlabAccountClient._request (cyclomatic 16) · ×1
  • BuilderlabAccountClient._request (cyclomatic 16) mobile/lib/shared/hosted/builderlab_account.dart:464 — BuilderlabAccountClient._request has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedRelayAuth._headers (cyclomatic 16) · ×1
  • HostedRelayAuth._headers (cyclomatic 16) mobile/lib/shared/hosted/hosted_relay_auth.dart:276 — HostedRelayAuth._headers 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 · MeSync._writeCache (cyclomatic 16) · ×1
  • MeSync._writeCache (cyclomatic 16) mobile/lib/shared/me/me_sync.dart:261 — MeSync._writeCache has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuzzSettingMenu._buildMenu (cyclomatic 16) · ×1
  • BuzzSettingMenu._buildMenu (cyclomatic 16) mobile/lib/shared/widgets/buzz_setting_menu.dart:64 — BuzzSettingMenu._buildMenu 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 · _TextEditSheet.build (cyclomatic 16) · ×1
  • _TextEditSheet.build (cyclomatic 16) mobile/lib/shared/widgets/text_editor.dart:95 — _TextEditSheet.build has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · usePersonaActions.usePersonaActions.handleSubmit (cyclomatic 16) · ×1
  • usePersonaActions.usePersonaActions.handleSubmit (cyclomatic 16) desktop/src/features/agents/ui/usePersonaActions.ts:175 — usePersonaActions.usePersonaActions.handleSubmit has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · observedUnreadNativeRig.installNativeRig.ingest (cyclomatic 16) · ×1
  • observedUnreadNativeRig.installNativeRig.ingest (cyclomatic 16) desktop/src/features/channels/observedUnreadNativeRig.mjs:217 — observedUnreadNativeRig.installNativeRig.ingest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · 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 · useAgentAddressLockPicker.useAgentAddressLockPicker.restoreAddressedAgentMentions (cyclomatic 16) · ×1
  • useAgentAddressLockPicker.useAgentAddressLockPicker.restoreAddressedAgentMentions (cyclomatic 16) desktop/src/features/messages/ui/useAgentAddressLockPicker.ts:346 — useAgentAddressLockPicker.useAgentAddressLockPicker.restoreAddressedAgentMentions has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · TimelineMessageList.TimelineMessageList (cyclomatic 16) · ×1
  • TimelineMessageList.TimelineMessageList (cyclomatic 16) desktop/src/features/messages/ui/TimelineMessageList.tsx:127 — TimelineMessageList.TimelineMessageList has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 218, 348). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useNewMessageRecipients.useNewMessageRecipients.searchResults · ×1
  • useNewMessageRecipients.useNewMessageRecipients.searchResults::addCandidate (cyclomatic 16) desktop/src/features/messages/ui/useNewMessageRecipients.ts:122 — useNewMessageRecipients.useNewMessageRecipients.searchResults::addCandidate has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · desktop.listenForDesktopNotificationActions (cyclomatic 16) · ×1
  • desktop.listenForDesktopNotificationActions (cyclomatic 16) desktop/src/features/notifications/lib/desktop.ts:217 — desktop.listenForDesktopNotificationActions has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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, 10 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · 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, 188, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · RelayClient.resetConnection (cyclomatic 16) · ×1
  • RelayClient.resetConnection (cyclomatic 16) desktop/src/shared/api/relayClientSession.ts:1120 — RelayClient.resetConnection 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 · FixmeComment · ×1
  • FixmeComment desktop/tests/e2e/navigation.spec.ts:126 — // 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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment crates/buzz-search/tests/postgres_fts_integration.rs:206 — // hack. Postgres FTS over raw JSON content tokenizes through the — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
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 · _MessageList.build (cognitive 249) · ×1
  • _MessageList.build (cognitive 249) mobile/lib/features/channels/channel_detail_page/message_list.dart:60 — _MessageList.build has cognitive complexity 249 (threshold 15). Drivers by points: boolean chains 107, if/else 84 (106 pts), ternaries 24 (30 pts), loops 5, match/switch 1 (nesting depth added 28). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · ChannelPane.ChannelPane (cognitive 233) · ×1
  • ChannelPane.ChannelPane (cognitive 233) desktop/src/features/channels/ui/ChannelPane.tsx:79 — ChannelPane.ChannelPane has cognitive complexity 233 (threshold 15). Drivers by points: ternaries 60 (180 pts), boolean chains 38, if/else 6 (10 pts), loops 4, error handling 1 (nesting depth added 124). Of this number, 149 points are the body's own statements and 84 belong to 11 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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, 166 points are the body's own statements and 65 belong to 18 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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, 127 points are the body's own statements and 68 belong to 17 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComposeBar.build (cognitive 192) · ×1
  • ComposeBar.build (cognitive 192) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:51 — ComposeBar.build has cognitive complexity 192 (threshold 15). Drivers by points: if/else 65 (112 pts), boolean chains 51, loops 7 (13 pts), ternaries 8 (9 pts), error handling 5 (6 pts), match/switch 1 (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 · ThreadDetailPage.build (cognitive 186) · ×1
  • ThreadDetailPage.build (cognitive 186) mobile/lib/features/channels/thread_detail_page.dart:115 — ThreadDetailPage.build has cognitive complexity 186 (threshold 15). Drivers by points: boolean chains 90, if/else 60 (66 pts), ternaries 21 (26 pts), loops 4 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · 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 · ImageAvatarCapture.build (cognitive 158) · ×1
  • ImageAvatarCapture.build (cognitive 158) mobile/lib/shared/widgets/image_avatar_capture.dart:89 — 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:76 — HostedCommunityOnboarding.HostedCommunityOnboarding has cognitive complexity 156 (threshold 15). Drivers by points: ternaries 46 (111 pts), if/else 24, boolean chains 20, error handling 1 (nesting depth added 65). Of this number, 107 points are the body's own statements and 49 belong to 21 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserProfilePanel.UserProfilePanel (cognitive 148) · ×1
  • UserProfilePanel.UserProfilePanel (cognitive 148) desktop/src/features/profile/ui/UserProfilePanel.tsx:105 — UserProfilePanel.UserProfilePanel has cognitive complexity 148 (threshold 15). Drivers by points: ternaries 45 (61 pts), boolean chains 43, if/else 34 (36 pts), error handling 5 (6 pts), loops 2 (nesting depth added 19). Of this number, 84 points are the body's own statements and 64 belong to 22 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _ResolvedChannelDetailPage.build (cognitive 147) · ×1
  • _ResolvedChannelDetailPage.build (cognitive 147) mobile/lib/features/channels/channel_detail_page.dart:203 — _ResolvedChannelDetailPage.build has cognitive complexity 147 (threshold 15). Drivers by points: boolean chains 56, if/else 32 (49 pts), ternaries 26 (30 pts), loops 6 (10 pts), error handling 1, 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.
D2 · Cognitive Complexity · _PairingWelcomeView.build (cognitive 143) · ×1
  • _PairingWelcomeView.build (cognitive 143) mobile/lib/features/pairing/pairing_page/pairing_welcome_view.dart:62 — _PairingWelcomeView.build has cognitive complexity 143 (threshold 15). Drivers by points: ternaries 39 (81 pts), if/else 19 (34 pts), boolean chains 27, loops 1 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch 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.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 · 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 · 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 · 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 items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch (a function literal at line 275, a function literal at line 177, a function literal at line 154, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · ChannelDetailsPage.build (cognitive 126) · ×1
  • ChannelDetailsPage.build (cognitive 126) mobile/lib/features/channels/channel_details_page.dart:81 — ChannelDetailsPage.build has cognitive complexity 126 (threshold 15). Drivers by points: if/else 31 (55 pts), boolean chains 36, ternaries 21 (25 pts), loops 4 (8 pts), error handling 2 (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.
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 items inside it that branch (a function literal at line 190, a function literal at line 398, a function literal at line 685, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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, 55 points are the body's own statements and 69 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AgentsPage.build (cognitive 122) · ×1
  • AgentsPage.build (cognitive 122) mobile/lib/features/agents/agents_page.dart:345 — AgentsPage.build has cognitive complexity 122 (threshold 15). Drivers by points: if/else 45 (60 pts), boolean chains 37, ternaries 14 (19 pts), loops 4 (5 pts), error handling 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.
D2 · Cognitive Complexity · AnimatedAvatarCapture.build (cognitive 122) · ×1
  • AnimatedAvatarCapture.build (cognitive 122) mobile/lib/features/profile/animated_avatar_capture.dart:81 — AnimatedAvatarCapture.build has cognitive complexity 122 (threshold 15). Drivers by points: if/else 39 (66 pts), ternaries 18 (25 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 122) · ×1
  • HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cognitive 122) desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:70 — HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard has cognitive complexity 122 (threshold 15). Drivers by points: ternaries 22 (67 pts), if/else 26 (33 pts), boolean chains 20, error handling 2 (nesting depth added 52). Of this number, 72 points are the body's own statements and 50 belong to 19 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ChannelsPage.build (cognitive 121) · ×1
  • ChannelsPage.build (cognitive 121) mobile/lib/features/channels/channels_page.dart:171 — ChannelsPage.build has cognitive complexity 121 (threshold 15). Drivers by points: if/else 40 (54 pts), boolean chains 30, ternaries 27 (30 pts), loops 4 (5 pts), error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · MessageTimeline.MessageTimelineBase (cognitive 115) · ×1
  • MessageTimeline.MessageTimelineBase (cognitive 115) desktop/src/features/messages/ui/MessageTimeline.tsx:166 — MessageTimeline.MessageTimelineBase has cognitive complexity 115 (threshold 15). Drivers by points: ternaries 32 (52 pts), boolean chains 36, if/else 25 (27 pts) (nesting depth added 22). Of this number, 77 points are the body's own statements and 38 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 · 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, 55 points are the body's own statements and 58 belong to 26 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · ProfileAvatarEditor.build (cognitive 110) · ×1
  • ProfileAvatarEditor.build (cognitive 110) mobile/lib/features/profile/profile_avatar_editor.dart:135 — ProfileAvatarEditor.build has cognitive complexity 110 (threshold 15). Drivers by points: ternaries 36 (50 pts), if/else 22 (30 pts), boolean chains 25, match/switch 4, error handling 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · HostedFlow._continue (cognitive 109) · ×1
  • HostedFlow._continue (cognitive 109) mobile/lib/shared/hosted/hosted_flow.dart:554 — HostedFlow._continue has cognitive complexity 109 (threshold 15). Drivers by points: if/else 37 (58 pts), boolean chains 38, loops 2 (6 pts), ternaries 3 (5 pts), match/switch 1 (2 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 · 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, 45 points are the body's own statements and 61 belong to 20 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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 · HuddleBar.HuddleBar (cognitive 105) · ×1
  • HuddleBar.HuddleBar (cognitive 105) desktop/src/features/huddle/components/HuddleBar.tsx:150 — HuddleBar.HuddleBar has cognitive complexity 105 (threshold 15). Drivers by points: if/else 41 (48 pts), boolean chains 28, ternaries 14 (19 pts), error handling 9 (10 pts) (nesting depth added 13). Of this number, 24 points are the body's own statements and 81 belong to 28 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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 · ActivityPage.build (cognitive 104) · ×1
  • ActivityPage.build (cognitive 104) mobile/lib/features/activity/activity_page.dart:98 — ActivityPage.build has cognitive complexity 104 (threshold 15). Drivers by points: if/else 36 (54 pts), boolean chains 22, loops 10 (13 pts), ternaries 11 (13 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · _MessageImageStack.build (cognitive 103) · ×1
  • _MessageImageStack.build (cognitive 103) mobile/lib/features/channels/message_content/media_stack.dart:22 — _MessageImageStack.build has cognitive complexity 103 (threshold 15). Drivers by points: if/else 27 (42 pts), ternaries 19 (24 pts), loops 13 (23 pts), boolean chains 14 (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.
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, 53 points are the body's own statements and 49 belong to 20 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentDefinitionDialog.AgentDefinitionDialog (cognitive 100) · ×1
  • AgentDefinitionDialog.AgentDefinitionDialog (cognitive 100) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128 — AgentDefinitionDialog.AgentDefinitionDialog has cognitive complexity 100 (threshold 15). Drivers by points: boolean chains 52, ternaries 31 (35 pts), if/else 13 (nesting depth added 4). Of this number, 57 points are the body's own statements and 43 belong to 14 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · HostedConnectSheet.build (cognitive 99) · ×1
  • HostedConnectSheet.build (cognitive 99) mobile/lib/features/onboarding/hosted_connect_sheet.dart:36 — HostedConnectSheet.build has cognitive complexity 99 (threshold 15). Drivers by points: ternaries 21 (43 pts), if/else 26 (30 pts), boolean chains 22, match/switch 2, error handling 1, loops 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 · 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, 43 points are the body's own statements and 56 belong to 19 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · HuddleTracker · ×1
  • HuddleTracker::apply (cognitive 98) crates/buzz-cli/src/commands/huddle_tracker.rs:249 — HuddleTracker::apply has cognitive complexity 98 (threshold 15). Drivers by points: if/else 43 (85 pts), boolean chains 8, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProfileEditPage.build (cognitive 98) · ×1
  • ProfileEditPage.build (cognitive 98) mobile/lib/features/profile/profile_edit_page.dart:55 — ProfileEditPage.build has cognitive complexity 98 (threshold 15). Drivers by points: if/else 25 (34 pts), ternaries 25 (30 pts), boolean chains 26, 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 · 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 · HuddleControlAcceptor · ×1
  • HuddleControlAcceptor::serve_control_loop (cognitive 95) crates/buzz-relay/src/audio/join.rs:1303 — HuddleControlAcceptor::serve_control_loop has cognitive complexity 95 (threshold 15). Drivers by points: if/else 19 (57 pts), match/switch 13 (33 pts), loops 3 (5 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · OnboardingAppEntry.build (cognitive 93) · ×1
  • OnboardingAppEntry.build (cognitive 93) mobile/lib/onboarding_app_entry.dart:36 — OnboardingAppEntry.build has cognitive complexity 93 (threshold 15). Drivers by points: boolean chains 51, if/else 21 (23 pts), ternaries 18 (19 pts) (nesting depth added 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 · 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 · PairingPage.build (cognitive 88) · ×1
  • PairingPage.build (cognitive 88) mobile/lib/features/pairing/pairing_page.dart:118 — PairingPage.build has cognitive complexity 88 (threshold 15). Drivers by points: boolean chains 35, if/else 19 (29 pts), ternaries 22 (24 pts) (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · ReadStateManager._publishOnce (cognitive 88) · ×1
  • ReadStateManager._publishOnce (cognitive 88) mobile/lib/shared/read_state/read_state_manager.dart:587 — ReadStateManager._publishOnce has cognitive complexity 88 (threshold 15). Drivers by points: if/else 17 (46 pts), boolean chains 27, loops 7 (14 pts), error handling 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelBrowserDialog.ChannelBrowserDialog (cognitive 88) · ×1
  • ChannelBrowserDialog.ChannelBrowserDialog (cognitive 88) desktop/src/features/channels/ui/ChannelBrowserDialog.tsx:165 — ChannelBrowserDialog.ChannelBrowserDialog has cognitive complexity 88 (threshold 15). Drivers by points: ternaries 27 (51 pts), if/else 13 (21 pts), boolean chains 14, error handling 1, loops 1 (nesting depth added 32). Of this number, 37 points are the body's own statements and 51 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · CommunitySwitcherPage.build (cognitive 86) · ×1
  • CommunitySwitcherPage.build (cognitive 86) mobile/lib/features/channels/channels_page/community_switcher.dart:90 — CommunitySwitcherPage.build has cognitive complexity 86 (threshold 15). Drivers by points: if/else 33 (52 pts), ternaries 16 (19 pts), boolean chains 13, error handling 1, 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.
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 · useMentionSendFlow.useMentionSendFlow.completeSend (cognitive 84) · ×1
  • useMentionSendFlow.useMentionSendFlow.completeSend (cognitive 84) desktop/src/features/messages/ui/useMentionSendFlow.ts:284 — useMentionSendFlow.useMentionSendFlow.completeSend has cognitive complexity 84 (threshold 15). Drivers by points: if/else 40 (50 pts), boolean chains 19, ternaries 5 (8 pts), error handling 3 (5 pts), loops 2 (nesting depth added 15). Of this number, 49 points are the body's own statements and 35 belong to 9 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MobilePairingCard.MobilePairingCard (cognitive 82) · ×1
  • MobilePairingCard.MobilePairingCard (cognitive 82) desktop/src/features/settings/ui/MobilePairingCard.tsx:264 — MobilePairingCard.MobilePairingCard has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 15 (47 pts), if/else 21 (22 pts), boolean chains 11, error handling 1, loops 1 (nesting depth added 33). Of this number, 50 points are the body's own statements and 32 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativePhotoZoomPreview.open (cognitive 81) · ×1
  • NativePhotoZoomPreview.open (cognitive 81) mobile/lib/features/channels/native_photo_zoom_preview.dart:29 — NativePhotoZoomPreview.open has cognitive complexity 81 (threshold 15). Drivers by points: if/else 21 (47 pts), boolean chains 15, ternaries 6 (15 pts), match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useAnchoredScroll.useAnchoredScroll (cognitive 81) · ×1
  • useAnchoredScroll.useAnchoredScroll (cognitive 81) desktop/src/features/messages/ui/useAnchoredScroll.ts:200 — useAnchoredScroll.useAnchoredScroll has cognitive complexity 81 (threshold 15). Drivers by points: if/else 51 (64 pts), boolean chains 15, ternaries 2 (nesting depth added 13). Most of this is not in the body itself: 1 of the 81 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 705, 1028, 293, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · 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 · IosNavigationBar.build (cognitive 80) · ×1
  • IosNavigationBar.build (cognitive 80) mobile/lib/shared/widgets/ios_navigation_bar.dart:204 — IosNavigationBar.build has cognitive complexity 80 (threshold 15). Drivers by points: if/else 34 (49 pts), boolean chains 13, loops 8, ternaries 5 (7 pts), error handling 2 (3 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 · 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 · 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 · IosNavigationBarView.configure (cognitive 79) · ×1
  • IosNavigationBarView.configure (cognitive 79) mobile/ios/Runner/IosNavigationBar.swift:623 — IosNavigationBarView.configure has cognitive complexity 79 (threshold 15). Drivers by points: if/else 34 (48 pts), boolean chains 15, ternaries 8 (13 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SasVerificationView.build (cognitive 79) · ×1
  • _SasVerificationView.build (cognitive 79) mobile/lib/features/pairing/pairing_page/sas_verification_view.dart:30 — _SasVerificationView.build has cognitive complexity 79 (threshold 15). Drivers by points: if/else 28 (46 pts), ternaries 12 (21 pts), boolean chains 10, error handling 1 (2 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 · HostedIdentityService._resolve (cognitive 79) · ×1
  • HostedIdentityService._resolve (cognitive 79) mobile/lib/shared/hosted/hosted_identity_service.dart:70 — HostedIdentityService._resolve has cognitive complexity 79 (threshold 15). Drivers by points: if/else 29 (41 pts), boolean chains 23, ternaries 6 (12 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.
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 · UserProfileSheet.build (cognitive 78) · ×1
  • UserProfileSheet.build (cognitive 78) mobile/lib/features/profile/user_profile_sheet.dart:126 — UserProfileSheet.build has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 22 (38 pts), if/else 25 (35 pts), boolean chains 4, 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 · 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). None of this is in the body itself: all 78 points belong to 27 function literals inside it that branch (lines 147, 379, 285, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · AddChannelMembersSheet.build (cognitive 76) · ×1
  • AddChannelMembersSheet.build (cognitive 76) mobile/lib/features/channels/add_members_sheet.dart:81 — AddChannelMembersSheet.build has cognitive complexity 76 (threshold 15). Drivers by points: if/else 22 (39 pts), loops 13 (19 pts), ternaries 10 (12 pts), boolean chains 4, error handling 2 (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.
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 · CreateAgentPage.build (cognitive 75) · ×1
  • CreateAgentPage.build (cognitive 75) mobile/lib/features/agents/create_agent_page.dart:46 — CreateAgentPage.build has cognitive complexity 75 (threshold 15). Drivers by points: if/else 23 (42 pts), ternaries 12 (18 pts), boolean chains 14, error handling 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.
D2 · Cognitive Complexity · HostedCommunityCreateFlow.HostedCommunityCreateFlow (cognitive 75) · ×1
  • HostedCommunityCreateFlow.HostedCommunityCreateFlow (cognitive 75) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:39 — HostedCommunityCreateFlow.HostedCommunityCreateFlow has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 18 (36 pts), if/else 24, boolean chains 14, error handling 1 (nesting depth added 18). Of this number, 41 points are the body's own statements and 34 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · SelfHostedEntrySheet.build (cognitive 73) · ×1
  • SelfHostedEntrySheet.build (cognitive 73) mobile/lib/features/onboarding/self_hosted_entry_sheet.dart:140 — SelfHostedEntrySheet.build has cognitive complexity 73 (threshold 15). Drivers by points: if/else 24 (38 pts), ternaries 13 (17 pts), boolean chains 12, loops 3 (4 pts), error handling 2 (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 · FrostedAppBar._build (cognitive 73) · ×1
  • FrostedAppBar._build (cognitive 73) mobile/lib/shared/widgets/frosted_app_bar.dart:267 — FrostedAppBar._build has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 23 (35 pts), boolean chains 26, if/else 7 (12 pts) (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 · 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 · 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 · 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 · ManageChannelSheet.build (cognitive 70) · ×1
  • ManageChannelSheet.build (cognitive 70) mobile/lib/features/channels/manage_channel_sheet.dart:218 — ManageChannelSheet.build has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 23, ternaries 9 (17 pts), error handling 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · ChannelsNotifier._fetchChannels (cognitive 69) · ×1
  • ChannelsNotifier._fetchChannels (cognitive 69) mobile/lib/features/channels/channels_provider.dart:358 — ChannelsNotifier._fetchChannels has cognitive complexity 69 (threshold 15). Drivers by points: if/else 25 (40 pts), boolean chains 14, loops 11 (14 pts), ternaries 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.
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 · _AddCommunityConnection.build (cognitive 68) · ×1
  • _AddCommunityConnection.build (cognitive 68) mobile/lib/features/pairing/add_community_page/add_community_connection.dart:46 — _AddCommunityConnection.build has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 32 (39 pts), if/else 12 (16 pts), boolean chains 13 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · ProfileSetupAvatarEditor.build (cognitive 68) · ×1
  • ProfileSetupAvatarEditor.build (cognitive 68) mobile/lib/features/profile/profile_setup_avatar_editor.dart:35 — ProfileSetupAvatarEditor.build has cognitive complexity 68 (threshold 15). Drivers by points: if/else 30 (42 pts), ternaries 12 (16 pts), boolean chains 8, error handling 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.
D2 · Cognitive Complexity · useCommunityInit.useCommunityInit (cognitive 68) · ×1
  • useCommunityInit.useCommunityInit (cognitive 68) desktop/src/features/communities/useCommunityInit.ts:131 — useCommunityInit.useCommunityInit has cognitive complexity 68 (threshold 15). Drivers by points: if/else 18 (40 pts), ternaries 3 (12 pts), error handling 5 (9 pts), boolean chains 6, loops 1 (nesting depth added 35). None of this is in the body itself: all 68 points belong to one function literal inside it that branches (line 186). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
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, 46 points are the body's own statements and 21 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _NewDirectMessageSheet.build (cognitive 66) · ×1
  • _NewDirectMessageSheet.build (cognitive 66) mobile/lib/features/channels/channels_page/sheets.dart:304 — _NewDirectMessageSheet.build has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (34 pts), loops 9 (12 pts), ternaries 10 (12 pts), boolean chains 7, 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 · MessageContent.build (cognitive 65) · ×1
  • MessageContent.build (cognitive 65) mobile/lib/features/channels/message_content.dart:232 — MessageContent.build has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 25 (33 pts), boolean chains 17, if/else 9 (10 pts), loops 5 (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 · 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). Most of this is not in the body itself: 13 of the 65 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 79, a function literal at line 220, doJoin, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · _MeChatDraft.build (cognitive 63) · ×1
  • _MeChatDraft.build (cognitive 63) mobile/lib/features/channels/me/me_chat_draft.dart:13 — _MeChatDraft.build has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 18, ternaries 12 (15 pts), error handling 2 (3 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · TopbarSearch.TopbarSearch (cognitive 63) · ×1
  • TopbarSearch.TopbarSearch (cognitive 63) desktop/src/features/search/ui/TopbarSearch.tsx:376 — TopbarSearch.TopbarSearch has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 51 (102 pts), if/else 15 (16 pts), boolean chains 11 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch::renderSearchResultRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 · _ThreadMessage.build (cognitive 62) · ×1
  • _ThreadMessage.build (cognitive 62) mobile/lib/features/channels/thread_detail_page/thread_message.dart:41 — _ThreadMessage.build has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 23 (32 pts), boolean chains 14, if/else 11 (14 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedAppGate.build (cognitive 61) · ×1
  • HostedAppGate.build (cognitive 61) mobile/lib/hosted_app_gate.dart:37 — HostedAppGate.build has cognitive complexity 61 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 22, ternaries 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MessageBubble.build (cognitive 61) · ×1
  • _MessageBubble.build (cognitive 61) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40 — _MessageBubble.build has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 21 (28 pts), boolean chains 16, if/else 10 (13 pts), loops 4 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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, 39 points are the body's own statements and 22 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeviceVoiceNotePlayerController._loadPendingRemote (cognitive 60) · ×1
  • DeviceVoiceNotePlayerController._loadPendingRemote (cognitive 60) mobile/lib/features/channels/voice_note_recording.dart:592 — DeviceVoiceNotePlayerController._loadPendingRemote has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (47 pts), boolean chains 12, error handling 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · modelCapabilities.labelFromModelBody (cognitive 60) · ×1
  • modelCapabilities.labelFromModelBody (cognitive 60) desktop/src/features/agents/ui/modelCapabilities.ts:541 — modelCapabilities.labelFromModelBody has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 8 (20 pts), boolean chains 14, loops 2 (3 pts) (nesting depth added 21). Of this number, 59 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useUnreadChannels.useUnreadChannels (cognitive 59) · ×1
  • useUnreadChannels.useUnreadChannels (cognitive 59) desktop/src/features/channels/useUnreadChannels.ts:126 — useUnreadChannels.useUnreadChannels has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (39 pts), loops 11 (15 pts), boolean chains 3, ternaries 2 (nesting depth added 19). Most of this is not in the body itself: 2 of the 59 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 677, 267, 288, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NativePhotoZoomCoordinator.init (cognitive 58) · ×1
  • NativePhotoZoomCoordinator.init (cognitive 58) mobile/ios/Runner/NativePhotoZoomCoordinator.swift:12 — NativePhotoZoomCoordinator.init has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 39, if/else 16 (19 pts) (nesting depth added 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 · MediaImageViewerPage.build (cognitive 58) · ×1
  • MediaImageViewerPage.build (cognitive 58) mobile/lib/features/channels/media_viewer_page.dart:213 — MediaImageViewerPage.build has cognitive complexity 58 (threshold 15). Drivers by points: if/else 31 (35 pts), boolean chains 12, ternaries 8, loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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, 50 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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, 32 points are the body's own statements and 26 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · _SystemMessageRow.build (cognitive 56) · ×1
  • _SystemMessageRow.build (cognitive 56) mobile/lib/features/channels/channel_detail_page/system_rows.dart:26 — _SystemMessageRow.build has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 18 (28 pts), boolean chains 13, if/else 12 (13 pts), loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · MePage.build (cognitive 55) · ×1
  • MePage.build (cognitive 55) mobile/lib/features/channels/me/me_page.dart:72 — MePage.build has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 13, ternaries 9, loops 4 (7 pts), 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.
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 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.
D2 · Cognitive Complexity · relayReconnectReplay.replayLiveSubscriptions (cognitive 55) · ×1
  • relayReconnectReplay.replayLiveSubscriptions (cognitive 55) desktop/src/shared/api/relayReconnectReplay.ts:255 — relayReconnectReplay.replayLiveSubscriptions has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 10, ternaries 4 (5 pts), error handling 2 (3 pts), loops 2 (nesting depth added 15). Most of this is not in the body itself: 9 of the 55 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 466, a function literal at line 308, a function literal at line 484, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · FrostedScaffold.build (cognitive 54) · ×1
  • FrostedScaffold.build (cognitive 54) mobile/lib/shared/widgets/frosted_scaffold.dart:67 — FrostedScaffold.build has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 19, ternaries 8 (11 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CommunitySwitcher.CommunitySwitcher (cognitive 54) · ×1
  • CommunitySwitcher.CommunitySwitcher (cognitive 54) desktop/src/features/communities/ui/CommunitySwitcher.tsx:113 — CommunitySwitcher.CommunitySwitcher has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 23 (41 pts), if/else 9, boolean chains 2, error handling 2 (nesting depth added 18). Of this number, 37 points are the body's own statements and 17 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentAvatarPicker.build (cognitive 53) · ×1
  • AgentAvatarPicker.build (cognitive 53) mobile/lib/features/agents/agent_avatar_picker.dart:100 — AgentAvatarPicker.build has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 16 (19 pts), boolean chains 8, error handling 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelActionsSheet.build (cognitive 53) · ×1
  • ChannelActionsSheet.build (cognitive 53) mobile/lib/features/channels/channel_actions_sheet.dart:84 — 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 · ProfileSetupPage.build (cognitive 53) · ×1
  • ProfileSetupPage.build (cognitive 53) mobile/lib/features/profile/profile_setup_page.dart:33 — ProfileSetupPage.build has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 5 (8 pts), boolean chains 6, match/switch 3 (6 pts), error handling 3 (4 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdaptiveConversationPane.build (cognitive 53) · ×1
  • AdaptiveConversationPane.build (cognitive 53) mobile/lib/shared/widgets/adaptive_conversation_pane.dart:182 — AdaptiveConversationPane.build has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 27, ternaries 14 (16 pts), if/else 9 (10 pts) (nesting depth added 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 · 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 · _ToastBubble.build (cognitive 52) · ×1
  • _ToastBubble.build (cognitive 52) mobile/lib/shared/widgets/buzz_toast.dart:153 — _ToastBubble.build has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 22 (24 pts), boolean chains 15, if/else 10 (11 pts), error handling 1 (2 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.
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 · _SliverChannelsList.build (cognitive 50) · ×1
  • _SliverChannelsList.build (cognitive 50) mobile/lib/features/channels/channels_page/body.dart:224 — _SliverChannelsList.build has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 9 (10 pts), boolean chains 8, ternaries 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.
D2 · Cognitive Complexity · MediaVideoViewerPage.build (cognitive 50) · ×1
  • MediaVideoViewerPage.build (cognitive 50) mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19 — MediaVideoViewerPage.build has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (40 pts), boolean chains 5, error handling 3 (4 pts), ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresenceCacheNotifier._subscribe (cognitive 50) · ×1
  • PresenceCacheNotifier._subscribe (cognitive 50) mobile/lib/features/profile/presence_cache_provider.dart:149 — PresenceCacheNotifier._subscribe has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 10, ternaries 1 (3 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeCommunityEntry.show (cognitive 50) · ×1
  • NativeCommunityEntry.show (cognitive 50) mobile/lib/shared/identity_transfer/native_community_entry.dart:14 — NativeCommunityEntry.show has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 3 (9 pts), boolean chains 4, match/switch 2 (4 pts), error handling 3, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetAgentAvatar.build (cognitive 50) · ×1
  • PresetAgentAvatar.build (cognitive 50) mobile/lib/shared/widgets/preset_agent_avatar.dart:30 — PresetAgentAvatar.build has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 25, ternaries 14 (15 pts), if/else 6 (9 pts), error handling 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · NavigationGlassButtonPlatformView.applyContent (cognitive 49) · ×1
  • NavigationGlassButtonPlatformView.applyContent (cognitive 49) mobile/ios/Runner/JumpToLatestGlassButton.swift:488 — NavigationGlassButtonPlatformView.applyContent has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 8 (16 pts), boolean chains 3, loops 1 (2 pts), 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.
D2 · Cognitive Complexity · NativeProfileSetupCoordinator.openAvatar (cognitive 49) · ×1
  • NativeProfileSetupCoordinator.openAvatar (cognitive 49) mobile/ios/Runner/NativeProfileSetup.swift:92 — NativeProfileSetupCoordinator.openAvatar has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 18, loops 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 10). Of this number, 46 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.
D2 · Cognitive Complexity · OrganizationAppEntry.build (cognitive 49) · ×1
  • OrganizationAppEntry.build (cognitive 49) mobile/lib/organization_app_entry.dart:23 — OrganizationAppEntry.build has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (35 pts), error handling 3 (7 pts), boolean chains 5, match/switch 1, ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CommunityLinkForm.build (cognitive 49) · ×1
  • _CommunityLinkForm.build (cognitive 49) mobile/lib/features/pairing/pairing_page/community_link_form.dart:29 — _CommunityLinkForm.build has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 15, if/else 13 (15 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · App.CommunityApp (cognitive 49) · ×1
  • App.CommunityApp (cognitive 49) desktop/src/app/App.tsx:364 — App.CommunityApp has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (29 pts), boolean chains 11, ternaries 6 (9 pts) (nesting depth added 7). Of this number, 22 points are the body's own statements and 27 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 · _MarkdownEditingController._snapSelectionToChips (cognitive 48) · ×1
  • _MarkdownEditingController._snapSelectionToChips (cognitive 48) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:84 — _MarkdownEditingController._snapSelectionToChips has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 8 (23 pts), boolean chains 13, if/else 6 (11 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.
D2 · Cognitive Complexity · HostedRelayAuth._issue (cognitive 48) · ×1
  • HostedRelayAuth._issue (cognitive 48) mobile/lib/shared/hosted/hosted_relay_auth.dart:331 — HostedRelayAuth._issue has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 10, error handling 2 (4 pts), ternaries 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 · MeSync.update (cognitive 48) · ×1
  • MeSync.update (cognitive 48) mobile/lib/shared/me/me_sync.dart:380 — MeSync.update has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (35 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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). Most of this is not in the body itself: 9 of the 48 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 326, handleSave, a function literal at line 410, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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, 37 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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, 25 points are the body's own statements and 23 belong to 10 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · useRichTextEditor.useRichTextEditor (cognitive 48) · ×1
  • useRichTextEditor.useRichTextEditor (cognitive 48) desktop/src/features/messages/lib/useRichTextEditor.ts:145 — useRichTextEditor.useRichTextEditor has cognitive complexity 48 (threshold 15). Drivers by points: if/else 32 (36 pts), boolean chains 8, ternaries 2 (3 pts), loops 1 (nesting depth added 5). None of this is in the body itself: all 48 points belong to 10 function items inside it that branch (a function literal at line 424, exitListIfEmptyLast, a function literal at line 281, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · ProfileAvatarCropPage.build (cognitive 47) · ×1
  • ProfileAvatarCropPage.build (cognitive 47) mobile/lib/shared/widgets/profile_avatar_crop_page.dart:27 — ProfileAvatarCropPage.build has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 15, boolean chains 10 (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 · 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, 25 points are the body's own statements and 22 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · TimelineMessageList.VirtualizedTimelineRows (cognitive 47) · ×1
  • TimelineMessageList.VirtualizedTimelineRows (cognitive 47) desktop/src/features/messages/ui/TimelineMessageList.tsx:430 — TimelineMessageList.VirtualizedTimelineRows has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (25 pts), ternaries 10, boolean chains 9, loops 3 (nesting depth added 2). Most of this is not in the body itself: 2 of the 47 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 504, 637, 678, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · MobileInviteJoinRecovery.ensureStarterChannels (cognitive 46) · ×1
  • MobileInviteJoinRecovery.ensureStarterChannels (cognitive 46) mobile/lib/app.dart:131 — MobileInviteJoinRecovery.ensureStarterChannels has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (34 pts), boolean chains 4, ternaries 1 (4 pts), error handling 1 (3 pts), loops 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DeviceVoiceNotePlayerController._toggle (cognitive 46) · ×1
  • DeviceVoiceNotePlayerController._toggle (cognitive 46) mobile/lib/features/channels/voice_note_recording.dart:811 — DeviceVoiceNotePlayerController._toggle has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 13 (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.
D2 · Cognitive Complexity · HuddleTransport._handleJoined (cognitive 46) · ×1
  • HuddleTransport._handleJoined (cognitive 46) mobile/lib/shared/huddle/huddle_transport.dart:450 — HuddleTransport._handleJoined has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 20, ternaries 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NsecImportSheet.build (cognitive 46) · ×1
  • NsecImportSheet.build (cognitive 46) mobile/lib/shared/identity_transfer/nsec_import_sheet.dart:50 — NsecImportSheet.build has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 11, ternaries 4, error handling 2, match/switch 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 · AppShell.AppShell (cognitive 46) · ×1
  • AppShell.AppShell (cognitive 46) desktop/src/app/AppShell.tsx:111 — AppShell.AppShell has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 21 (25 pts), boolean chains 11, if/else 9, error handling 1 (nesting depth added 4). Of this number, 29 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 · 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 · 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 · 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, 23 points are the body's own statements and 22 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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). None of this is in the body itself: all 45 points belong to 6 function literals inside it that branch (lines 80, 55, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChannelMemberProfileActions.build (cognitive 44) · ×1
  • ChannelMemberProfileActions.build (cognitive 44) mobile/lib/features/channels/channel_member_profile_actions.dart:26 — ChannelMemberProfileActions.build has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 12, ternaries 5 (10 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 · HostedBackupService._backup (cognitive 44) · ×1
  • HostedBackupService._backup (cognitive 44) mobile/lib/shared/hosted/hosted_backup_service.dart:56 — HostedBackupService._backup has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (29 pts), error handling 7 (10 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · 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). None of this is in the body itself: all 44 points belong to 9 function literals inside it that branch (lines 695, 756, 771, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · IosNavigationBarView.layout (cognitive 43) · ×1
  • IosNavigationBarView.layout (cognitive 43) mobile/ios/Runner/IosNavigationBar.swift:438 — IosNavigationBarView.layout has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 9 (15 pts), boolean chains 10, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrowserAuth.receive (cognitive 43) · ×1
  • BrowserAuth.receive (cognitive 43) mobile/lib/shared/hosted/browser_auth.dart:183 — BrowserAuth.receive has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 12, error handling 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 · 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, 40 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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). None of this is in the body itself: all 43 points belong to 16 function literals inside it that branch (lines 130, 193, 291, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · buzz_pubsub · ×1
  • buzz_pubsub::subscriber::connect_and_subscribe (cognitive 42) crates/buzz-pubsub/src/subscriber.rs:95 — buzz_pubsub::subscriber::connect_and_subscribe has cognitive complexity 42 (threshold 15). Drivers by points: if/else 6 (23 pts), match/switch 5 (14 pts), loops 3 (5 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 · VoiceNoteComposerRecorder.build (cognitive 42) · ×1
  • VoiceNoteComposerRecorder.build (cognitive 42) mobile/lib/features/channels/voice_note_composer_recorder.dart:35 — VoiceNoteComposerRecorder.build has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 6 (9 pts), boolean chains 6, error handling 3, 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.
D2 · Cognitive Complexity · HomePage.build (cognitive 42) · ×1
  • HomePage.build (cognitive 42) mobile/lib/features/home/home_page.dart:64 — HomePage.build has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 23, boolean chains 14, if/else 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PairingNotifier._handlePairingEvent (cognitive 42) · ×1
  • PairingNotifier._handlePairingEvent (cognitive 42) mobile/lib/features/pairing/pairing_provider.dart:499 — PairingNotifier._handlePairingEvent has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 8, error handling 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useInboxSelectionAnchor.useInboxSelectionAnchor (cognitive 42) · ×1
  • useInboxSelectionAnchor.useInboxSelectionAnchor (cognitive 42) desktop/src/features/home/useInboxSelectionAnchor.ts:66 — useInboxSelectionAnchor.useInboxSelectionAnchor has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 14, ternaries 4 (6 pts) (nesting depth added 5). Of this number, 16 points are the body's own statements and 26 belong to 9 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · HuddleAudioEngine.runCapture (cognitive 41) · ×1
  • HuddleAudioEngine.runCapture (cognitive 41) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:305 — HuddleAudioEngine.runCapture has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 3 (6 pts), boolean chains 3, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · NativePhotoZoomViewController.layoutGallery (cognitive 41) · ×1
  • NativePhotoZoomViewController.layoutGallery (cognitive 41) mobile/ios/Runner/NativePhotoZoomCoordinator.swift:258 — NativePhotoZoomViewController.layoutGallery has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 8 (18 pts), if/else 6 (12 pts), boolean chains 11 (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.
D2 · Cognitive Complexity · HostedFlow._continueCommunities (cognitive 41) · ×1
  • HostedFlow._continueCommunities (cognitive 41) mobile/lib/shared/hosted/hosted_flow.dart:900 — HostedFlow._continueCommunities has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 4, error handling 2 (4 pts), loops 1, ternaries 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 · AgentInstanceEditDialog.AgentInstanceEditDialog · ×1
  • AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit (cognitive 41) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:649 — AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 18 (29 pts), boolean chains 6, if/else 4, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · TopbarSearch.TopbarSearch · ×1
  • TopbarSearch.TopbarSearch::renderSearchResultRow (cognitive 41) desktop/src/features/search/ui/TopbarSearch.tsx:655 — TopbarSearch.TopbarSearch::renderSearchResultRow has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 25 (40 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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, 23 points are the body's own statements and 18 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppDelegate.handleQrScannerMethodCall (cognitive 40) · ×1
  • AppDelegate.handleQrScannerMethodCall (cognitive 40) mobile/ios/Runner/AppDelegate.swift:474 — AppDelegate.handleQrScannerMethodCall has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 16, match/switch 2 (4 pts), loops 1 (3 pts) (nesting depth added 13). 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 · agentSessionTranscriptHelpers.parseSystemPromptSections (cognitive 40) · ×1
  • agentSessionTranscriptHelpers.parseSystemPromptSections (cognitive 40) REDACTED:138 — agentSessionTranscriptHelpers.parseSystemPromptSections has cognitive complexity 40 (threshold 15). Drivers by points: if/else 31 (57 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (agentSessionTranscriptHelpers.parseSystemPromptSections::appendBaseAndWorkspace) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 · 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 · GitStore · ×1
  • GitStore::run_conformance_probe (cognitive 39) crates/buzz-relay/src/api/git/store.rs:597 — GitStore::run_conformance_probe has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 6 (13 pts), loops 8 (12 pts), if/else 6 (11 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.
D2 · Cognitive Complexity · _InboxRow.build (cognitive 39) · ×1
  • _InboxRow.build (cognitive 39) mobile/lib/features/activity/activity_page/inbox_row.dart:34 — _InboxRow.build has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 10 (12 pts), boolean chains 8, loops 4 (5 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PresenceCacheNotifier._refresh (cognitive 39) · ×1
  • PresenceCacheNotifier._refresh (cognitive 39) mobile/lib/features/profile/presence_cache_provider.dart:302 — PresenceCacheNotifier._refresh has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedFlow._initialize (cognitive 39) · ×1
  • HostedFlow._initialize (cognitive 39) mobile/lib/shared/hosted/hosted_flow.dart:280 — HostedFlow._initialize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 8 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentInstanceEditDialog.AgentInstanceEditDialog (cognitive 39) · ×1
  • AgentInstanceEditDialog.AgentInstanceEditDialog (cognitive 39) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:102 — AgentInstanceEditDialog.AgentInstanceEditDialog has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 48 (62 pts), boolean chains 31, if/else 21, error handling 2 (nesting depth added 14). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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:51 — AddMemberDialog.DirectAddMemberForm has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 18 (24 pts), boolean chains 8, if/else 4 (5 pts), error handling 1, loops 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 17 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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, 28 points are the body's own statements and 11 belong to 7 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 · BuzzClient · ×1
  • BuzzClient::submit_moderation_event (cognitive 38) crates/buzz-cli/src/client.rs:1168 — BuzzClient::submit_moderation_event has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (33 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · NipFiRelayConfig · ×1
  • NipFiRelayConfig::from_env (cognitive 38) crates/buzz-relay/src/nip_fi_config.rs:305 — NipFiRelayConfig::from_env has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · BestieAgentAction.build (cognitive 38) · ×1
  • BestieAgentAction.build (cognitive 38) mobile/lib/features/agents/bestie_agent_action.dart:23 — BestieAgentAction.build has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (23 pts), if/else 7 (10 pts), boolean chains 4, error handling 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 · _RecentPhotoGalleryPicker.build (cognitive 38) · ×1
  • _RecentPhotoGalleryPicker.build (cognitive 38) mobile/lib/features/channels/compose_bar/photo_gallery_picker.dart:54 — _RecentPhotoGalleryPicker.build has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (21 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 · RemoteAgentController.create (cognitive 38) · ×1
  • RemoteAgentController.create (cognitive 38) mobile/lib/shared/agents/remote_agents.dart:600 — RemoteAgentController.create has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 10, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedFlow.signInAccount (cognitive 38) · ×1
  • HostedFlow.signInAccount (cognitive 38) mobile/lib/shared/hosted/hosted_flow.dart:372 — HostedFlow.signInAccount has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 10, ternaries 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 · CommunityThemeNotifier.build (cognitive 38) · ×1
  • CommunityThemeNotifier.build (cognitive 38) mobile/lib/shared/theme/community_theme_provider.dart:23 — 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 · plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM (cognitive 38) · ×1
  • plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM (cognitive 38) desktop/src/features/messages/lib/plainTextProjection.ts:231 — plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 3 (7 pts), boolean chains 2, loops 1 (nesting depth added 16). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 220, 252, 274, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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:51 — InvitePage.InvitePage has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 12, boolean chains 10, error handling 1 (nesting depth added 4). Of this number, 22 points are the body's own statements and 16 belong to 11 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ClientMessage · ×1
  • ClientMessage::parse (cognitive 37) crates/buzz-relay/src/protocol.rs:70 — ClientMessage::parse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (33 pts), match/switch 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeCreateChannelViewController.tableView (cognitive 37) · ×1
  • NativeCreateChannelViewController.tableView (cognitive 37) mobile/ios/Runner/NativeCreateChannelSheet.swift:204 — NativeCreateChannelViewController.tableView has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 14 (28 pts), if/else 6 (8 pts), boolean chains 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.
D2 · Cognitive Complexity · OnboardingStepPage.build (cognitive 37) · ×1
  • OnboardingStepPage.build (cognitive 37) mobile/lib/shared/widgets/onboarding_step_page.dart:37 — OnboardingStepPage.build has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 13, ternaries 10 (12 pts), if/else 9 (11 pts), 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.
D2 · Cognitive Complexity · AdminConsoleStaffingTab.RestrictionsSection (cognitive 37) · ×1
  • AdminConsoleStaffingTab.RestrictionsSection (cognitive 37) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:160 — AdminConsoleStaffingTab.RestrictionsSection has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 15, if/else 8 (10 pts), ternaries 9 (10 pts), error handling 2 (nesting depth added 3). Of this number, 24 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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 · useVoiceNoteRecorder.useVoiceNoteRecorder.start (cognitive 37) · ×1
  • useVoiceNoteRecorder.useVoiceNoteRecorder.start (cognitive 37) desktop/src/features/messages/lib/useVoiceNoteRecorder.ts:68 — useVoiceNoteRecorder.useVoiceNoteRecorder.start has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 12, error handling 2 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 15 of the 37 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 125, 184, 175, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow (cognitive 37) · ×1
  • useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow (cognitive 37) desktop/src/features/messages/ui/useMentionSendFlow.ts:723 — useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 6, ternaries 3 (4 pts), error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 8). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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). Most of this is not in the body itself: 9 of the 37 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 326, handleSubmit, a function literal at line 361, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · ConcentricSheetSurface.build (cognitive 36) · ×1
  • ConcentricSheetSurface.build (cognitive 36) mobile/lib/shared/widgets/concentric_sheet_surface.dart:119 — ConcentricSheetSurface.build has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 13, ternaries 6, 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, 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 · managedAgentControlActions.deleteManagedAgentWithRules (cognitive 36) · ×1
  • managedAgentControlActions.deleteManagedAgentWithRules (cognitive 36) desktop/src/features/agents/lib/managedAgentControlActions.ts:151 — managedAgentControlActions.deleteManagedAgentWithRules has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 2, ternaries 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 12 function items inside it that branch (buildSubmitInput, handleSubmit, a function literal at line 275, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch (a function literal at line 226, a function literal at line 299, handleRemove, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AppDelegate.didInitializeImplicitFlutterEngine (cognitive 35) · ×1
  • AppDelegate.didInitializeImplicitFlutterEngine (cognitive 35) mobile/ios/Runner/AppDelegate.swift:71 — AppDelegate.didInitializeImplicitFlutterEngine has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25 (28 pts), boolean chains 4, error handling 1, match/switch 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _IOSInlinePhotoPicker.build (cognitive 35) · ×1
  • _IOSInlinePhotoPicker.build (cognitive 35) mobile/lib/features/channels/compose_bar/ios_photo_picker.dart:25 — _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 · HostedAdmission.prepare (cognitive 35) · ×1
  • HostedAdmission.prepare (cognitive 35) mobile/lib/shared/hosted/hosted_admission.dart:39 — HostedAdmission.prepare has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 12, error handling 2 (5 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useComposerLinkPreviews.useComposerLinkPreviews (cognitive 35) · ×1
  • useComposerLinkPreviews.useComposerLinkPreviews (cognitive 35) desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:273 — useComposerLinkPreviews.useComposerLinkPreviews has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, ternaries 4 (5 pts), loops 4 (nesting depth added 10). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 443, 385, 411, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · terminalBanner.buildTerminalBanner (cognitive 35) · ×1
  • terminalBanner.buildTerminalBanner (cognitive 35) desktop/src/features/terminal/terminalBanner.ts:121 — terminalBanner.buildTerminalBanner has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 10 (13 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 213, handleSave, expirationUnixSeconds, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · bees.stepBees (cognitive 35) · ×1
  • bees.stepBees (cognitive 35) web/src/features/invite/ui/bees.ts:104 — bees.stepBees has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 7). None of this is in the body itself: all 35 points belong to one function literal inside it that branches (line 114). 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 · IosNavigationBarView.makeControlGroup (cognitive 34) · ×1
  • IosNavigationBarView.makeControlGroup (cognitive 34) mobile/ios/Runner/IosNavigationBar.swift:990 — IosNavigationBarView.makeControlGroup has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 5, ternaries 2 (3 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.
D2 · Cognitive Complexity · ActivityNotifier._resurfaceHiddenDm (cognitive 34) · ×1
  • ActivityNotifier._resurfaceHiddenDm (cognitive 34) mobile/lib/features/activity/activity_provider.dart:314 — 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 · ChannelsNotifier.build (cognitive 34) · ×1
  • ChannelsNotifier.build (cognitive 34) mobile/lib/features/channels/channels_provider.dart:206 — ChannelsNotifier.build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 10, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · ReadStateManager._mergeEvents (cognitive 34) · ×1
  • ReadStateManager._mergeEvents (cognitive 34) mobile/lib/shared/read_state/read_state_manager.dart:395 — ReadStateManager._mergeEvents has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · 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 · VoiceNoteAttachment.build (cognitive 33) · ×1
  • VoiceNoteAttachment.build (cognitive 33) mobile/lib/features/channels/voice_note_attachment.dart:45 — VoiceNoteAttachment.build has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 20, if/else 6 (7 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PairingNotifier._continueAfterSas (cognitive 33) · ×1
  • PairingNotifier._continueAfterSas (cognitive 33) mobile/lib/features/pairing/pairing_provider.dart:188 — PairingNotifier._continueAfterSas has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 16, if/else 11 (16 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BuzzPushLifecycle.build (cognitive 33) · ×1
  • _BuzzPushLifecycle.build (cognitive 33) mobile/lib/shared/push/push_bootstrap.dart:323 — _BuzzPushLifecycle.build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5, error handling 3 (5 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · hooks.useChannelSubscription (cognitive 33) · ×1
  • hooks.useChannelSubscription (cognitive 33) desktop/src/features/messages/hooks.ts:319 — hooks.useChannelSubscription has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (nesting depth added 6). None of this is in the body itself: all 33 points belong to 10 function literals inside it that branch (lines 328, 399, 407, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · plainTextProjection.buildPlainTextProjection.mapPMToTextOffset (cognitive 33) · ×1
  • plainTextProjection.buildPlainTextProjection.mapPMToTextOffset (cognitive 33) desktop/src/features/messages/lib/plainTextProjection.ts:204 — plainTextProjection.buildPlainTextProjection.mapPMToTextOffset has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · localStorageSweep.sweepChunked · ×1
  • localStorageSweep.sweepChunked::processSlice (cognitive 33) desktop/src/shared/lib/localStorageSweep.ts:215 — localStorageSweep.sweepChunked::processSlice has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 3 (5 pts), boolean chains 3, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 5 function literals inside it that branch (lines 152, 190, 235, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · NativeAddMembersSheetCoordinator.handle (cognitive 32) · ×1
  • NativeAddMembersSheetCoordinator.handle (cognitive 32) mobile/ios/Runner/NativeAddMembersSheet.swift:24 — NativeAddMembersSheetCoordinator.handle has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeProfileSetupCoordinator.init (cognitive 32) · ×1
  • NativeProfileSetupCoordinator.init (cognitive 32) mobile/ios/Runner/NativeProfileSetup.swift:26 — NativeProfileSetupCoordinator.init has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 10, ternaries 2 (3 pts), 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, 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 · ChannelMessagesNotifier._handleLiveEvent (cognitive 32) · ×1
  • ChannelMessagesNotifier._handleLiveEvent (cognitive 32) mobile/lib/features/channels/channel_messages_provider.dart:374 — 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 · _VideoTransportBar.build (cognitive 32) · ×1
  • _VideoTransportBar.build (cognitive 32) mobile/lib/features/channels/media_viewer_page/video_controls.dart:64 — _VideoTransportBar.build has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 10, boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MembersSheet.build (cognitive 32) · ×1
  • MembersSheet.build (cognitive 32) mobile/lib/features/channels/members_sheet.dart:37 — MembersSheet.build has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, loops 5 (6 pts), ternaries 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 · MessageContent._buildLink (cognitive 32) · ×1
  • MessageContent._buildLink (cognitive 32) mobile/lib/features/channels/message_content.dart:669 — MessageContent._buildLink has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10, match/switch 3 (5 pts), ternaries 4, 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 · _WebsiteBeeMotion.advance (cognitive 32) · ×1
  • _WebsiteBeeMotion.advance (cognitive 32) mobile/lib/features/pairing/pairing_page/website_bee_motion.dart:68 — _WebsiteBeeMotion.advance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ProfileSetupForm.build (cognitive 32) · ×1
  • _ProfileSetupForm.build (cognitive 32) mobile/lib/features/profile/profile_setup_page/form.dart:18 — _ProfileSetupForm.build has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 9 (11 pts), boolean chains 7, error handling 1, 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.
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, 17 points are the body's own statements and 15 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · 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 · SubscriptionRegistry · ×1
  • SubscriptionRegistry::fan_out_scoped (cognitive 31) crates/buzz-relay/src/subscription.rs:506 — 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.
D2 · Cognitive Complexity · ActivityNotifier._fetch (cognitive 31) · ×1
  • ActivityNotifier._fetch (cognitive 31) mobile/lib/features/activity/activity_provider.dart:456 — ActivityNotifier._fetch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 8, loops 7 (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 · _HuddleCallAvatar.build (cognitive 31) · ×1
  • _HuddleCallAvatar.build (cognitive 31) mobile/lib/features/channels/channel_detail_page/huddle_call_avatar.dart:32 — _HuddleCallAvatar.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 14, 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 · DefaultAgentLauncher.build (cognitive 31) · ×1
  • DefaultAgentLauncher.build (cognitive 31) mobile/lib/features/channels/default_agent_launcher.dart:28 — DefaultAgentLauncher.build has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (9 pts), ternaries 8, 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 · ReplySummaryLink.build (cognitive 31) · ×1
  • ReplySummaryLink.build (cognitive 31) mobile/lib/features/channels/reply_summary_link.dart:38 — ReplySummaryLink.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 7 (12 pts), loops 3 (4 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _ThreadMessageList.build (cognitive 31) · ×1
  • _ThreadMessageList.build (cognitive 31) mobile/lib/features/channels/thread_detail_page/message_list.dart:159 — _ThreadMessageList.build has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 9 (10 pts), ternaries 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _PairingCodeEntry.build (cognitive 31) · ×1
  • _PairingCodeEntry.build (cognitive 31) mobile/lib/features/pairing/pairing_page/pairing_code_entry.dart:22 — _PairingCodeEntry.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 12 (23 pts), if/else 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommunityThemeSyncManager.flush (cognitive 31) · ×1
  • CommunityThemeSyncManager.flush (cognitive 31) mobile/lib/shared/theme/community_theme_sync.dart:230 — CommunityThemeSyncManager.flush has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 9, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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: 14 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 198, a function literal at line 89, authorLabel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · InboxListPane.InboxListPane · ×1
  • InboxListPane.InboxListPane::renderItem (cognitive 31) desktop/src/features/home/ui/InboxListPane.tsx:309 — InboxListPane.InboxListPane::renderItem has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 22 (28 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (InboxListPane.InboxListPane) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · useInboxThreadContext.useInboxThreadContext (cognitive 31) · ×1
  • useInboxThreadContext.useInboxThreadContext (cognitive 31) desktop/src/features/home/useInboxThreadContext.ts:49 — useInboxThreadContext.useInboxThreadContext has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 11, ternaries 5, error handling 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 93, 110, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 3 function items inside it that branch (handleReveal, handleCreateBackup, handleTestOpenChange). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AndroidVoiceNotePackager.writeBlackVideoTrack (cognitive 30) · ×1
  • AndroidVoiceNotePackager.writeBlackVideoTrack (cognitive 30) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/AndroidVoiceNotePackager.kt:81 — AndroidVoiceNotePackager.writeBlackVideoTrack has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, error handling 2, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppDelegate.handleMediaUploadMethodCall (cognitive 30) · ×1
  • AppDelegate.handleMediaUploadMethodCall (cognitive 30) mobile/ios/Runner/AppDelegate.swift:805 — 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 · _ConversationAppBarTitle.build (cognitive 30) · ×1
  • _ConversationAppBarTitle.build (cognitive 30) mobile/lib/features/channels/channel_detail_page/app_bar.dart:36 — _ConversationAppBarTitle.build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 7 (10 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _VideoFileDownload._fetch (cognitive 30) · ×1
  • _VideoFileDownload._fetch (cognitive 30) mobile/lib/features/channels/native_video_files.dart:87 — _VideoFileDownload._fetch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 8, error handling 2 (3 pts), loops 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 · DeviceIdentitySource.loadProfile (cognitive 30) · ×1
  • DeviceIdentitySource.loadProfile (cognitive 30) mobile/lib/shared/hosted/device_identity_source.dart:32 — DeviceIdentitySource.loadProfile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (18 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaUploadService.uploadVideo (cognitive 30) · ×1
  • MediaUploadService.uploadVideo (cognitive 30) mobile/lib/shared/relay/media_upload.dart:349 — 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 · 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, 16 points are the body's own statements and 14 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · SettingsPanels.ThemeSettingsCard (cognitive 30) · ×1
  • SettingsPanels.ThemeSettingsCard (cognitive 30) desktop/src/features/settings/ui/SettingsPanels.tsx:421 — SettingsPanels.ThemeSettingsCard has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 19 (29 pts), if/else 9 (16 pts), boolean chains 10 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SettingsPanels.ThemeSettingsCard::handleModeSelect) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · inviteHelpers.parseInviteInput (cognitive 30) · ×1
  • inviteHelpers.parseInviteInput (cognitive 30) REDACTED:26 — inviteHelpers.parseInviteInput has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarnessRelay · ×1
  • HarnessRelay::discover_channels (cognitive 29) crates/buzz-acp/src/relay.rs:840 — 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 · 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 · IosNavigationBarView.makeItem (cognitive 29) · ×1
  • IosNavigationBarView.makeItem (cognitive 29) mobile/ios/Runner/IosNavigationBar.swift:1077 — IosNavigationBarView.makeItem has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 5 (9 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.
D2 · Cognitive Complexity · InviteJoinNotifier.confirmJoin (cognitive 29) · ×1
  • InviteJoinNotifier.confirmJoin (cognitive 29) mobile/lib/features/invites/invite_join_provider.dart:176 — InviteJoinNotifier.confirmJoin has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, ternaries 2 (5 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelaySessionNotifier._handleClosed (cognitive 29) · ×1
  • RelaySessionNotifier._handleClosed (cognitive 29) mobile/lib/shared/relay/relay_session.dart:883 — RelaySessionNotifier._handleClosed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7, ternaries 4 (6 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · IosNavigationMetrics.updateRail (cognitive 29) · ×1
  • IosNavigationMetrics.updateRail (cognitive 29) mobile/lib/shared/widgets/ios_navigation_metrics.dart:28 — IosNavigationMetrics.updateRail has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 23, if/else 4 (5 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PersonaModelCombobox.PersonaModelCombobox (cognitive 29) · ×1
  • PersonaModelCombobox.PersonaModelCombobox (cognitive 29) desktop/src/features/agents/ui/PersonaModelCombobox.tsx:22 — PersonaModelCombobox.PersonaModelCombobox has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, ternaries 3 (5 pts), loops 2, match/switch 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (handleKeyDown, a function literal at line 104, a function literal at line 182, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · usePersonaActions.usePersonaActions.handleSubmit (cognitive 29) · ×1
  • usePersonaActions.usePersonaActions.handleSubmit (cognitive 29) desktop/src/features/agents/ui/usePersonaActions.ts:175 — usePersonaActions.usePersonaActions.handleSubmit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 3 (7 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:217 — desktop.listenForDesktopNotificationActions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 3 (8 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 15). Of this number, 18 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · machineOnboarding.useMachineOnboardingState (cognitive 29) · ×1
  • machineOnboarding.useMachineOnboardingState (cognitive 29) desktop/src/features/onboarding/machineOnboarding.ts:99 — machineOnboarding.useMachineOnboardingState has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, if/else 13, ternaries 1. Of this number, 20 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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, 16 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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, 26 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch (a function literal at line 94, a function literal at line 140, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · RelayClient.sendRawWithReconnectRetry (cognitive 29) · ×1
  • RelayClient.sendRawWithReconnectRetry (cognitive 29) desktop/src/shared/api/relayClientSession.ts:743 — RelayClient.sendRawWithReconnectRetry has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 6, ternaries 3 (6 pts), error handling 2 (3 pts) (nesting depth added 12). Of this number, 16 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installNativeRig.openScope (cognitive 29) · ×1
  • 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.
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 · NativeProfileTextEditorViewController.tableView (cognitive 28) · ×1
  • NativeProfileTextEditorViewController.tableView (cognitive 28) mobile/ios/Runner/NativeProfileTextEditor.swift:566 — NativeProfileTextEditorViewController.tableView has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 6 (7 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 · RemoteAgentModelControl.build (cognitive 28) · ×1
  • RemoteAgentModelControl.build (cognitive 28) mobile/lib/features/agents/remote_agent_model_control.dart:35 — RemoteAgentModelControl.build has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 6 (8 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · _IOSAttachmentPopoverCoordinator.present (cognitive 28) · ×1
  • _IOSAttachmentPopoverCoordinator.present (cognitive 28) mobile/lib/features/channels/compose_bar/ios_attachment_popover.dart:42 — _IOSAttachmentPopoverCoordinator.present has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypingMotionPreview.build (cognitive 28) · ×1
  • TypingMotionPreview.build (cognitive 28) mobile/lib/features/channels/typing_motion_preview.dart:18 — TypingMotionPreview.build has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 4 (6 pts), ternaries 6 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HuddleSessionNotifier._wireMediaAndTransport (cognitive 28) · ×1
  • HuddleSessionNotifier._wireMediaAndTransport (cognitive 28) mobile/lib/shared/huddle/huddle_session.dart:408 — 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 · IosGlassNavigationButton.build (cognitive 28) · ×1
  • IosGlassNavigationButton.build (cognitive 28) mobile/lib/shared/widgets/ios_glass_navigation_button.dart:120 — IosGlassNavigationButton.build has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 9 (11 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.
D2 · Cognitive Complexity · useHuddlePresentation.useHuddlePresentation (cognitive 28) · ×1
  • useHuddlePresentation.useHuddlePresentation (cognitive 28) desktop/src/app/useHuddlePresentation.ts:31 — useHuddlePresentation.useHuddlePresentation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 6. Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 395, 384, 82, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AdminConsoleActionsTab.ActionsSection (cognitive 28) · ×1
  • AdminConsoleActionsTab.ActionsSection (cognitive 28) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:375 — AdminConsoleActionsTab.ActionsSection has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, ternaries 11 (12 pts), if/else 2 (nesting depth added 1). Of this number, 21 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AdminConsoleCommunities.CommunitiesTab (cognitive 28) · ×1
  • AdminConsoleCommunities.CommunitiesTab (cognitive 28) desktop/src/features/admin-console/AdminConsoleCommunities.tsx:37 — AdminConsoleCommunities.CommunitiesTab has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, ternaries 9 (10 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · observedUnreadNativeRig.installNativeRig.openScope (cognitive 28) · ×1
  • observedUnreadNativeRig.installNativeRig.openScope (cognitive 28) desktop/src/features/channels/observedUnreadNativeRig.mjs:186 — observedUnreadNativeRig.installNativeRig.openScope has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (12 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useUnreadChannels.useUnreadChannels.rawUnread (cognitive 28) · ×1
  • useUnreadChannels.useUnreadChannels.rawUnread (cognitive 28) desktop/src/features/channels/useUnreadChannels.ts:798 — useUnreadChannels.useUnreadChannels.rawUnread has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 3 (7 pts), boolean chains 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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). None of this is in the body itself: all 28 points belong to 4 function literals inside it that branch (lines 131, 95, 113, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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. None of this is in the body itself: all 28 points belong to 13 function literals inside it that branch (lines 90, 157, 33, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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:27 — relayClosedRecovery.handleRelayClosed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (26 pts), boolean chains 2 (nesting depth added 18). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (retryWhenAdmitted, a function literal at line 86, a function literal at line 78). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:189 — 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:439 — _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 · SettingsProfileHeader.build (cognitive 27) · ×1
  • SettingsProfileHeader.build (cognitive 27) mobile/lib/features/profile/settings_profile_header.dart:30 — SettingsProfileHeader.build has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 10, boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HostedRelayAuth._headers (cognitive 27) · ×1
  • HostedRelayAuth._headers (cognitive 27) mobile/lib/shared/hosted/hosted_relay_auth.dart:276 — HostedRelayAuth._headers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 6, error handling 1 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SelfHostedEntry.prepare (cognitive 27) · ×1
  • SelfHostedEntry.prepare (cognitive 27) mobile/lib/shared/hosted/self_hosted_entry.dart:61 — SelfHostedEntry.prepare has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · 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, 18 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 187, a function literal at line 236, a function literal at line 68, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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, 16 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · 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). None of this is in the body itself: all 27 points belong to 5 function literals inside it that branch (lines 499, 657, 584, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useMentions.useMentions.handleMentionKeyDown (cognitive 27) · ×1
  • useMentions.useMentions.handleMentionKeyDown (cognitive 27) desktop/src/features/messages/lib/useMentions.ts:839 — useMentions.useMentions.handleMentionKeyDown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 9). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch (a function literal at line 357, a function literal at line 262, a function literal at line 305, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · installNativeRig.ingest (cognitive 27) · ×1
  • 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 · 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 · _ReadOnlyNotice.build (cognitive 26) · ×1
  • _ReadOnlyNotice.build (cognitive 26) mobile/lib/features/channels/channel_detail_page/banners.dart:8 — _ReadOnlyNotice.build has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (8 pts), boolean chains 4, error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuilderlabAccountClient._request (cognitive 26) · ×1
  • BuilderlabAccountClient._request (cognitive 26) mobile/lib/shared/hosted/builderlab_account.dart:464 — BuilderlabAccountClient._request has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AndroidTransparentAvatar.build (cognitive 26) · ×1
  • AndroidTransparentAvatar.build (cognitive 26) mobile/lib/shared/widgets/android_transparent_avatar.dart:20 — AndroidTransparentAvatar.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 4, boolean chains 3, ternaries 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 · IosScrollToTop.build (cognitive 26) · ×1
  • IosScrollToTop.build (cognitive 26) mobile/lib/shared/widgets/ios_scroll_to_top.dart:17 — IosScrollToTop.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AdminConsoleStaffingTab.StaffingTab (cognitive 26) · ×1
  • AdminConsoleStaffingTab.StaffingTab (cognitive 26) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:442 — AdminConsoleStaffingTab.StaffingTab has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 8, error handling 3, ternaries 3. Of this number, 15 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · 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, 16 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ModelPicker.ModelPicker (cognitive 26) · ×1
  • ModelPicker.ModelPicker (cognitive 26) desktop/src/features/agents/ui/ModelPicker.tsx:34 — ModelPicker.ModelPicker has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (28 pts), if/else 9 (14 pts), boolean chains 5, error handling 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ModelPicker.ModelPicker::handleModelChange) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 · InboxListPane.InboxListPane (cognitive 26) · ×1
  • InboxListPane.InboxListPane (cognitive 26) desktop/src/features/home/ui/InboxListPane.tsx:243 — InboxListPane.InboxListPane has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 34 (61 pts), boolean chains 9, if/else 5 (9 pts), loops 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (InboxListPane.InboxListPane::renderItem) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · 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:548 — ThemeProvider.ThemeProvider has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 6, boolean chains 4, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 746, 605, 623, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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. None of this is in the body itself: all 26 points belong to 8 function literals inside it that branch (lines 189, 96, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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 · _HuddleJoinSurface.build (cognitive 25) · ×1
  • _HuddleJoinSurface.build (cognitive 25) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:327 — _HuddleJoinSurface.build has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 16, ternaries 7, 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 · MobileHuddleController._start (cognitive 25) · ×1
  • MobileHuddleController._start (cognitive 25) mobile/lib/features/channels/mobile_huddle_controller.dart:156 — MobileHuddleController._start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 3 (8 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 · _SearchBody.build (cognitive 25) · ×1
  • _SearchBody.build (cognitive 25) mobile/lib/features/search/search_page.dart:332 — _SearchBody.build has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (10 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 · HuddleSessionNotifier.join (cognitive 25) · ×1
  • HuddleSessionNotifier.join (cognitive 25) mobile/lib/shared/huddle/huddle_session.dart:222 — 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:523 — 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:268 — UserCacheNotifier._flushPending has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (2 pts), boolean chains 1, 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 · FilterChipBar.build (cognitive 25) · ×1
  • FilterChipBar.build (cognitive 25) mobile/lib/shared/widgets/filter_chip_bar.dart:92 — FilterChipBar.build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (5 pts), loops 3 (4 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 · usePersonaSync.startPersonaSync (cognitive 25) · ×1
  • usePersonaSync.startPersonaSync (cognitive 25) desktop/src/features/agents/lib/usePersonaSync.ts:279 — usePersonaSync.startPersonaSync has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). None of this is in the body itself: all 25 points belong to 7 function items inside it that branch (runBackfill, onLiveEvent, openBoundaryAndDrain, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · usePersonaModelDiscovery.usePersonaModelDiscovery (cognitive 25) · ×1
  • usePersonaModelDiscovery.usePersonaModelDiscovery (cognitive 25) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:200 — usePersonaModelDiscovery.usePersonaModelDiscovery has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8, ternaries 5 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 277, 333, 325, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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, 15 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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). Of this number, 22 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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). None of this is in the body itself: all 25 points belong to one function literal inside it that branches (line 74). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TimelineMessageRow.MessageRowItem (cognitive 25) · ×1
  • TimelineMessageRow.MessageRowItem (cognitive 25) desktop/src/features/messages/ui/TimelineMessageRow.tsx:94 — TimelineMessageRow.MessageRowItem has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 11, if/else 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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). None of this is in the body itself: all 25 points belong to 11 function literals inside it that branch (lines 158, 115, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (submitFeedback, attachImage, selectCategory, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · RelayClient.handleWsMessage (cognitive 25) · ×1
  • RelayClient.handleWsMessage (cognitive 25) desktop/src/shared/api/relayClientSession.ts:865 — RelayClient.handleWsMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 7, ternaries 2 (4 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AndroidMediaSanitizer.scrubJpeg (cognitive 24) · ×1
  • AndroidMediaSanitizer.scrubJpeg (cognitive 24) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/AndroidMediaSanitizer.kt:44 — AndroidMediaSanitizer.scrubJpeg has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeStatusEditorViewController.tableView (cognitive 24) · ×1
  • NativeStatusEditorViewController.tableView (cognitive 24) mobile/ios/Runner/NativeStatusEditor.swift:132 — NativeStatusEditorViewController.tableView has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 12). 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 · 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 · _AgentsNavigation.build (cognitive 24) · ×1
  • _AgentsNavigation.build (cognitive 24) mobile/lib/features/agents/agents_page.dart:133 — _AgentsNavigation.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, ternaries 3, 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 · MobileHuddleController._finishLeaveLifecycle (cognitive 24) · ×1
  • MobileHuddleController._finishLeaveLifecycle (cognitive 24) mobile/lib/features/channels/mobile_huddle_controller.dart:450 — MobileHuddleController._finishLeaveLifecycle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, error handling 3 (5 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 · HostedJoinPolicyView.build (cognitive 24) · ×1
  • HostedJoinPolicyView.build (cognitive 24) mobile/lib/features/onboarding/hosted_join_policy_view.dart:21 — HostedJoinPolicyView.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 6, 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 · 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 · RemoteAgentController.ensureBinding (cognitive 24) · ×1
  • RemoteAgentController.ensureBinding (cognitive 24) mobile/lib/shared/agents/remote_agents.dart:415 — RemoteAgentController.ensureBinding has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · RemoteAgentController.deleteAgent (cognitive 24) · ×1
  • RemoteAgentController.deleteAgent (cognitive 24) mobile/lib/shared/agents/remote_agents.dart:826 — RemoteAgentController.deleteAgent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · VerifiedProfilesNotifier._syncBatches (cognitive 24) · ×1
  • VerifiedProfilesNotifier._syncBatches (cognitive 24) mobile/lib/shared/verified_profiles/verified_profile_directory.dart:286 — VerifiedProfilesNotifier._syncBatches has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useApplyTemplate.useApplyTemplate.applyAgents (cognitive 24) · ×1
  • useApplyTemplate.useApplyTemplate.applyAgents (cognitive 24) desktop/src/features/channel-templates/useApplyTemplate.ts:57 — useApplyTemplate.useApplyTemplate.applyAgents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · 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, 21 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cognitive 24) · ×1
  • useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cognitive 24) desktop/src/features/sidebar/ui/useSidebarRelayConnectionCard.ts:63 — useSidebarRelayConnectionCard.useSidebarRelayConnectionCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 11, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 115, 157, 185). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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). Of this number, 20 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buzz_search · ×1
  • buzz_search::query::search (cognitive 23) crates/buzz-search/src/query.rs:269 — buzz_search::query::search has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 2, 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 · NativeAttachmentPopoverViewController.configureAndStartCamera (cognitive 23) · ×1
  • NativeAttachmentPopoverViewController.configureAndStartCamera (cognitive 23) mobile/ios/Runner/NativeAttachmentPopover.swift:663 — 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 · ThemePaginationControl.updateDots (cognitive 23) · ×1
  • ThemePaginationControl.updateDots (cognitive 23) mobile/ios/Runner/ThemePaginationGlassControl.swift:204 — ThemePaginationControl.updateDots has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (8 pts), if/else 5 (6 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MobileHuddleCallPage.build (cognitive 23) · ×1
  • _MobileHuddleCallPage.build (cognitive 23) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:584 — _MobileHuddleCallPage.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 3, ternaries 3, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DynamicIslandQrScannerPortal.build (cognitive 23) · ×1
  • _DynamicIslandQrScannerPortal.build (cognitive 23) mobile/lib/features/pairing/pairing_qr_scanner/dynamic_island_portal.dart:20 — _DynamicIslandQrScannerPortal.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _SetStatusSheet.build (cognitive 23) · ×1
  • _SetStatusSheet.build (cognitive 23) mobile/lib/features/profile/set_status_sheet.dart:178 — _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 · AccountIdentityStore._read (cognitive 23) · ×1
  • AccountIdentityStore._read (cognitive 23) mobile/lib/shared/hosted/account_identity_store.dart:326 — AccountIdentityStore._read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MeGroups.decode (cognitive 23) · ×1
  • MeGroups.decode (cognitive 23) mobile/lib/shared/me/me_groups.dart:21 — MeGroups.decode has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 19, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CoveredRouteKeyboardInsets.build (cognitive 23) · ×1
  • CoveredRouteKeyboardInsets.build (cognitive 23) mobile/lib/shared/widgets/covered_route_keyboard_insets.dart:38 — CoveredRouteKeyboardInsets.build has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (10 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminConsoleReportsTab.ResolveReportForm (cognitive 23) · ×1
  • AdminConsoleReportsTab.ResolveReportForm (cognitive 23) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:367 — AdminConsoleReportsTab.ResolveReportForm has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 15, if/else 4 (6 pts), error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (handleSubmit, a function literal at line 452, a function literal at line 394, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · observedUnreadNativeRig.installNativeRig.ingest (cognitive 23) · ×1
  • observedUnreadNativeRig.installNativeRig.ingest (cognitive 23) desktop/src/features/channels/observedUnreadNativeRig.mjs:217 — observedUnreadNativeRig.installNativeRig.ingest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · 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 · hooks.usePresenceSession (cognitive 23) · ×1
  • hooks.usePresenceSession (cognitive 23) desktop/src/features/presence/hooks.ts:224 — hooks.usePresenceSession has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 7, boolean chains 2 (nesting depth added 7). Of this number, 14 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · 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 items inside it that branch (pick, a function literal at line 303). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · markdown.createMarkdownComponents.a (cognitive 23) · ×1
  • markdown.createMarkdownComponents.a (cognitive 23) desktop/src/shared/ui/markdown.tsx:1220 — markdown.createMarkdownComponents.a has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 5, boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · DeleteAgentAction.build (cognitive 22) · ×1
  • DeleteAgentAction.build (cognitive 22) mobile/lib/features/agents/delete_agent_action.dart:30 — DeleteAgentAction.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (7 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelMessagesNotifier._pruneOffWindowReplies (cognitive 22) · ×1
  • ChannelMessagesNotifier._pruneOffWindowReplies (cognitive 22) mobile/lib/features/channels/channel_messages_provider.dart:710 — 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 · MessageSwipeReply.build (cognitive 22) · ×1
  • MessageSwipeReply.build (cognitive 22) mobile/lib/features/channels/message_swipe_reply.dart:44 — MessageSwipeReply.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (7 pts), boolean chains 5 (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 · HomeScreenShortcutHost.build (cognitive 22) · ×1
  • HomeScreenShortcutHost.build (cognitive 22) mobile/lib/features/home/home_screen_shortcut_host.dart:32 — HomeScreenShortcutHost.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, boolean chains 8, match/switch 2 (3 pts), loops 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 · PairingNotifier._processPayload (cognitive 22) · ×1
  • PairingNotifier._processPayload (cognitive 22) mobile/lib/features/pairing/pairing_provider.dart:723 — PairingNotifier._processPayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 2 (4 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 · BrowserAuth.start (cognitive 22) · ×1
  • BrowserAuth.start (cognitive 22) mobile/lib/shared/hosted/browser_auth.dart:120 — BrowserAuth.start has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 2 (4 pts), error handling 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 · newAppInstallerDownload.reduceInstallerDialog (cognitive 22) · ×1
  • newAppInstallerDownload.reduceInstallerDialog (cognitive 22) desktop/src/app/newAppInstallerDownload.ts:54 — newAppInstallerDownload.reduceInstallerDialog has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 10). 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 · 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 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.
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). None of this is in the body itself: all 22 points belong to one function literal inside it that branches (line 52). 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 · 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 items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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, 11 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsPanels.ThemeSettingsCard · ×1
  • SettingsPanels.ThemeSettingsCard::handleModeSelect (cognitive 22) desktop/src/features/settings/ui/SettingsPanels.tsx:480 — SettingsPanels.ThemeSettingsCard::handleModeSelect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (SettingsPanels.ThemeSettingsCard) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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:197 — 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). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 88, 85). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 items inside it that branch (a function literal at line 1089, a function literal at line 1008, a function literal at line 1057, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · IosNavigationBarView.applyScroll (cognitive 21) · ×1
  • IosNavigationBarView.applyScroll (cognitive 21) mobile/ios/Runner/IosNavigationBar.swift:913 — IosNavigationBarView.applyScroll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeAddMembersViewController.configure (cognitive 21) · ×1
  • NativeAddMembersViewController.configure (cognitive 21) mobile/ios/Runner/NativeAddMembersSheet.swift:355 — NativeAddMembersViewController.configure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 3 (5 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 · 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). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HuddleParticipantCluster.build (cognitive 21) · ×1
  • _HuddleParticipantCluster.build (cognitive 21) mobile/lib/features/channels/channel_detail_page/huddle_participant_cluster.dart:67 — _HuddleParticipantCluster.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 8, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelMessagesNotifier._cachedThreadReplyIdsByRoot (cognitive 21) · ×1
  • ChannelMessagesNotifier._cachedThreadReplyIdsByRoot (cognitive 21) mobile/lib/features/channels/channel_messages_provider.dart:630 — ChannelMessagesNotifier._cachedThreadReplyIdsByRoot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (7 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 · _PreviewBuilder._tokens (cognitive 21) · ×1
  • _PreviewBuilder._tokens (cognitive 21) mobile/lib/features/channels/message_content/preview_text.dart:397 — _PreviewBuilder._tokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (7 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 · SendMessage._resolveMentions (cognitive 21) · ×1
  • SendMessage._resolveMentions (cognitive 21) mobile/lib/features/channels/send_message_provider.dart:189 — SendMessage._resolveMentions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · PairingNotifier._pairNipAb (cognitive 21) · ×1
  • PairingNotifier._pairNipAb (cognitive 21) mobile/lib/features/pairing/pairing_provider.dart:360 — PairingNotifier._pairNipAb has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelData.fromEvent (cognitive 21) · ×1
  • ChannelData.fromEvent (cognitive 21) mobile/lib/shared/relay/nostr_models.dart:330 — ChannelData.fromEvent has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 5, if/else 2 (4 pts), loops 2 (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 · RelaySessionNotifier.searchProfiles (cognitive 21) · ×1
  • RelaySessionNotifier.searchProfiles (cognitive 21) mobile/lib/shared/relay/relay_session.dart:161 — RelaySessionNotifier.searchProfiles has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (8 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AvatarEditorOptions.build (cognitive 21) · ×1
  • AvatarEditorOptions.build (cognitive 21) mobile/lib/shared/widgets/avatar_editor_options.dart:24 — AvatarEditorOptions.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 2 (3 pts), ternaries 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 · AdminConsoleFeedbackTab.AttachmentViewer (cognitive 21) · ×1
  • AdminConsoleFeedbackTab.AttachmentViewer (cognitive 21) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx:171 — AdminConsoleFeedbackTab.AttachmentViewer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (8 pts), error handling 2, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 217, 278, 207, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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:849 — observerRelayStore.ingestArchivedObserverEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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, 16 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · useCommunityUnread.useCommunityUnread (cognitive 21) · ×1
  • useCommunityUnread.useCommunityUnread (cognitive 21) desktop/src/features/communities/useCommunityUnread.ts:50 — useCommunityUnread.useCommunityUnread has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (3 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 8). None of this is in the body itself: all 21 points belong to 5 function literals inside it that branch (lines 113, 73, 89, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AddAgentDialog.AddAgentDialog · ×1
  • AddAgentDialog.AddAgentDialog::handleAdd (cognitive 21) desktop/src/features/huddle/components/AddAgentDialog.tsx:77 — AddAgentDialog.AddAgentDialog::handleAdd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 3 (6 pts), ternaries 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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) REDACTED:602 — mentionHighlightExtension.selectionAfterMentionTrailingSpace has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, loops 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 620, 647). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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). None of this is in the body itself: all 21 points belong to 3 function literals inside it that branch (lines 30, 81, 21). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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 · useSearchResults.useSearchResults (cognitive 21) · ×1
  • useSearchResults.useSearchResults (cognitive 21) desktop/src/features/search/useSearchResults.ts:102 — useSearchResults.useSearchResults has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 3, ternaries 3. Of this number, 18 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · use-updater.useUpdater.runUpdateCheck (cognitive 21) · ×1
  • use-updater.useUpdater.runUpdateCheck (cognitive 21) desktop/src/features/settings/hooks/use-updater.ts:125 — use-updater.useUpdater.runUpdateCheck has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.<returned closure> · ×1
  • rehypeSearchHighlight.rehypeSearchHighlight.<returned closure>::walk (cognitive 21) desktop/src/shared/lib/rehypeSearchHighlight.ts:42 — rehypeSearchHighlight.rehypeSearchHighlight.<returned closure>::walk 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · EntityDeletionStore · ×1
  • EntityDeletionStore::transition_stage (cognitive 20) REDACTED:214 — EntityDeletionStore::transition_stage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Progress · ×1
  • Progress::rebuild (cognitive 20) crates/buzz-deletion/src/user/workflow.rs:101 — Progress::rebuild has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buzz_workflow · ×1
  • buzz_workflow::executor::dispatch_action (cognitive 20) crates/buzz-workflow/src/executor.rs:588 — buzz_workflow::executor::dispatch_action has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (4 pts), loops 1 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
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 · NativePhotoZoomViewController.load (cognitive 20) · ×1
  • NativePhotoZoomViewController.load (cognitive 20) mobile/ios/Runner/NativePhotoZoomCoordinator.swift:378 — NativePhotoZoomViewController.load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, loops 1, 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 · _CommunityGridAction.build (cognitive 20) · ×1
  • _CommunityGridAction.build (cognitive 20) mobile/lib/features/channels/channels_page/community_switcher_action.dart:16 — _CommunityGridAction.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 3, if/else 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChannelsNotifier._fetchChannelHistoryBatch (cognitive 20) · ×1
  • ChannelsNotifier._fetchChannelHistoryBatch (cognitive 20) mobile/lib/features/channels/channels_provider.dart:662 — ChannelsNotifier._fetchChannelHistoryBatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), ternaries 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ComposeBarLayout._buildBar (cognitive 20) · ×1
  • _ComposeBarLayout._buildBar (cognitive 20) mobile/lib/features/channels/compose_bar/layout.dart:88 — _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 · _VideoZoomSurface.build (cognitive 20) · ×1
  • _VideoZoomSurface.build (cognitive 20) mobile/lib/features/channels/media_viewer_page/video_zoom_surface.dart:27 — _VideoZoomSurface.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _PreviewBuilder.line (cognitive 20) · ×1
  • _PreviewBuilder.line (cognitive 20) mobile/lib/features/channels/message_content/preview_text.dart:294 — _PreviewBuilder.line has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 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 · MobileHuddleController.end (cognitive 20) · ×1
  • MobileHuddleController.end (cognitive 20) mobile/lib/features/channels/mobile_huddle_controller.dart:514 — 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 · ReactionRow.build (cognitive 20) · ×1
  • ReactionRow.build (cognitive 20) mobile/lib/features/channels/reaction_row.dart:139 — ReactionRow.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplyActivityHandoff.build (cognitive 20) · ×1
  • ReplyActivityHandoff.build (cognitive 20) mobile/lib/features/channels/reply_activity_handoff.dart:26 — ReplyActivityHandoff.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 7, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DeviceVoiceNotePlayerController._load (cognitive 20) · ×1
  • DeviceVoiceNotePlayerController._load (cognitive 20) mobile/lib/features/channels/voice_note_recording.dart:712 — 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 · SettingsPage.build (cognitive 20) · ×1
  • SettingsPage.build (cognitive 20) mobile/lib/features/settings/settings_page.dart:77 — SettingsPage.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8, boolean chains 5, ternaries 5, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _ConnectionSection.build (cognitive 20) · ×1
  • _ConnectionSection.build (cognitive 20) mobile/lib/features/settings/settings_page/connection_section.dart:8 — _ConnectionSection.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuilderlabBuild.parse (cognitive 20) · ×1
  • BuilderlabBuild.parse (cognitive 20) mobile/lib/shared/hosted/builderlab_build.dart:72 — BuilderlabBuild.parse has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 13, if/else 7. 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 · DeviceIdentitySource._read (cognitive 20) · ×1
  • DeviceIdentitySource._read (cognitive 20) mobile/lib/shared/hosted/device_identity_source.dart:96 — DeviceIdentitySource._read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), ternaries 1 (4 pts), boolean chains 1, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuzzPushLeaseDescriptor.fromRelayInformation (cognitive 20) · ×1
  • BuzzPushLeaseDescriptor.fromRelayInformation (cognitive 20) mobile/lib/shared/push/dev_push_lease.dart:50 — BuzzPushLeaseDescriptor.fromRelayInformation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelaySessionNotifier._sendReplayBatches (cognitive 20) · ×1
  • RelaySessionNotifier._sendReplayBatches (cognitive 20) mobile/lib/shared/relay/relay_session.dart:756 — 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 · BuzzSettingMenu._buildMenu (cognitive 20) · ×1
  • BuzzSettingMenu._buildMenu (cognitive 20) mobile/lib/shared/widgets/buzz_setting_menu.dart:64 — BuzzSettingMenu._buildMenu has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 4, loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IosMediaCarousel.build (cognitive 20) · ×1
  • IosMediaCarousel.build (cognitive 20) mobile/lib/shared/widgets/ios_media_carousel.dart:41 — IosMediaCarousel.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IosMessageCreateButton.build (cognitive 20) · ×1
  • IosMessageCreateButton.build (cognitive 20) mobile/lib/shared/widgets/ios_message_create_button.dart:81 — IosMessageCreateButton.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 4, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NewAppInstallerDialog.NewAppInstallerDialog (cognitive 20) · ×1
  • NewAppInstallerDialog.NewAppInstallerDialog (cognitive 20) desktop/src/app/NewAppInstallerDialog.tsx:71 — NewAppInstallerDialog.NewAppInstallerDialog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (13 pts), if/else 6, boolean chains 1 (nesting depth added 2). Of this number, 12 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · 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) desktop/src/features/agents/ui/agentConfigOptions.tsx:659 — agentConfigOptions.computeLocalModeGate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useNewMessageRecipients.useNewMessageRecipients.searchResults (cognitive 20) · ×1
  • useNewMessageRecipients.useNewMessageRecipients.searchResults (cognitive 20) desktop/src/features/messages/ui/useNewMessageRecipients.ts:101 — useNewMessageRecipients.useNewMessageRecipients.searchResults has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (4 pts), ternaries 3 (4 pts), loops 3 (nesting depth added 2). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (addCandidate). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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) desktop/src/shared/lib/detectPrefixQuery.ts:16 — detectPrefixQuery.detectPrefixQuery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MembershipCache · ×1
  • MembershipCache::members (cognitive 19) crates/buzz-relay/src/membership_cache.rs:195 — MembershipCache::members has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (9 pts), loops 4 (6 pts), if/else 2 (4 pts) (nesting depth added 9). 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 · 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 · ChannelMessagesNotifier._init (cognitive 19) · ×1
  • ChannelMessagesNotifier._init (cognitive 19) mobile/lib/features/channels/channel_messages_provider.dart:229 — ChannelMessagesNotifier._init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelSectionsManager._publish (cognitive 19) · ×1
  • ChannelSectionsManager._publish (cognitive 19) mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:465 — ChannelSectionsManager._publish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 7, error handling 1 (nesting depth added 6). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _CreateChannelSheet.build (cognitive 19) · ×1
  • _CreateChannelSheet.build (cognitive 19) mobile/lib/features/channels/channels_page/sheets.dart:25 — _CreateChannelSheet.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (5 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MentionSuggestionInfo.build (cognitive 19) · ×1
  • _MentionSuggestionInfo.build (cognitive 19) mobile/lib/features/channels/compose_bar/suggestions.dart:164 — _MentionSuggestionInfo.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _DeepLinkDispatcherState._dispatchOnboarding (cognitive 19) · ×1
  • _DeepLinkDispatcherState._dispatchOnboarding (cognitive 19) mobile/lib/features/channels/deep_link_dispatcher.dart:169 — _DeepLinkDispatcherState._dispatchOnboarding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _IosAddMembersSheetState._drainAvatars (cognitive 19) · ×1
  • _IosAddMembersSheetState._drainAvatars (cognitive 19) mobile/lib/features/channels/ios_add_members_sheet.dart:73 — _IosAddMembersSheetState._drainAvatars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (7 pts), boolean chains 6, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MessageImageCarousel.build (cognitive 19) · ×1
  • _MessageImageCarousel.build (cognitive 19) mobile/lib/features/channels/message_content/media_carousel.dart:144 — _MessageImageCarousel.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (7 pts), loops 6, boolean chains 3, if/else 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _MessageVideoPreview.build (cognitive 19) · ×1
  • _MessageVideoPreview.build (cognitive 19) mobile/lib/features/channels/message_content/video_preview.dart:16 — _MessageVideoPreview.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, 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 · _MessageLongPressRegion.build (cognitive 19) · ×1
  • _MessageLongPressRegion.build (cognitive 19) mobile/lib/features/channels/message_long_press_region.dart:112 — _MessageLongPressRegion.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 2 (3 pts), ternaries 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MessageSkeletonBody.build (cognitive 19) · ×1
  • MessageSkeletonBody.build (cognitive 19) mobile/lib/features/channels/message_skeleton_body.dart:24 — MessageSkeletonBody.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _PhotoLoad.encode (cognitive 19) · ×1
  • _PhotoLoad.encode (cognitive 19) mobile/lib/features/channels/native_photo_zoom_preview.dart:326 — _PhotoLoad.encode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SendMessage.call (cognitive 19) · ×1
  • SendMessage.call (cognitive 19) mobile/lib/features/channels/send_message_provider.dart:49 — SendMessage.call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, ternaries 3, boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ThreadHeadScrollInput.build (cognitive 19) · ×1
  • _ThreadHeadScrollInput.build (cognitive 19) mobile/lib/features/channels/thread_detail_page/head_layout.dart:62 — _ThreadHeadScrollInput.build has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 7, if/else 3 (4 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InviteJoinSheet.build (cognitive 19) · ×1
  • InviteJoinSheet.build (cognitive 19) mobile/lib/features/invites/invite_join_sheet.dart:87 — InviteJoinSheet.build has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 6, match/switch 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 · HuddleTransport._handleRoster (cognitive 19) · ×1
  • HuddleTransport._handleRoster (cognitive 19) mobile/lib/shared/huddle/huddle_transport.dart:641 — HuddleTransport._handleRoster has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NsecExportSheet.build (cognitive 19) · ×1
  • NsecExportSheet.build (cognitive 19) mobile/lib/shared/identity_transfer/nsec_export_sheet.dart:37 — NsecExportSheet.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MeSync._writeCache (cognitive 19) · ×1
  • MeSync._writeCache (cognitive 19) mobile/lib/shared/me/me_sync.dart:261 — MeSync._writeCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadStateManager.reinitializeRemote (cognitive 19) · ×1
  • ReadStateManager.reinitializeRemote (cognitive 19) mobile/lib/shared/read_state/read_state_manager.dart:293 — ReadStateManager.reinitializeRemote has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BeeMorphPainter.paint (cognitive 19) · ×1
  • _BeeMorphPainter.paint (cognitive 19) mobile/lib/shared/widgets/bee_loading_mark.dart:63 — _BeeMorphPainter.paint has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (16 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.
D2 · Cognitive Complexity · FilterChipBar._chip (cognitive 19) · ×1
  • FilterChipBar._chip (cognitive 19) mobile/lib/shared/widgets/filter_chip_bar.dart:196 — FilterChipBar._chip has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 15, if/else 3, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _CarouselImages._drain (cognitive 19) · ×1
  • _CarouselImages._drain (cognitive 19) mobile/lib/shared/widgets/ios_media_carousel.dart:179 — _CarouselImages._drain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TextEditSheet.build (cognitive 19) · ×1
  • _TextEditSheet.build (cognitive 19) mobile/lib/shared/widgets/text_editor.dart:95 — _TextEditSheet.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 6, boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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. None of this is in the body itself: all 19 points belong to 3 function literals inside it that branch (lines 56, 39, 32). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AdminConsoleActionsTab.DirectActionsProvider (cognitive 19) · ×1
  • AdminConsoleActionsTab.DirectActionsProvider (cognitive 19) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:194 — AdminConsoleActionsTab.DirectActionsProvider has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 4, error handling 2 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 4 function items inside it that branch (a function literal at line 257, a function literal at line 229, locked, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · agentSessionTranscriptHelpers.parseSystemPromptSections · ×1
  • agentSessionTranscriptHelpers.parseSystemPromptSections::appendBaseAndWorkspace (cognitive 19) REDACTED:231 — agentSessionTranscriptHelpers.parseSystemPromptSections::appendBaseAndWorkspace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (19 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (agentSessionTranscriptHelpers.parseSystemPromptSections) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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). None of this is in the body itself: all 19 points belong to 5 function literals inside it that branch (lines 75, 54, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · useNonMemberInvite.useNonMemberInvite.invite (cognitive 19) · ×1
  • useNonMemberInvite.useNonMemberInvite.invite (cognitive 19) desktop/src/features/messages/ui/useNonMemberInvite.ts:79 — useNonMemberInvite.useNonMemberInvite.invite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 94, a function literal at line 150, isCurrent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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). None of this is in the body itself: all 19 points belong to 5 function literals inside it that branch (lines 77, 121, 34, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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. None of this is in the body itself: all 19 points belong to 8 function literals inside it that branch (lines 81, 140, 179, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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 items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · useChannelMutes.useChannelMutes (cognitive 19) · ×1
  • useChannelMutes.useChannelMutes (cognitive 19) desktop/src/features/sidebar/lib/useChannelMutes.ts:19 — useChannelMutes.useChannelMutes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useChannelStars.useChannelStars (cognitive 19) · ×1
  • useChannelStars.useChannelStars (cognitive 19) desktop/src/features/sidebar/lib/useChannelStars.ts:19 — useChannelStars.useChannelStars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · buzz_admin · ×1
  • buzz_admin::reconcile_channels (cognitive 18) crates/buzz-admin/src/main.rs:729 — buzz_admin::reconcile_channels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandVerifier · ×1
  • CommandVerifier::authenticate_at (cognitive 18) crates/buzz-auth/src/nip_fi/command.rs:325 — CommandVerifier::authenticate_at has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DeletionStore · ×1
  • DeletionStore::admit_owner_request (cognitive 18) REDACTED:976 — DeletionStore::admit_owner_request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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 · IosNavigationBarView.reportRailGeometry (cognitive 18) · ×1
  • IosNavigationBarView.reportRailGeometry (cognitive 18) mobile/ios/Runner/IosNavigationBar.swift:565 — IosNavigationBarView.reportRailGeometry has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 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 · NativeMessagePresentationCoordinator.handle (cognitive 18) · ×1
  • NativeMessagePresentationCoordinator.handle (cognitive 18) mobile/ios/Runner/NativeMessagePresentationCoordinator.swift:23 — NativeMessagePresentationCoordinator.handle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · NativeMessageGlyph.init (cognitive 18) · ×1
  • NativeMessageGlyph.init (cognitive 18) mobile/ios/Runner/NativeReactionDetails.swift:372 — NativeMessageGlyph.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, loops 1, 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 · ObserverRelayNotifier._subscribe (cognitive 18) · ×1
  • ObserverRelayNotifier._subscribe (cognitive 18) mobile/lib/features/channels/agent_activity/observer_subscription.dart:111 — 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:279 — _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 · _ReplyHandoffs.update (cognitive 18) · ×1
  • _ReplyHandoffs.update (cognitive 18) mobile/lib/features/channels/agent_reply_handoff.dart:27 — _ReplyHandoffs.update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AttachmentSurfacePanel.build (cognitive 18) · ×1
  • _AttachmentSurfacePanel.build (cognitive 18) mobile/lib/features/channels/compose_bar/attachments.dart:175 — _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:517 — _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 · _DeepLinkDispatcherState._maybeDispatch (cognitive 18) · ×1
  • _DeepLinkDispatcherState._maybeDispatch (cognitive 18) mobile/lib/features/channels/deep_link_dispatcher.dart:99 — _DeepLinkDispatcherState._maybeDispatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7 (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 · _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 · PairingNotifier._pairLegacy (cognitive 18) · ×1
  • PairingNotifier._pairLegacy (cognitive 18) mobile/lib/features/pairing/pairing_provider.dart:870 — PairingNotifier._pairLegacy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ProfileTextEditSheet.build (cognitive 18) · ×1
  • _ProfileTextEditSheet.build (cognitive 18) mobile/lib/features/profile/profile_edit_page.dart:669 — _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 · SearchPage.build (cognitive 18) · ×1
  • SearchPage.build (cognitive 18) mobile/lib/features/search/search_page.dart:88 — SearchPage.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 4, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HpkeBackup.associatedData (cognitive 18) · ×1
  • HpkeBackup.associatedData (cognitive 18) mobile/lib/shared/hosted/hpke_backup.dart:83 — HpkeBackup.associatedData has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (7 pts), error handling 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VerifiedProfilesNotifier._refreshDiscovery (cognitive 18) · ×1
  • VerifiedProfilesNotifier._refreshDiscovery (cognitive 18) mobile/lib/shared/verified_profiles/verified_profile_directory.dart:239 — VerifiedProfilesNotifier._refreshDiscovery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 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 · VerifiedProfilesNotifier._onEose (cognitive 18) · ×1
  • VerifiedProfilesNotifier._onEose (cognitive 18) mobile/lib/shared/verified_profiles/verified_profile_directory.dart:465 — VerifiedProfilesNotifier._onEose has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus (cognitive 18) · ×1
  • personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus (cognitive 18) desktop/src/features/agents/ui/personaModelDiscoveryStatus.ts:44 — personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · useObserverEvents.useLoadArchivedObserverEvents (cognitive 18) · ×1
  • useObserverEvents.useLoadArchivedObserverEvents (cognitive 18) desktop/src/features/agents/ui/useObserverEvents.ts:115 — useObserverEvents.useLoadArchivedObserverEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, error handling 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 210, 159, 165, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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). None of this is in the body itself: all 18 points belong to 4 function literals inside it that branch (lines 215, 252, 194, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · submitMessageEdit.submitMessageEdit (cognitive 18) · ×1
  • submitMessageEdit.submitMessageEdit (cognitive 18) desktop/src/features/messages/ui/submitMessageEdit.ts:70 — submitMessageEdit.submitMessageEdit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 189, a function literal at line 148, finishEdit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 · desktop.getDesktopNotificationPermissionState (cognitive 18) · ×1
  • desktop.getDesktopNotificationPermissionState (cognitive 18) desktop/src/features/notifications/lib/desktop.ts:134 — desktop.getDesktopNotificationPermissionState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · 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 items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · BeeField.BeeField (cognitive 18) · ×1
  • BeeField.BeeField (cognitive 18) web/src/features/invite/ui/BeeField.tsx:66 — BeeField.BeeField has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 6, boolean chains 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 163, 120, 174, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · 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 · RelayActionSink · ×1
  • RelayActionSink::send_message (cognitive 17) crates/buzz-relay/src/workflow_sink.rs:211 — RelayActionSink::send_message has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 3, boolean chains 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 · buzz_relay_mesh · ×1
  • buzz_relay_mesh::runtime::control_stream_exchange (cognitive 17) crates/buzz-relay-mesh/src/runtime.rs:616 — 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 · IdentityFilePlugin.onMethodCall (cognitive 17) · ×1
  • IdentityFilePlugin.onMethodCall (cognitive 17) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/IdentityFilePlugin.kt:24 — IdentityFilePlugin.onMethodCall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AppDelegate.generateVideoPoster (cognitive 17) · ×1
  • AppDelegate.generateVideoPoster (cognitive 17) mobile/ios/Runner/AppDelegate.swift:1119 — 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:113 — 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 · AgentModelPicker.build (cognitive 17) · ×1
  • AgentModelPicker.build (cognitive 17) mobile/lib/features/agents/agent_model_picker.dart:27 — AgentModelPicker.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 5 (6 pts), if/else 2, 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 · ChannelSectionStore.fromJson (cognitive 17) · ×1
  • ChannelSectionStore.fromJson (cognitive 17) mobile/lib/features/channels/channel_sections/channel_sections_storage.dart:61 — ChannelSectionStore.fromJson has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelTypingNotifier._subscribeLive (cognitive 17) · ×1
  • ChannelTypingNotifier._subscribeLive (cognitive 17) mobile/lib/features/channels/channel_typing_provider.dart:149 — ChannelTypingNotifier._subscribeLive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChannelsBody.build (cognitive 17) · ×1
  • _ChannelsBody.build (cognitive 17) mobile/lib/features/channels/channels_page/body.dart:38 — _ChannelsBody.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 4, ternaries 4, 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 · _MarkdownEditingController.expandChipDeletion (cognitive 17) · ×1
  • _MarkdownEditingController.expandChipDeletion (cognitive 17) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:411 — _MarkdownEditingController.expandChipDeletion has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _MemberTile.build (cognitive 17) · ×1
  • _MemberTile.build (cognitive 17) mobile/lib/features/channels/members_sheet.dart:227 — _MemberTile.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _QuickReactionRow.build (cognitive 17) · ×1
  • _QuickReactionRow.build (cognitive 17) mobile/lib/features/channels/message_actions/quick_reaction_row.dart:28 — _QuickReactionRow.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomEmojiPaletteNotifier._fetch (cognitive 17) · ×1
  • CustomEmojiPaletteNotifier._fetch (cognitive 17) mobile/lib/shared/custom_emoji/custom_emoji_provider.dart:41 — CustomEmojiPaletteNotifier._fetch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 1 (3 pts), ternaries 1 (2 pts), boolean chains 1, 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 · BrowserAuth._peerOwns (cognitive 17) · ×1
  • BrowserAuth._peerOwns (cognitive 17) mobile/lib/shared/hosted/browser_auth.dart:290 — BrowserAuth._peerOwns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HpkeBackup.seal (cognitive 17) · ×1
  • HpkeBackup.seal (cognitive 17) mobile/lib/shared/hosted/hpke_backup.dart:24 — HpkeBackup.seal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 5, error handling 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkeletonReveal.build (cognitive 17) · ×1
  • SkeletonReveal.build (cognitive 17) mobile/lib/shared/widgets/skeleton_reveal.dart:36 — SkeletonReveal.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 4 (5 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · usePersonaModelDiscovery.getDiscoveredPersonaModelOptions (cognitive 17) · ×1
  • usePersonaModelDiscovery.getDiscoveredPersonaModelOptions (cognitive 17) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:53 — usePersonaModelDiscovery.getDiscoveredPersonaModelOptions has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 6, if/else 2 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · usePersonaActions.usePersonaActions.handleSetActive (cognitive 17) · ×1
  • usePersonaActions.usePersonaActions.handleSetActive (cognitive 17) desktop/src/features/agents/ui/usePersonaActions.ts:298 — usePersonaActions.usePersonaActions.handleSetActive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useChannelUnreadState.useChannelUnreadState (cognitive 17) · ×1
  • useChannelUnreadState.useChannelUnreadState (cognitive 17) desktop/src/features/channels/ui/useChannelUnreadState.ts:62 — useChannelUnreadState.useChannelUnreadState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 4, loops 2 (3 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 275, 286, 123, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useMembersSidebarActions.useMembersSidebarActions.handleLifecycleAction (cognitive 17) · ×1
  • useMembersSidebarActions.useMembersSidebarActions.handleLifecycleAction (cognitive 17) desktop/src/features/channels/ui/useMembersSidebarActions.ts:162 — useMembersSidebarActions.useMembersSidebarActions.handleLifecycleAction has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (6 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useHomeInboxReadState.useHomeInboxReadState.markItemRead (cognitive 17) · ×1
  • useHomeInboxReadState.useHomeInboxReadState.markItemRead (cognitive 17) desktop/src/features/home/useHomeInboxReadState.ts:211 — useHomeInboxReadState.useHomeInboxReadState.markItemRead has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · useAgentAddressLockPicker.useAgentAddressLockPicker.toggleAlwaysAddressAgent (cognitive 17) · ×1
  • useAgentAddressLockPicker.useAgentAddressLockPicker.toggleAlwaysAddressAgent (cognitive 17) desktop/src/features/messages/ui/useAgentAddressLockPicker.ts:194 — useAgentAddressLockPicker.useAgentAddressLockPicker.toggleAlwaysAddressAgent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · useAnchoredScroll.useAnchoredScroll.onScroll (cognitive 17) · ×1
  • useAnchoredScroll.useAnchoredScroll.onScroll (cognitive 17) desktop/src/features/messages/ui/useAnchoredScroll.ts:649 — useAnchoredScroll.useAnchoredScroll.onScroll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hooks.useFirstRunOnboardingGate (cognitive 17) · ×1
  • hooks.useFirstRunOnboardingGate (cognitive 17) desktop/src/features/onboarding/hooks.ts:282 — hooks.useFirstRunOnboardingGate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 324, 391, 310, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · 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, 10 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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 · 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). None of this is in the body itself: all 17 points belong to 3 function items inside it that branch (a function literal at line 293, a function literal at line 319, drain). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 items inside it that branch (handlePointerMove, a function literal at line 83, handlePointerDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ObserverPublishQueue · ×1
  • ObserverPublishQueue::next_frame (cognitive 16) crates/buzz-acp/src/lib.rs:1300 — 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 · NostrWsConnection · ×1
  • NostrWsConnection::wait_for_auth_challenge (cognitive 16) crates/buzz-ws-client/src/connection.rs:263 — 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:351 — 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 · ConcentricSheetSurfacePlatformView.applyCornerConfiguration (cognitive 16) · ×1
  • ConcentricSheetSurfacePlatformView.applyCornerConfiguration (cognitive 16) mobile/ios/Runner/ConcentricSheetSurface.swift:178 — ConcentricSheetSurfacePlatformView.applyCornerConfiguration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (8 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 · PickerFilePreparation.prepare (cognitive 16) · ×1
  • PickerFilePreparation.prepare (cognitive 16) mobile/ios/Runner/InlinePhotoPicker.swift:241 — PickerFilePreparation.prepare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (2 pts), error handling 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeCommunityEntryController.render (cognitive 16) · ×1
  • NativeCommunityEntryController.render (cognitive 16) mobile/ios/Runner/NativeCommunityEntry.swift:203 — NativeCommunityEntryController.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (5 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App.build (cognitive 16) · ×1
  • App.build (cognitive 16) mobile/lib/app.dart:351 — App.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3, match/switch 2, 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.
D2 · Cognitive Complexity · ActivityNotifier._drainRefreshQueue (cognitive 16) · ×1
  • ActivityNotifier._drainRefreshQueue (cognitive 16) mobile/lib/features/activity/activity_provider.dart:401 — 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 · _MembershipSystemMessageContent.build (cognitive 16) · ×1
  • _MembershipSystemMessageContent.build (cognitive 16) mobile/lib/features/channels/channel_detail_page/system_rows.dart:469 — _MembershipSystemMessageContent.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (6 pts), boolean chains 1, 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 · ChannelMutesManager._applyEvents (cognitive 16) · ×1
  • ChannelMutesManager._applyEvents (cognitive 16) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:284 — ChannelMutesManager._applyEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelStarsManager._applyEvents (cognitive 16) · ×1
  • ChannelStarsManager._applyEvents (cognitive 16) mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:284 — ChannelStarsManager._applyEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelTypingNotifier._handleTypingEvent (cognitive 16) · ×1
  • ChannelTypingNotifier._handleTypingEvent (cognitive 16) mobile/lib/features/channels/channel_typing_provider.dart:216 — ChannelTypingNotifier._handleTypingEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelsNotifier.retryDirectory (cognitive 16) · ×1
  • ChannelsNotifier.retryDirectory (cognitive 16) mobile/lib/features/channels/channels_provider.dart:1071 — ChannelsNotifier.retryDirectory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, error handling 3, ternaries 1 (2 pts) (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 · _MarkdownEditingController._renderedLinkRanges (cognitive 16) · ×1
  • _MarkdownEditingController._renderedLinkRanges (cognitive 16) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:143 — _MarkdownEditingController._renderedLinkRanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 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 · _MarkdownEditingController._styledCodeRanges (cognitive 16) · ×1
  • _MarkdownEditingController._styledCodeRanges (cognitive 16) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:365 — _MarkdownEditingController._styledCodeRanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 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 · _MarkdownEditingController._buildComposerTokenSpans (cognitive 16) · ×1
  • _MarkdownEditingController._buildComposerTokenSpans (cognitive 16) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:755 — _MarkdownEditingController._buildComposerTokenSpans has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypingAvatarCluster.build (cognitive 16) · ×1
  • TypingAvatarCluster.build (cognitive 16) mobile/lib/features/channels/typing_avatar_cluster.dart:14 — TypingAvatarCluster.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), match/switch 2, boolean chains 1, if/else 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · ReadStateManager._hydrateFromLocalStorage (cognitive 16) · ×1
  • ReadStateManager._hydrateFromLocalStorage (cognitive 16) mobile/lib/shared/read_state/read_state_manager.dart:811 — ReadStateManager._hydrateFromLocalStorage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelaySessionNotifier._connect (cognitive 16) · ×1
  • RelaySessionNotifier._connect (cognitive 16) mobile/lib/shared/relay/relay_session.dart:583 — RelaySessionNotifier._connect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CreateMenuRoute.buildPage (cognitive 16) · ×1
  • _CreateMenuRoute.buildPage (cognitive 16) mobile/lib/shared/widgets/android_expanding_menu_button.dart:167 — _CreateMenuRoute.buildPage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 2 (4 pts), 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.
D2 · Cognitive Complexity · _CarouselImages._sendFrames (cognitive 16) · ×1
  • _CarouselImages._sendFrames (cognitive 16) mobile/lib/shared/widgets/ios_media_carousel.dart:216 — _CarouselImages._sendFrames has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminConsolePanelHelpers.parseImetaAttachments (cognitive 16) · ×1
  • AdminConsolePanelHelpers.parseImetaAttachments (cognitive 16) desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:310 — AdminConsolePanelHelpers.parseImetaAttachments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:547 — observerRelayStore.handleRelayObserverEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · ModelPicker.ModelPicker · ×1
  • ModelPicker.ModelPicker::handleModelChange (cognitive 16) desktop/src/features/agents/ui/ModelPicker.tsx:175 — ModelPicker.ModelPicker::handleModelChange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ModelPicker.ModelPicker) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · useCommunities.resolveCommunityUpdateResult (cognitive 16) · ×1
  • useCommunities.resolveCommunityUpdateResult (cognitive 16) desktop/src/features/communities/useCommunities.tsx:43 — useCommunities.resolveCommunityUpdateResult has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
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 · useForumMentionPreparation.useForumMentionPreparation.invite (cognitive 16) · ×1
  • useForumMentionPreparation.useForumMentionPreparation.invite (cognitive 16) desktop/src/features/forum/ui/useForumMentionPreparation.ts:121 — useForumMentionPreparation.useForumMentionPreparation.invite has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · TimelineMessageList.TimelineMessageList (cognitive 16) · ×1
  • TimelineMessageList.TimelineMessageList (cognitive 16) desktop/src/features/messages/ui/TimelineMessageList.tsx:127 — TimelineMessageList.TimelineMessageList has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 2, if/else 1, match/switch 1 (nesting depth added 5). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 218, 348). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · useSearchResults.useSearchResults.userResults (cognitive 16) · ×1
  • useSearchResults.useSearchResults.userResults (cognitive 16) desktop/src/features/search/useSearchResults.ts:331 — useSearchResults.useSearchResults.userResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, loops 4, ternaries 1 (nesting depth added 1). Of this number, 8 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 278). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
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, 188, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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). None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 89, 106, 127, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 · RelayClient.resetConnection (cognitive 16) · ×1
  • RelayClient.resetConnection (cognitive 16) desktop/src/shared/api/relayClientSession.ts:1120 — RelayClient.resetConnection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 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.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). None of this is in the body itself: all 16 points belong to 7 function literals inside it that branch (lines 576, 567, 671, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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 items inside it that branch (ensureScene, start, draw, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 46 shared lines) · ×1
  • Near-duplicate member family (3 members, 46 shared lines) crates/buzz-relay/src/api/bridge.rs:1242 — crates/buzz-relay/src/api/bridge.rs:1242-1303 | crates/buzz-relay/src/api/bridge.rs:1595-1671 | crates/buzz-relay/src/api/bridge.rs:2306-2369 — These 3 members are variants of one another: a block of 46 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 (168 shared lines) · ×1
  • Near-duplicate member pair (168 shared lines) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40-501 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:41-464 — These two members are variants of one another: 168 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 (79 shared lines) · ×1
  • Near-duplicate member pair (79 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: 79 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:1878 — crates/buzz-agent/src/llm.rs:1878-2074 | crates/buzz-agent/src/llm.rs:2271-2504 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) crates/buzz-acp/src/relay.rs:3920 — crates/buzz-acp/src/relay.rs:3920-4009 | 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 (34 shared lines) · ×1
  • Near-duplicate member pair (34 shared lines) crates/buzz-acp/src/filter.rs:264 — crates/buzz-acp/src/filter.rs:264-334 | crates/buzz-workflow/src/executor.rs:235-331 — These two members are variants of one another: 34 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 (30 shared lines) · ×1
  • Near-duplicate member pair (30 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: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) crates/buzz-db/src/store/event.rs:2474 — crates/buzz-db/src/store/event.rs:2474-2527 | crates/buzz-db/src/store/event.rs:2542-2592 | crates/buzz-db/src/store/event.rs:2614-2649 | crates/buzz-db/src/store/feed.rs:361-419 | crates/buzz-db/src/store/feed.rs:454-514 | crates/buzz-db/src/store/feed.rs:540-595 | crates/buzz-db/src/store/relay_members.rs:1261-1292 | crates/buzz-db/src/store/relay_members.rs:1330-1361 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/buzz-relay/src/handlers/command_executor.rs:321 — crates/buzz-relay/src/handlers/command_executor.rs:321-450 | crates/buzz-relay/src/handlers/command_executor.rs:457-588 | crates/buzz-relay/src/handlers/command_executor.rs:595-661 | crates/buzz-relay/src/handlers/command_executor.rs:668-850 | crates/buzz-relay/src/handlers/command_executor.rs:1064-1169 | crates/buzz-relay/src/handlers/command_executor.rs:1176-1309 — 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 · Edited copy of a member (128 corresponding lines) · ×1
  • Edited copy of a member (128 corresponding lines) desktop/src-tauri/src/commands/agent_discovery.rs:502 — desktop/src-tauri/src/commands/agent_discovery.rs:502-636 | desktop/src-tauri/src/commands/global_agent_config.rs:253-380 — These two members are one piece of code written twice and then edited apart: 128 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 (105 corresponding lines) · ×1
  • Edited copy of a member (105 corresponding lines) mobile/lib/features/forum/forum_thread_page.dart:345 — mobile/lib/features/forum/forum_thread_page.dart:345-449 | mobile/lib/features/forum/forum_thread_page.dart:465-588 — These two members are one piece of code written twice and then edited apart: 105 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 (71 corresponding lines) · ×1
  • Edited copy of a member (71 corresponding lines) mobile/lib/features/profile/profile_edit_page.dart:669 — mobile/lib/features/profile/profile_edit_page.dart:669-739 | mobile/lib/shared/widgets/text_editor.dart:95-168 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 53+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 53+ corresponding lines) crates/buzz-cli/src/commands/issues.rs:534 — crates/buzz-cli/src/commands/issues.rs:534-590 | crates/buzz-cli/src/commands/patches.rs:129-191 | crates/buzz-cli/src/commands/pr.rs:172-224 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 53 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) crates/buzz-acp/src/relay.rs:4266 — crates/buzz-acp/src/relay.rs:4266-4311 | crates/buzz-acp/src/relay.rs:4325-4389 — These two members are one piece of code written twice and then edited apart: 46 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 (68 corresponding lines) · ×1
  • Edited copy of a member (68 corresponding lines) crates/buzz-relay/src/audio/join.rs:567 — crates/buzz-relay/src/audio/join.rs:567-634 | crates/buzz-relay/src/tunnel/reliable.rs:588-660 — These two members are one piece of code written twice and then edited apart: 68 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 (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) REDACTED:2862 — REDACTED:2862-2934 | REDACTED:2942-3001 — These two members are one piece of code written twice and then edited apart: 60 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 (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) desktop/src-tauri/src/commands/project_git.rs:263 — desktop/src-tauri/src/commands/project_git.rs:263-326 | desktop/src-tauri/src/commands/project_git.rs:333-401 — These two members are one piece of code written twice and then edited apart: 64 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 (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) crates/buzz-relay/src/handlers/moderation_commands.rs:176 — crates/buzz-relay/src/handlers/moderation_commands.rs:176-258 | crates/buzz-relay/src/handlers/moderation_commands.rs:304-365 — These two members are one piece of code written twice and then edited apart: 62 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 (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:47 — desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:47-89 | desktop/src-tauri/src/managed_agents/runtime/process.rs:150-191 — These two members are one piece of code written twice and then edited apart: 42 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) desktop/src-tauri/src/archive/store.rs:336 — desktop/src-tauri/src/archive/store.rs:336-392 | desktop/src-tauri/src/archive/store.rs:414-479 — These two members are one piece of code written twice and then edited apart: 57 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 (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) 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/sweep.rs:324-379 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) crates/git-sign-nostr/src/lib.rs:661 — crates/git-sign-nostr/src/lib.rs:661-707 | crates/git-sign-nostr/src/lib.rs:715-767 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 82+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 82+ corresponding lines) crates/buzz-db/src/store/relay_admin_actions.rs:469 — crates/buzz-db/src/store/relay_admin_actions.rs:469-555 | crates/buzz-db/src/store/relay_admin_actions.rs:569-650 | crates/buzz-db/src/store/relay_admin_actions.rs:678-764 | crates/buzz-db/src/store/relay_admin_actions.rs:779-867 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 82 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) crates/buzz-db/src/store/community.rs:830 — crates/buzz-db/src/store/community.rs:830-877 | crates/buzz-db/src/store/community.rs:889-943 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 52+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 52+ corresponding lines) desktop/src-tauri/src/commands/media_transcode.rs:198 — desktop/src-tauri/src/commands/media_transcode.rs:198-272 | desktop/src-tauri/src/commands/media_transcode.rs:282-357 | desktop/src-tauri/src/commands/media_transcode.rs:372-423 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 52 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 49+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 49+ corresponding lines) mobile/lib/features/forum/forum_post_card.dart:258 — mobile/lib/features/forum/forum_post_card.dart:258-307 | mobile/lib/features/forum/forum_thread_page.dart:129-177 | mobile/lib/features/forum/forum_thread_page.dart:590-639 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 49 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 43+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 43+ corresponding lines) 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 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) desktop/src-tauri/src/commands/channel_templates.rs:64 — desktop/src-tauri/src/commands/channel_templates.rs:64-101 | desktop/src-tauri/src/commands/channel_templates.rs:107-142 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 48+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 48+ corresponding lines) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:232 — 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 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 48 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 45+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 45+ corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:340 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:340-384 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:465-519 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:340-384 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 38+ corresponding lines) desktop/src-tauri/src/commands/agent_settings.rs:25 — desktop/src-tauri/src/commands/agent_settings.rs:25-62 | desktop/src-tauri/src/commands/agent_settings.rs:69-106 | desktop/src-tauri/src/commands/agents.rs:343-389 | desktop/src-tauri/src/commands/agents.rs:1074-1119 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) crates/buzz-pubsub/src/cache_invalidation.rs:140 — crates/buzz-pubsub/src/cache_invalidation.rs:140-185 | crates/buzz-pubsub/src/conn_control.rs:189-232 | crates/buzz-pubsub/src/conn_control.rs:270-302 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 44+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 44+ corresponding lines) crates/buzz-db/src/store/moderation.rs:435 — crates/buzz-db/src/store/moderation.rs:435-480 | crates/buzz-db/src/store/moderation.rs:492-535 | crates/buzz-db/src/store/relay_admin_actions.rs:145-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) crates/buzz-cli/src/commands/channels.rs:367 — crates/buzz-cli/src/commands/channels.rs:367-386 | crates/buzz-cli/src/commands/workflows.rs:13-35 | crates/buzz-cli/src/commands/workflows.rs:38-58 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) mobile/lib/features/activity/activity_page/status_views.dart:78 — mobile/lib/features/activity/activity_page/status_views.dart:78-108 | mobile/lib/features/channels/compose_bar/photo_gallery_picker.dart:397-426 | mobile/lib/features/forum/forum_posts_view.dart:216-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) crates/buzz-db/src/store/relay_admin_actions.rs:1535 — crates/buzz-db/src/store/relay_admin_actions.rs:1535-1599 | crates/buzz-db/src/store/relay_admin_actions.rs:1629-1689 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) crates/buzz-db/src/store/relay_members.rs:78 — crates/buzz-db/src/store/relay_members.rs:78-101 | crates/buzz-db/src/store/relay_members.rs:117-139 | crates/buzz-db/src/store/relay_operators.rs:247-272 | crates/buzz-db/src/store/relay_operators.rs:275-300 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) mobile/lib/shared/huddle/huddle_media.dart:435 — mobile/lib/shared/huddle/huddle_media.dart:435-468 | mobile/lib/shared/huddle/huddle_media.dart:470-496 | mobile/lib/shared/huddle/huddle_media.dart:498-527 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) mobile/lib/features/activity/activity_page/status_views.dart:150 — mobile/lib/features/activity/activity_page/status_views.dart:150-177 | mobile/lib/features/channels/channel_detail_page/empty_messages.dart:6-34 | mobile/lib/shared/widgets/load_error_view.dart:18-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 11+ corresponding lines) desktop/src-tauri/src/commands/admin/mod.rs:491 — desktop/src-tauri/src/commands/admin/mod.rs:491-501 | desktop/src-tauri/src/commands/admin/mod.rs:524-534 | desktop/src-tauri/src/commands/admin/mod.rs:547-559 | desktop/src-tauri/src/commands/admin/mod.rs:574-586 | desktop/src-tauri/src/commands/admin/mod.rs:601-613 | desktop/src-tauri/src/commands/admin/mod.rs:624-636 | desktop/src-tauri/src/commands/admin/mod.rs:688-698 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) crates/buzz-db/src/store/community.rs:301 — crates/buzz-db/src/store/community.rs:301-318 | crates/buzz-db/src/store/community.rs:323-352 | crates/buzz-db/src/store/nip_fi_binding.rs:160-194 | crates/buzz-db/src/store/nip_fi_binding.rs:206-240 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 20+ corresponding lines) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:515 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:515-539 | mobile/lib/features/channels/thread_detail_page/avatar.dart:14-33 | mobile/lib/features/forum/forum_post_card.dart:347-366 | mobile/lib/features/forum/forum_thread_page.dart:687-707 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 4+ corresponding lines) mobile/ios/Runner/IosNavigationBar.swift:1178 — mobile/ios/Runner/IosNavigationBar.swift:1178-1183 | mobile/ios/Runner/NativeAddMembersSheet.swift:467-472 | mobile/ios/Runner/NativeCreateChannelSheet.swift:276-280 | mobile/ios/Runner/NativePresenceMenu.swift:74-78 | mobile/ios/Runner/NativeProfileSetup.swift:689-692 | mobile/ios/Runner/NativeStatusEditor.swift:112-119 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) crates/buzz-db/src/store/api_token.rs:330 — crates/buzz-db/src/store/api_token.rs:330-353 | crates/buzz-db/src/store/event.rs:2955-2975 | crates/buzz-db/src/store/git_repo.rs:187-205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 20+ corresponding lines) crates/buzz-db/src/store/push.rs:1067 — crates/buzz-db/src/store/push.rs:1067-1089 | crates/buzz-db/src/store/push.rs:1099-1123 | crates/buzz-db/src/store/push.rs:1134-1194 | crates/buzz-db/src/store/push.rs:1257-1276 | crates/buzz-db/src/store/push.rs:1285-1305 | crates/buzz-db/src/store/push.rs:1313-1332 | crates/buzz-db/src/store/push.rs:1344-1364 | crates/buzz-db/src/store/push.rs:1375-1398 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) crates/buzz-db/src/store/allowlist.rs:72 — crates/buzz-db/src/store/allowlist.rs:72-91 | crates/buzz-db/src/store/allowlist.rs:99-114 | crates/buzz-db/src/store/api_token.rs:531-547 | crates/buzz-db/src/store/media.rs:118-129 | crates/buzz-db/src/store/media.rs:137-148 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) crates/buzz-db/src/store/channel.rs:1436 — crates/buzz-db/src/store/channel.rs:1436-1448 | crates/buzz-db/src/store/channel.rs:1476-1488 | crates/buzz-db/src/store/channel.rs:1521-1533 | crates/buzz-db/src/store/channel.rs:1543-1555 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 16+ corresponding lines) crates/buzz-db/src/store/event.rs:1700 — crates/buzz-db/src/store/event.rs:1700-1720 | crates/buzz-db/src/store/event.rs:1787-1802 | crates/buzz-db/src/store/event.rs:1815-1838 | crates/buzz-db/src/store/event.rs:1864-1879 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 5+ corresponding lines) desktop/src-tauri/src/managed_agents/agent_events.rs:154 — desktop/src-tauri/src/managed_agents/agent_events.rs:154-158 | desktop/src-tauri/src/managed_agents/persona_events.rs:225-229 | desktop/src-tauri/src/managed_agents/team_catalog.rs:776-780 | desktop/src-tauri/src/managed_agents/team_events.rs:96-100 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) crates/buzz-db/src/store/moderation.rs:743 — crates/buzz-db/src/store/moderation.rs:743-773 | crates/buzz-db/src/store/workflow.rs:461-483 | crates/buzz-db/src/store/workflow.rs:987-1014 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) crates/buzz-media/src/storage.rs:294 — crates/buzz-media/src/storage.rs:294-300 | crates/buzz-media/src/storage.rs:307-313 | crates/buzz-media/src/storage.rs:338-344 | crates/buzz-media/src/storage.rs:356-364 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 9+ corresponding lines) desktop/src-tauri/src/commands/agents_pending.rs:60 — desktop/src-tauri/src/commands/agents_pending.rs:60-68 | desktop/src-tauri/src/commands/personas/pending.rs:233-241 | desktop/src-tauri/src/commands/teams/mod.rs:268-276 | desktop/src-tauri/src/commands/teams/mod.rs:333-341 | desktop/src-tauri/src/commands/teams/pending.rs:204-212 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:181 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:181-191 | mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:193-203 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:181-191 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:193-203 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) desktop/src-tauri/src/event_sync.rs:82 — desktop/src-tauri/src/event_sync.rs:82-100 | desktop/src-tauri/src/event_sync.rs:354-372 | desktop/src-tauri/src/event_sync.rs:660-674 | desktop/src-tauri/src/managed_agents/reconcile.rs:39-55 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) crates/buzz-sdk/src/builders.rs:514 — crates/buzz-sdk/src/builders.rs:514-520 | crates/buzz-sdk/src/builders.rs:862-869 | desktop/src-tauri/src/events.rs:239-246 | desktop/src-tauri/src/events.rs:389-395 | desktop/src-tauri/src/events.rs:569-577 | desktop/src-tauri/src/events.rs:590-598 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/buzz-cli/src/commands/projects.rs:84 — crates/buzz-cli/src/commands/projects.rs:84-89 | crates/buzz-cli/src/links.rs:114-122 | crates/buzz-relay/src/handlers/side_effects.rs:3893-3901 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) mobile/lib/features/channels/channel_mutes/channel_mutes_storage.dart:36 — mobile/lib/features/channels/channel_mutes/channel_mutes_storage.dart:36-39 | mobile/lib/features/channels/channel_sort/channel_sort_storage.dart:41-46 | mobile/lib/features/channels/channel_stars/channel_stars_storage.dart:36-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 3+ corresponding lines) crates/buzz-cli/src/client.rs:249 — crates/buzz-cli/src/client.rs:249-253 | crates/buzz-pair-relay/src/lib.rs:296-298 | crates/buzz-relay/src/api/admin/mod.rs:1459-1464 | crates/buzz-relay/src/api/git/manifest.rs:189-191 | REDACTED:840-842 | desktop/src-tauri/src/link_preview_tags.rs:16-18 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
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 — before extracting anything, compare `crates/buzz-dev-mcp/src/shell.rs` and `desktop/src-tauri/src/managed_agents/git_bash.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (60–61 lines × 2) · ×1
  • Duplicated block (60–61 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:1065 — crates/buzz-relay/src/handlers/command_executor.rs:1065-1125 | crates/buzz-relay/src/handlers/command_executor.rs:1177-1236 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/command_executor.rs:1065` 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 (58–60 lines × 2) · ×1
  • Duplicated block (58–60 lines × 2) crates/buzz-db/src/store/event.rs:484 — crates/buzz-db/src/store/event.rs:484-541 | crates/buzz-db/src/store/event.rs:1975-2034 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/event.rs:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (45–47 lines × 2) · ×1
  • Duplicated block (45–47 lines × 2) REDACTED:941 — REDACTED:941-987 | REDACTED:1269-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:941` 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 (39–46 lines × 2) · ×1
  • Duplicated block (39–46 lines × 2) crates/buzz-db/src/store/event.rs:801 — crates/buzz-db/src/store/event.rs:801-846 | crates/buzz-db/src/store/event.rs:1614-1652 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/event.rs:801` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/event.rs:1612` calls `push_channel_scope` and `crates/buzz-db/src/store/event.rs:799` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (36–41 lines × 2) · ×1
  • Duplicated block (36–41 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:470 — crates/buzz-db/src/store/relay_admin_actions.rs:470-510 | crates/buzz-db/src/store/relay_admin_actions.rs:570-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/relay_admin_actions.rs:470` 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 (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:354 — crates/buzz-relay/src/handlers/command_executor.rs:354-393 | crates/buzz-relay/src/handlers/command_executor.rs:517-555 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/command_executor.rs:354` 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 (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) desktop/src-tauri/src/commands/agent_discovery.rs:520 — desktop/src-tauri/src/commands/agent_discovery.rs:520-558 | desktop/src-tauri/src/commands/global_agent_config.rs:266-304 — before extracting anything, compare `desktop/src-tauri/src/commands/agent_discovery.rs` and `desktop/src-tauri/src/commands/global_agent_config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) crates/buzz-relay/src/handlers/count.rs:267 — crates/buzz-relay/src/handlers/count.rs:267-303 | crates/buzz-relay/src/handlers/count.rs:356-393 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/handlers/count.rs:267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) crates/buzz-relay/src/api/bridge.rs:2562 — crates/buzz-relay/src/api/bridge.rs:2562-2594 | crates/buzz-relay/src/api/bridge.rs:2635-2668 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/bridge.rs:2562` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media_animated.rs:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
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–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:521 — crates/buzz-db/src/store/relay_admin_actions.rs:521-551 | crates/buzz-db/src/store/relay_admin_actions.rs:618-646 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/relay_admin_actions.rs:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/relay_admin_actions.rs:617` calls `bind` and `crates/buzz-db/src/store/relay_admin_actions.rs:520` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (28–31 lines × 2) · ×1
  • Duplicated block (28–31 lines × 2) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:268 — desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:268-298 | desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:329-356 — both copies are in the same file, so extract the 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 `desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:268` 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 (29–30 lines × 3) · ×1
  • Duplicated block (29–30 lines × 3) crates/buzz-acp/src/relay.rs:2147 — crates/buzz-acp/src/relay.rs:2147-2176 | crates/buzz-acp/src/relay.rs:2186-2214 | crates/buzz-acp/src/relay.rs:2219-2247 — 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 `crates/buzz-acp/src/relay.rs:2147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (43–45 lines × 2) · ×1
  • Duplicated block (43–45 lines × 2) crates/buzz-db/src/store/event.rs:2483 — crates/buzz-db/src/store/event.rs:2483-2527 | crates/buzz-db/src/store/event.rs:2550-2592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/event.rs:2483` 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 (26–29 lines × 3) · ×1
  • Duplicated block (26–29 lines × 3) crates/buzz-db/src/store/relay_admin_actions.rs:480 — crates/buzz-db/src/store/relay_admin_actions.rs:480-508 | crates/buzz-db/src/store/relay_admin_actions.rs:578-603 | crates/buzz-db/src/store/relay_admin_actions.rs:784-812 — 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 `crates/buzz-db/src/store/relay_admin_actions.rs:784` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/relay_admin_actions.rs:476` calls `lock_admission`, `conn`, `query_scalar` and `crates/buzz-db/src/store/relay_admin_actions.rs:784` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) crates/buzz-voice/src/pocket_april.rs:562 — crates/buzz-voice/src/pocket_april.rs:562-603 | crates/buzz-voice/src/pocket_april.rs:872-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-voice/src/pocket_april.rs:562` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-voice/src/pocket_april.rs:604` calls `drop` and `crates/buzz-voice/src/pocket_april.rs:914` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
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 (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) crates/buzz-relay/src/audio/room.rs:346 — crates/buzz-relay/src/audio/room.rs:346-373 | crates/buzz-relay/src/audio/room.rs:412-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:530 — crates/buzz-db/src/store/relay_admin_actions.rs:530-555 | crates/buzz-db/src/store/relay_admin_actions.rs:627-650 | crates/buzz-db/src/store/relay_admin_actions.rs:844-867 — 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 `crates/buzz-db/src/store/relay_admin_actions.rs:530` 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 (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) crates/buzz-acp/src/acp.rs:1296 — crates/buzz-acp/src/acp.rs:1296-1321 | crates/buzz-acp/src/acp.rs:1620-1644 — both copies are in the same file, so extract the 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 lines × 2) · ×1
  • Duplicated block (26 lines × 2) crates/buzz-acp/src/acp.rs:1341 — crates/buzz-acp/src/acp.rs:1341-1366 | crates/buzz-acp/src/acp.rs:1789-1814 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/acp.rs:1341` 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 (30–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) crates/buzz-core/src/engram.rs:299 — crates/buzz-core/src/engram.rs:299-330 | crates/buzz-core/src/private_managed_agent.rs:737-766 — 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 (20–25 lines × 2) · ×1
  • Duplicated block (20–25 lines × 2) crates/buzz-relay/src/handlers/count.rs:102 — crates/buzz-relay/src/handlers/count.rs:102-126 | crates/buzz-relay/src/handlers/req.rs:173-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/count.rs:102` 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 (23–24 lines × 3) · ×1
  • Duplicated block (23–24 lines × 3) crates/buzz-db/src/store/feed.rs:372 — crates/buzz-db/src/store/feed.rs:372-395 | crates/buzz-db/src/store/feed.rs:466-489 | crates/buzz-db/src/store/feed.rs:551-573 — 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 `crates/buzz-db/src/store/feed.rs:372` 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 (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) crates/buzz-acp/src/config.rs:905 — crates/buzz-acp/src/config.rs:905-928 | desktop/src-tauri/src/managed_agents/discovery.rs:335-355 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) crates/buzz-relay/src/audio/handler.rs:145 — crates/buzz-relay/src/audio/handler.rs:145-168 | crates/buzz-relay/src/router.rs:981-1003 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/handler.rs:145` 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 (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) crates/buzz-admin/src/communities.rs:285 — crates/buzz-admin/src/communities.rs:285-305 | crates/buzz-relay/src/handlers/community_provisioning.rs:126-148 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-admin/src/communities.rs:285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-admin/src/communities.rs:283` calls `normalize_host` and `crates/buzz-relay/src/handlers/community_provisioning.rs:120` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19–23 lines × 2) · ×1
  • Duplicated block (19–23 lines × 2) crates/buzz-relay/src/audio/handler.rs:1693 — crates/buzz-relay/src/audio/handler.rs:1693-1711 | crates/buzz-relay/src/audio/handler.rs:1997-2019 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/audio/handler.rs:1693` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (18–23 lines × 2) · ×1
  • Duplicated block (18–23 lines × 2) crates/buzz-relay/src/audio/room.rs:532 — crates/buzz-relay/src/audio/room.rs:532-554 | crates/buzz-relay/src/audio/room.rs:592-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/room.rs:532` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) crates/buzz-acp/src/pool.rs:3474 — crates/buzz-acp/src/pool.rs:3474-3493 | crates/buzz-acp/src/pool.rs:3532-3553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-acp/src/pool.rs:3474` 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–22 lines × 2) · ×1
  • Duplicated block (14–22 lines × 2) desktop/src-tauri/src/commands/agents.rs:97 — desktop/src-tauri/src/commands/agents.rs:97-110 | desktop/src-tauri/src/commands/agents.rs:223-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agents.rs:97` 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 (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. 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 (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) crates/buzz-db/src/store/moderation.rs:396 — crates/buzz-db/src/store/moderation.rs:396-415 | crates/buzz-db/src/store/moderation.rs:436-456 — both copies are in the same file, so extract the 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 × 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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:145` 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) crates/buzz-relay/src/handlers/req.rs:332 — crates/buzz-relay/src/handlers/req.rs:332-351 | crates/buzz-relay/src/handlers/req.rs:441-458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/handlers/req.rs:332` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/handlers/req.rs:321` calls `filters_are_huddle_liveness_only`, `before_liveness_req`, `community` and `crates/buzz-relay/src/handlers/req.rs:434` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-media/src/upload.rs:92` 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) · ×1
  • Duplicated block (17–19 lines × 2) crates/buzz-pairing-cli/src/main.rs:142 — crates/buzz-pairing-cli/src/main.rs:142-158 | crates/buzz-pairing-cli/src/main.rs:244-262 — both copies are in the same file, so extract the 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 (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) REDACTED:917 — REDACTED:917-934 | REDACTED:1252-1266 — both copies are in the same file, so extract the 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 × 9) · ×1
  • Duplicated block (16–17 lines × 9) 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/agent_settings.rs:29-45 | desktop/src-tauri/src/commands/agent_settings.rs:73-89 | desktop/src-tauri/src/commands/agents.rs:348-364 | desktop/src-tauri/src/commands/agents.rs:440-456 | desktop/src-tauri/src/commands/agents.rs:511-527 | desktop/src-tauri/src/commands/agents.rs:935-951 | desktop/src-tauri/src/commands/agents.rs:1079-1095 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/agent_config.rs:263` 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 (15–17 lines × 4) · ×1
  • Duplicated block (15–17 lines × 4) crates/buzz-relay/src/handlers/artifact_sync.rs:424 — crates/buzz-relay/src/handlers/artifact_sync.rs:424-438 | crates/buzz-relay/src/handlers/req.rs:331-347 | crates/buzz-relay/src/handlers/req.rs:440-455 | crates/buzz-relay/src/handlers/req.rs:495-510 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-relay/src/handlers/req.rs:321` calls `filters_are_huddle_liveness_only`, `before_liveness_req`, `community` and `crates/buzz-relay/src/handlers/req.rs:434` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) crates/buzz-agent/src/llm.rs:2007 — crates/buzz-agent/src/llm.rs:2007-2023 | crates/buzz-agent/src/llm.rs:2445-2459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-agent/src/llm.rs:2007` 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 (31–33 lines × 2) · ×1
  • Duplicated block (31–33 lines × 2) crates/buzz-relay/src/api/bridge.rs:1262 — crates/buzz-relay/src/api/bridge.rs:1262-1294 | crates/buzz-relay/src/api/bridge.rs:2325-2355 — both copies are in the same file, so extract the 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–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) desktop/src-tauri/src/commands/personas/create.rs:25 — desktop/src-tauri/src/commands/personas/create.rs:25-41 | desktop/src-tauri/src/commands/personas/update.rs:307-318 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `CreatePersonaRequest` in one and `UpdatePersonaRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12–16 lines × 3) · ×1
  • Duplicated block (12–16 lines × 3) crates/buzz-relay/src/audio/handler.rs:1695 — crates/buzz-relay/src/audio/handler.rs:1695-1706 | crates/buzz-relay/src/audio/handler.rs:1999-2014 | crates/buzz-relay/src/audio/handler.rs:2027-2038 — 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 `crates/buzz-relay/src/audio/handler.rs:1695` 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–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) crates/buzz-acp/src/acp.rs:1451 — crates/buzz-acp/src/acp.rs:1451-1466 | crates/buzz-acp/src/acp.rs:1576-1587 — both copies are in the same file, so extract the 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 `crates/buzz-acp/src/acp.rs:1451` 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 (27–29 lines × 2) · ×1
  • Duplicated block (27–29 lines × 2) crates/buzz-acp/src/queue.rs:507 — crates/buzz-acp/src/queue.rs:507-535 | crates/buzz-acp/src/queue.rs:857-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.
D4 · Code Duplication · Duplicated block (12–15 lines × 6) · ×1
  • Duplicated block (12–15 lines × 6) crates/buzz-relay/src/audio/handler.rs:1693 — crates/buzz-relay/src/audio/handler.rs:1693-1704 | crates/buzz-relay/src/audio/handler.rs:1997-2011 | crates/buzz-relay/src/audio/handler.rs:2025-2036 | crates/buzz-relay/src/audio/handler.rs:2060-2071 | crates/buzz-relay/src/audio/handler.rs:2089-2100 | crates/buzz-relay/src/audio/handler.rs:2118-2129 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) crates/buzz-relay/src/audio/handler.rs:292 — crates/buzz-relay/src/audio/handler.rs:292-306 | crates/buzz-relay/src/connection.rs:408-418 — before extracting anything, compare `crates/buzz-relay/src/audio/handler.rs` and `crates/buzz-relay/src/connection.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/handler.rs:292` 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. 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.
D4 · Code Duplication · Duplicated block (10–14 lines × 7) · ×1
  • Duplicated block (10–14 lines × 7) crates/buzz-db/src/store/event.rs:2492 — crates/buzz-db/src/store/event.rs:2492-2505 | crates/buzz-db/src/store/event.rs:2559-2570 | crates/buzz-db/src/store/feed.rs:381-392 | crates/buzz-db/src/store/feed.rs:475-486 | crates/buzz-db/src/store/feed.rs:559-570 | crates/buzz-db/src/store/relay_members.rs:1274-1283 | crates/buzz-db/src/store/relay_members.rs:1343-1354 — there are 7 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/event.rs:2492` 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 (26–27 lines × 3) · ×1
  • Duplicated block (26–27 lines × 3) crates/buzz-relay/src/api/bridge.rs:1243 — crates/buzz-relay/src/api/bridge.rs:1243-1269 | crates/buzz-relay/src/api/bridge.rs:1596-1622 | crates/buzz-relay/src/api/bridge.rs:2307-2332 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-relay/src/api/bridge.rs:1628` calls `is_ok_and`, `requested` and `crates/buzz-relay/src/api/bridge.rs:1275` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×1
  • Duplicated block (10–14 lines × 2) crates/buzz-cli/src/commands/mem.rs:98 — crates/buzz-cli/src/commands/mem.rs:98-107 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/mem.rs:98` 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 (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) crates/buzz-relay/src/api/git/store.rs:289 — crates/buzz-relay/src/api/git/store.rs:289-302 | crates/buzz-relay/src/api/git/store.rs:328-339 — both copies are in the same file, so extract the 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 `crates/buzz-relay/src/api/git/store.rs:289` 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:308` 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 (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) crates/buzz-db/src/store/api_token.rs:185 — crates/buzz-db/src/store/api_token.rs:185-201 | crates/buzz-db/src/store/api_token.rs:247-261 | crates/buzz-db/src/store/api_token.rs:400-416 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/api_token.rs:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) crates/buzz-relay/src/handlers/ingest.rs:1633 — crates/buzz-relay/src/handlers/ingest.rs:1633-1643 | crates/buzz-relay/src/handlers/side_effects.rs:3650-3659 | crates/buzz-workflow/src/lib.rs:1085-1096 — 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 42 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 `crates/buzz-relay/src/handlers/ingest.rs:1633` 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. 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) crates/buzz-acp/src/relay.rs:1901 — crates/buzz-acp/src/relay.rs:1901-1921 | crates/buzz-acp/src/relay.rs:2161-2171 | crates/buzz-acp/src/relay.rs:2200-2210 | crates/buzz-acp/src/relay.rs:2233-2243 — 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 `crates/buzz-acp/src/relay.rs:1901` 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 (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) crates/buzz-db/src/store/moderation.rs:376 — crates/buzz-db/src/store/moderation.rs:376-384 | crates/buzz-db/src/store/moderation.rs:564-572 | crates/buzz-db/src/store/relay_admin_actions.rs:615-625 — before extracting anything, compare `crates/buzz-db/src/store/moderation.rs` and `crates/buzz-db/src/store/relay_admin_actions.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. 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 `crates/buzz-db/src/store/moderation.rs:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) crates/buzz-relay/src/audio/handler.rs:1214 — crates/buzz-relay/src/audio/handler.rs:1214-1222 | crates/buzz-relay/src/audio/handler.rs:1522-1532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-relay/src/audio/handler.rs:1214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-relay/src/audio/handler.rs:1533` calls `release_before_commit` and `crates/buzz-relay/src/audio/handler.rs:1223` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
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. Read the line range as the matched WINDOW rather than a finished unit: at `desktop/src-tauri/src/commands/media_transcode.rs:480` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) crates/buzz-relay/src/handlers/command_executor.rs:357 — crates/buzz-relay/src/handlers/command_executor.rs:357-366 | crates/buzz-relay/src/handlers/command_executor.rs:520-529 | crates/buzz-relay/src/handlers/command_executor.rs:626-635 | crates/buzz-relay/src/handlers/command_executor.rs:778-787 | crates/buzz-relay/src/handlers/command_executor.rs:1103-1112 | crates/buzz-relay/src/handlers/command_executor.rs:1214-1223 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-relay/src/handlers/command_executor.rs:800` calls `community` and `crates/buzz-relay/src/handlers/command_executor.rs:638` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) crates/buzz-relay/src/api/bridge.rs:2539 — crates/buzz-relay/src/api/bridge.rs:2539-2547 | crates/buzz-relay/src/api/bridge.rs:2611-2620 | crates/buzz-relay/src/handlers/count.rs:239-247 | crates/buzz-relay/src/handlers/count.rs:327-336 — 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 (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) crates/buzz-relay/src/audio/handler.rs:1573 — crates/buzz-relay/src/audio/handler.rs:1573-1581 | crates/buzz-relay/src/audio/handler.rs:1586-1594 | crates/buzz-relay/src/audio/handler.rs:1602-1611 — 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 `crates/buzz-relay/src/audio/handler.rs:1573` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (9 lines × 11) · ×1
  • Duplicated block (9 lines × 11) desktop/src-tauri/src/commands/agent_config.rs:262 — desktop/src-tauri/src/commands/agent_config.rs:262-270 | desktop/src-tauri/src/commands/agent_models.rs:42-50 | desktop/src-tauri/src/commands/agent_models_update.rs:153-161 | desktop/src-tauri/src/commands/agent_settings.rs:28-36 | desktop/src-tauri/src/commands/agent_settings.rs:72-80 | desktop/src-tauri/src/commands/agents.rs:347-355 | desktop/src-tauri/src/commands/agents.rs:439-447 | desktop/src-tauri/src/commands/agents.rs:510-518 | desktop/src-tauri/src/commands/agents.rs:934-942 | desktop/src-tauri/src/commands/agents.rs:1078-1086 | desktop/src-tauri/src/managed_agents/runtime_commands.rs:156-164 — there are 11 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 11 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) crates/buzz-db/src/store/event.rs:2489 — crates/buzz-db/src/store/event.rs:2489-2501 | crates/buzz-db/src/store/event.rs:2556-2568 | crates/buzz-db/src/store/event.rs:2625-2637 | crates/buzz-db/src/store/feed.rs:377-390 | crates/buzz-db/src/store/feed.rs:471-484 | crates/buzz-db/src/store/feed.rs:555-568 | crates/buzz-db/src/store/relay_members.rs:1273-1281 | crates/buzz-db/src/store/relay_members.rs:1342-1352 — there are 8 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/event.rs:2489` 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 (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:269-275 | 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/notes.rs:174` 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 (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) crates/buzz-relay/src/api/git/cas_publish.rs:615 — crates/buzz-relay/src/api/git/cas_publish.rs:615-623 | crates/buzz-relay/src/api/git/cas_publish.rs:691-698 | crates/buzz-relay/src/api/git/cas_publish.rs:799-807 — 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 `crates/buzz-relay/src/api/git/cas_publish.rs:615` 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 (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) crates/buzz-deletion/src/lib.rs:209 — crates/buzz-deletion/src/lib.rs:209-217 | crates/buzz-deletion/src/lib.rs:1121-1128 — both copies are in the same file, so extract the 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 `crates/buzz-deletion/src/lib.rs:209` 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) crates/buzz-cli/src/client.rs:1651 — crates/buzz-cli/src/client.rs:1651-1658 | crates/buzz-cli/src/client.rs:1672-1679 | crates/buzz-cli/src/commands/channels.rs:642-648 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/client.rs:1651` 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) crates/buzz-db/src/store/push.rs:746 — crates/buzz-db/src/store/push.rs:746-751 | crates/buzz-db/src/store/push.rs:769-775 — both copies are in the same file, so extract the 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 `crates/buzz-db/src/store/push.rs:746` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) crates/buzz-agent/src/llm.rs:2234 — crates/buzz-agent/src/llm.rs:2234-2238 | crates/buzz-agent/src/llm.rs:2393-2398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) crates/buzz-db/src/store/push.rs:1103 — crates/buzz-db/src/store/push.rs:1103-1117 | crates/buzz-db/src/store/push.rs:1136-1188 | crates/buzz-db/src/store/push.rs:1286-1300 | crates/buzz-db/src/store/push.rs:1345-1359 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/buzz-db/src/store/push.rs:1100` calls `is_empty`, `Ok` and `crates/buzz-db/src/store/push.rs:1285` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) crates/buzz-db/src/store/archived_identities.rs:67 — crates/buzz-db/src/store/archived_identities.rs:67-82 | crates/buzz-db/src/store/thread.rs:192-213 | crates/buzz-db/src/store/workflow.rs:382-406 | crates/buzz-db/src/store/workflow.rs:648-671 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/buzz-db/src/store/archived_identities.rs:83` calls `bind` and `crates/buzz-db/src/store/workflow.rs:672` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) crates/buzz-db/src/store/allowlist.rs:77 — crates/buzz-db/src/store/allowlist.rs:77-88 | crates/buzz-db/src/store/push.rs:1290-1302 | crates/buzz-db/src/store/push.rs:1349-1361 | crates/buzz-db/src/store/reminder.rs:171-188 | crates/buzz-db/src/store/workflow.rs:652-673 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/allowlist.rs:77` 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 (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) crates/buzz-db/src/store/git_repo.rs:189 — crates/buzz-db/src/store/git_repo.rs:189-202 | crates/buzz-db/src/store/moderation.rs:397-415 | crates/buzz-db/src/store/moderation.rs:437-456 | crates/buzz-db/src/store/moderation.rs:494-512 | crates/buzz-db/src/store/moderation.rs:585-602 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-db/src/store/git_repo.rs:189` 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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) crates/buzz-cli/src/commands/reactions.rs:80 — crates/buzz-cli/src/commands/reactions.rs:80-85 | 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.
D4 · Code Duplication · Duplicated block (5 lines × 19) · ×1
  • Duplicated block (5 lines × 19) crates/buzz-cli/src/commands/channels.rs:1710 — crates/buzz-cli/src/commands/channels.rs:1710-1714 | crates/buzz-cli/src/commands/channels.rs:1726-1730 | crates/buzz-cli/src/commands/channels.rs:1742-1746 | crates/buzz-cli/src/commands/channels.rs:1754-1758 | crates/buzz-cli/src/commands/channels.rs:1766-1770 | crates/buzz-cli/src/commands/channels.rs:1778-1782 | crates/buzz-cli/src/commands/channels.rs:1790-1794 | crates/buzz-cli/src/commands/channels.rs:1802-1806 | crates/buzz-cli/src/commands/channels.rs:1833-1837 | crates/buzz-cli/src/commands/channels.rs:1850-1854 | crates/buzz-cli/src/commands/channels.rs:1935-1939 | crates/buzz-cli/src/commands/emoji.rs:150-154 | crates/buzz-cli/src/commands/messages.rs:909-914 | crates/buzz-cli/src/commands/messages.rs:940-945 | crates/buzz-cli/src/commands/messages.rs:971-976 | crates/buzz-cli/src/commands/reactions.rs:71-76 | crates/buzz-cli/src/commands/social.rs:36-41 | crates/buzz-cli/src/commands/social.rs:64-69 | crates/buzz-cli/src/commands/users.rs:422-427 — there are 19 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 19 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/channels.rs:1710` 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 (5 lines × 5) · ×1
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/buzz-cli/src/commands/moderation.rs:45` 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–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 (8–26 lines × 2) · ×1
  • Duplicated block (8–26 lines × 2) mobile/ios/Runner/NativeProfileTextEditor.swift:93 — mobile/ios/Runner/NativeProfileTextEditor.swift:93-100 | mobile/ios/Runner/NativeProfileTextEditor.swift:143-168 — both copies are in the same file, so extract the 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/NativeProfileTextEditor.swift:143` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) mobile/ios/Runner/InlinePhotoPicker.swift:148 — mobile/ios/Runner/InlinePhotoPicker.swift:148-169 | mobile/ios/Runner/NativeAttachmentPopover.swift:599-621 — 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 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (17–22 lines × 2) · ×1
  • Duplicated block (17–22 lines × 2) mobile/ios/Runner/AppDelegate.swift:1043 — mobile/ios/Runner/AppDelegate.swift:1043-1064 | 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:1043` 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 (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) mobile/ios/Runner/InlinePhotoPicker.swift:196 — mobile/ios/Runner/InlinePhotoPicker.swift:196-211 | mobile/ios/Runner/NativeAttachmentPopover.swift:508-520 — 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 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) mobile/ios/Runner/AppDelegate.swift:479 — mobile/ios/Runner/AppDelegate.swift:479-484 | mobile/ios/Runner/AppDelegate.swift:513-516 | mobile/ios/Runner/AppDelegate.swift:536-541 — 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/Runner/AppDelegate.swift:479` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (69–70 lines × 2) · ×1
  • Duplicated block (69–70 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:258 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:258-326 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:225-294 — 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 6 separate duplicated blocks between them, totalling at least 172 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_bubble.dart:258` 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 (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:350 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:350-387 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:312-350 — 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 6 separate duplicated blocks between them, totalling at least 172 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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_detail_page/message_bubble.dart:350` 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 (27 lines × 4) · ×1
  • Duplicated block (27 lines × 4) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:59 — mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:59-85 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:59-85 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:66-92 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:59-85 — `mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_provider.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:59` 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 (21–27 lines × 3) · ×1
  • Duplicated block (21–27 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:139 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:139-159 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:159-185 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:139-159 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:358 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:358-378 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:483-503 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:358-378 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:358` 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 (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) mobile/lib/features/forum/forum_post_card.dart:263 — mobile/lib/features/forum/forum_post_card.dart:263-282 | mobile/lib/features/forum/forum_thread_page.dart:134-153 | mobile/lib/features/forum/forum_thread_page.dart:595-614 — before extracting anything, compare `mobile/lib/features/forum/forum_post_card.dart` and `mobile/lib/features/forum/forum_thread_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/forum/forum_post_card.dart:263` 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 (9–14 lines × 2) · ×1
  • Duplicated block (9–14 lines × 2) mobile/lib/features/activity/activity_page/inbox_row.dart:280 — mobile/lib/features/activity/activity_page/inbox_row.dart:280-293 | mobile/lib/features/search/search_page/message_tile.dart:99-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/lib/features/activity/activity_page/inbox_row.dart:280` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:94 — mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:94-101 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:112-119 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:104-111 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:94-101 — `mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_provider.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 first that the copies are not typed on the same thing: the declarations holding them bind `manager` to `ChannelMutesManager` in one and `ChannelSectionsManager` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
R10 · Code Duplication · Duplication concentrated across 28 sibling directories (284 clone groups) · ×1
  • Duplication concentrated across 28 sibling directories (284 clone groups) desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49 — 284 duplicated blocks under desktop/src/features/ have copies in at least two of the sibling directories admin-console, agents, channel-templates, channels, communities, community-members (+22 more sibling(s) not listed) — 144 of them are reported below, and 140 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 284 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 284 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 284 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (110 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (110 clone groups) desktop/src/features/messages/ui/MessageReactions.tsx:371 — 110 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 55 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 110 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 110 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 110 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:70 — desktop/src/features/agents/ui/usePersonaActions.ts:70 · desktop/src/features/agents/ui/useTeamActions.ts:66 — the two spans are one implementation copied and then locally edited — 647 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (115 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (115 matched lines × 2 locations) desktop/src/features/agents/ui/AgentsView.tsx:325 — desktop/src/features/agents/ui/AgentsView.tsx:325 · desktop/src/features/agents/ui/AgentsView.tsx:551 — the two spans are one implementation copied and then locally edited — 539 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (112 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (112 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116 — desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116 · desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:134 — the two spans are one implementation copied and then locally edited — 533 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (107 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (107 matched lines × 2 locations) desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33 — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33 · desktop/src/features/settings/ui/BackupTestFlow.tsx:14 — the two spans are one implementation copied and then locally edited — 699 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (104 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (104 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 — 544 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (102 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (102 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:148 — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:148 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:200 — the two spans are one implementation copied and then locally edited — 503 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · 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 (88 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (88 matched lines × 2 locations) desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58 — desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58 · desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:224 — the two spans are one implementation copied and then locally edited — 432 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (83 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (83 matched lines × 2 locations) desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631 — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631 · desktop/src/features/settings/ui/BackupTestFlow.tsx:341 — the two spans are one implementation copied and then locally edited — 358 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (79 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (79 matched lines × 2 locations) desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13 — desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13 · desktop/src/features/projects/ui/CreatePullRequestDialog.tsx:23 — the two spans are one implementation copied and then locally edited — 425 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (78 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (78 matched lines × 2 locations) desktop/src/features/messages/ui/MessageRow.tsx:755 — desktop/src/features/messages/ui/MessageRow.tsx:755 · desktop/src/features/messages/ui/MessageThreadSummaryRow.tsx:150 — the two spans are one implementation copied and then locally edited — 297 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (77 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (77 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48 — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:90 — the two spans are one implementation copied and then locally edited — 525 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (69 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (69 matched lines × 2 locations) desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201 — desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201 · desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1368 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (66 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (66 matched lines × 2 locations) desktop/src/features/channels/channelSnapshot.ts:46 — desktop/src/features/channels/channelSnapshot.ts:46 · desktop/src/features/projects/projectSnapshot.ts:113 — the two spans are one implementation copied and then locally edited — 393 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (59 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (59 matched lines × 2 locations) desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126 — desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126 · desktop/src/features/agents/ui/PromptSectionAccordion.tsx:17 — the two spans are one implementation copied and then locally edited — 249 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (58 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (58 matched lines × 2 locations) desktop/src/features/agents/useAgentManagement.ts:42 — desktop/src/features/agents/useAgentManagement.ts:42 · desktop/src/features/projects/useProjectChannelRequests.ts:25 — the two spans are one implementation copied and then locally edited — 328 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R11 · Import Boundaries · Boundary violation [package · ×1
  • Boundary violation [package:relative-cross-package] REDACTED:180 — REDACTED:180 reaches into another package with a relative path (../desktop/package.json) — import the package by name instead.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 672, cognitive 571) · ×1
  • Complex function (anonymous) (cyclomatic 672, cognitive 571) desktop/src/testing/e2eBridge.ts:12089 — (anonymous) has cyclomatic complexity 672 and cognitive complexity 571; 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:10949 — 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:105 — UserProfilePanel has cyclomatic complexity 112 and cognitive complexity 90; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
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:79 — 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:166 — 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:128 — AgentDefinitionDialog has cyclomatic complexity 69 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
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.
R2 · Cyclomatic Complexity · Complex function yamlToFormState (cyclomatic 60, cognitive 98) · ×1
  • Complex function yamlToFormState (cyclomatic 60, cognitive 98) desktop/src/features/workflows/ui/workflowFormTypes.ts:408 — yamlToFormState has cyclomatic complexity 60 and cognitive complexity 98; 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 AgentInstanceEditDialog (cyclomatic 60, cognitive 56) · ×1
  • Complex function AgentInstanceEditDialog (cyclomatic 60, cognitive 56) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:102 — AgentInstanceEditDialog has cyclomatic complexity 60 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 HostedCommunityOnboarding (cyclomatic 60, cognitive 56) · ×1
  • Complex function HostedCommunityOnboarding (cyclomatic 60, cognitive 56) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:76 — HostedCommunityOnboarding has cyclomatic complexity 60 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 WorkspaceTabs (cyclomatic 59, cognitive 55) · ×1
  • Complex function WorkspaceTabs (cyclomatic 59, cognitive 55) desktop/src/features/projects/ui/ProjectWorkspaceTabs.tsx:86 — WorkspaceTabs has cyclomatic complexity 59 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 ProfileSettingsCard (cyclomatic 59, cognitive 54) · ×1
  • Complex function ProfileSettingsCard (cyclomatic 59, cognitive 54) desktop/src/features/settings/ui/ProfileSettingsCard.tsx:135 — ProfileSettingsCard has cyclomatic complexity 59 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ProjectConversationPanel (cyclomatic 58, cognitive 43) · ×1
  • Complex function ProjectConversationPanel (cyclomatic 58, cognitive 43) desktop/src/features/projects/ui/ProjectConversationPanel.tsx:37 — ProjectConversationPanel has cyclomatic complexity 58 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ImageZoomOverlay (cyclomatic 51, cognitive 48) · ×1
  • Complex function ImageZoomOverlay (cyclomatic 51, cognitive 48) desktop/src/shared/ui/markdown.tsx:149 — ImageZoomOverlay has cyclomatic complexity 51 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 InviteRedeemForm (cyclomatic 50, cognitive 46) · ×1
  • Complex function InviteRedeemForm (cyclomatic 50, cognitive 46) desktop/src/features/onboarding/ui/InviteRedeemForm.tsx:63 — InviteRedeemForm has cyclomatic complexity 50 and cognitive complexity 46; 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 AgentsView (cyclomatic 50, cognitive 41) · ×1
  • Complex function AgentsView (cyclomatic 50, cognitive 41) desktop/src/features/agents/ui/AgentsView.tsx:40 — AgentsView has cyclomatic complexity 50 and cognitive complexity 41; 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 ChannelScreen (cyclomatic 50, cognitive 40) · ×1
  • Complex function ChannelScreen (cyclomatic 50, cognitive 40) desktop/src/features/channels/ui/ChannelScreen.tsx:90 — ChannelScreen has cyclomatic complexity 50 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ChannelManagementSheet (cyclomatic 50, cognitive 39) · ×1
  • Complex function ChannelManagementSheet (cyclomatic 50, cognitive 39) desktop/src/features/channels/ui/ChannelManagementSheet.tsx:99 — ChannelManagementSheet has cyclomatic complexity 50 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 48, cognitive 43) · ×1
  • Complex function (anonymous) (cyclomatic 48, cognitive 43) desktop/src/features/messages/ui/MentionAutocomplete.tsx:246 — (anonymous) has cyclomatic complexity 48 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function WorkflowDialog (cyclomatic 48, cognitive 42) · ×1
  • Complex function WorkflowDialog (cyclomatic 48, cognitive 42) desktop/src/features/workflows/ui/WorkflowDialog.tsx:216 — WorkflowDialog has cyclomatic complexity 48 and cognitive complexity 42; 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 MessageComposerImpl (cyclomatic 48, cognitive 36) · ×1
  • Complex function MessageComposerImpl (cyclomatic 48, cognitive 36) desktop/src/features/messages/ui/MessageComposer.tsx:70 — MessageComposerImpl has cyclomatic complexity 48 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ChannelManagementPanelContent (cyclomatic 47, cognitive 45) · ×1
  • Complex function ChannelManagementPanelContent (cyclomatic 47, cognitive 45) desktop/src/features/channels/ui/ChannelManagementSheet.tsx:673 — ChannelManagementPanelContent has cyclomatic complexity 47 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function HomeView (cyclomatic 47, cognitive 44) · ×1
  • Complex function HomeView (cyclomatic 47, cognitive 44) desktop/src/features/home/ui/HomeView.tsx:101 — HomeView has cyclomatic complexity 47 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function HostedCommunitiesSettingsCard (cyclomatic 47, cognitive 39) · ×1
  • Complex function HostedCommunitiesSettingsCard (cyclomatic 47, cognitive 39) desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:70 — HostedCommunitiesSettingsCard has cyclomatic complexity 47 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function MachineOnboardingFlow (cyclomatic 46, cognitive 48) · ×1
  • Complex function MachineOnboardingFlow (cyclomatic 46, cognitive 48) desktop/src/features/onboarding/ui/MachineOnboardingFlow.tsx:57 — MachineOnboardingFlow has cyclomatic complexity 46 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 46, cognitive 40) · ×1
  • Complex function (anonymous) (cyclomatic 46, cognitive 40) desktop/src/testing/e2eBridge.ts:3620 — (anonymous) has cyclomatic complexity 46 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 CommunityOnboardingFlow (cyclomatic 45, cognitive 42) · ×1
  • Complex function CommunityOnboardingFlow (cyclomatic 45, cognitive 42) desktop/src/features/onboarding/ui/CommunityOnboardingFlow.tsx:157 — CommunityOnboardingFlow has cyclomatic complexity 45 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · desktop/src/testing/e2eBridge.ts · ×1
  • desktop/src/testing/e2eBridge.ts: 14844 lines of code desktop/src/testing/e2eBridge.ts:1 — desktop/src/testing/e2eBridge.ts has 14844 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs · ×1
  • desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs: 2667 lines of code desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs:1 — desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs has 2667 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/shared/ui/VideoPlayer.tsx · ×1
  • desktop/src/shared/ui/VideoPlayer.tsx: 2094 lines of code desktop/src/shared/ui/VideoPlayer.tsx:1 — desktop/src/shared/ui/VideoPlayer.tsx has 2094 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/shared/ui/markdown.tsx · ×1
  • desktop/src/shared/ui/markdown.tsx: 1751 lines of code desktop/src/shared/ui/markdown.tsx:1 — desktop/src/shared/ui/markdown.tsx has 1751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs · ×1
  • desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs: 1561 lines of code desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1 — desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs has 1561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs · ×1
  • desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs: 1434 lines of code desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs:1 — desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs has 1434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx · ×1
  • desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx: 1164 lines of code desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:1 — desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx has 1164 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/onboarding/ui/SetupStep.tsx · ×1
  • desktop/src/features/onboarding/ui/SetupStep.tsx: 1127 lines of code desktop/src/features/onboarding/ui/SetupStep.tsx:1 — desktop/src/features/onboarding/ui/SetupStep.tsx has 1127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/agents/ui/agentSessionTranscript.ts · ×1
  • desktop/src/features/agents/ui/agentSessionTranscript.ts: 1126 lines of code desktop/src/features/agents/ui/agentSessionTranscript.ts:1 — desktop/src/features/agents/ui/agentSessionTranscript.ts has 1126 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/shared/api/relayClientSession.ts · ×1
  • desktop/src/shared/api/relayClientSession.ts: 1096 lines of code desktop/src/shared/api/relayClientSession.ts:1 — desktop/src/shared/api/relayClientSession.ts has 1096 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/messages/ui/useAnchoredScroll.ts · ×1
  • desktop/src/features/messages/ui/useAnchoredScroll.ts: 1053 lines of code desktop/src/features/messages/ui/useAnchoredScroll.ts:1 — desktop/src/features/messages/ui/useAnchoredScroll.ts has 1053 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs · ×1
  • desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs: 1035 lines of code desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs:1 — desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs has 1035 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/profile/ui/ProfileAvatarEditor.tsx · ×1
  • desktop/src/features/profile/ui/ProfileAvatarEditor.tsx: 1021 lines of code desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:1 — desktop/src/features/profile/ui/ProfileAvatarEditor.tsx has 1021 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/messages/ui/MessageComposer.tsx · ×1
  • desktop/src/features/messages/ui/MessageComposer.tsx: 1012 lines of code desktop/src/features/messages/ui/MessageComposer.tsx:1 — desktop/src/features/messages/ui/MessageComposer.tsx has 1012 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/agents/ui/AgentDefinitionDialog.tsx · ×1
  • desktop/src/features/agents/ui/AgentDefinitionDialog.tsx: 1008 lines of code desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:1 — desktop/src/features/agents/ui/AgentDefinitionDialog.tsx has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/channels/ui/ChannelPane.tsx · ×1
  • desktop/src/features/channels/ui/ChannelPane.tsx: 1007 lines of code desktop/src/features/channels/ui/ChannelPane.tsx:1 — desktop/src/features/channels/ui/ChannelPane.tsx has 1007 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/agents/ui/AgentCreationPreview.tsx · ×1
  • desktop/src/features/agents/ui/AgentCreationPreview.tsx: 1002 lines of code desktop/src/features/agents/ui/AgentCreationPreview.tsx:1 — desktop/src/features/agents/ui/AgentCreationPreview.tsx has 1002 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/agents/ui/AgentConfigFields.tsx · ×1
  • desktop/src/features/agents/ui/AgentConfigFields.tsx: 999 lines of code desktop/src/features/agents/ui/AgentConfigFields.tsx:1 — desktop/src/features/agents/ui/AgentConfigFields.tsx has 999 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/channels/ui/ChannelScreen.tsx · ×1
  • desktop/src/features/channels/ui/ChannelScreen.tsx: 995 lines of code desktop/src/features/channels/ui/ChannelScreen.tsx:1 — desktop/src/features/channels/ui/ChannelScreen.tsx has 995 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/messages/ui/useMentionSendFlow.ts · ×1
  • desktop/src/features/messages/ui/useMentionSendFlow.ts: 992 lines of code desktop/src/features/messages/ui/useMentionSendFlow.ts:1 — desktop/src/features/messages/ui/useMentionSendFlow.ts has 992 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/app/AppShell.tsx · ×1
  • desktop/src/app/AppShell.tsx: 989 lines of code desktop/src/app/AppShell.tsx:1 — desktop/src/app/AppShell.tsx has 989 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/projects/ui/ProjectDetailScreen.tsx · ×1
  • desktop/src/features/projects/ui/ProjectDetailScreen.tsx: 988 lines of code desktop/src/features/projects/ui/ProjectDetailScreen.tsx:1 — desktop/src/features/projects/ui/ProjectDetailScreen.tsx has 988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/messages/ui/MessageRow.tsx · ×1
  • desktop/src/features/messages/ui/MessageRow.tsx: 981 lines of code desktop/src/features/messages/ui/MessageRow.tsx:1 — desktop/src/features/messages/ui/MessageRow.tsx has 981 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/home/ui/HomeView.tsx · ×1
  • desktop/src/features/home/ui/HomeView.tsx: 980 lines of code desktop/src/features/home/ui/HomeView.tsx:1 — desktop/src/features/home/ui/HomeView.tsx has 980 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · admin-web/src/App.tsx · ×1
  • admin-web/src/App.tsx: 972 lines of code admin-web/src/App.tsx:1 — admin-web/src/App.tsx has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/shared/api/tauri.ts · ×1
  • desktop/src/shared/api/tauri.ts: 971 lines of code desktop/src/shared/api/tauri.ts:1 — desktop/src/shared/api/tauri.ts has 971 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx · ×1
  • desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx: 965 lines of code desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:1 — desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx has 965 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/messages/lib/useMentions.ts · ×1
  • desktop/src/features/messages/lib/useMentions.ts: 964 lines of code desktop/src/features/messages/lib/useMentions.ts:1 — desktop/src/features/messages/lib/useMentions.ts has 964 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/profile/ui/UserProfilePanel.tsx · ×1
  • desktop/src/features/profile/ui/UserProfilePanel.tsx: 960 lines of code desktop/src/features/profile/ui/UserProfilePanel.tsx:1 — desktop/src/features/profile/ui/UserProfilePanel.tsx has 960 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx · ×1
  • desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx: 954 lines of code desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx:1 — desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx has 954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/channels/ui/ChannelManagementSheet.tsx · ×1
  • desktop/src/features/channels/ui/ChannelManagementSheet.tsx: 952 lines of code desktop/src/features/channels/ui/ChannelManagementSheet.tsx:1 — desktop/src/features/channels/ui/ChannelManagementSheet.tsx has 952 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx · ×1
  • desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx: 951 lines of code desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:1 — desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/projects/ui/ProjectsView.tsx · ×1
  • desktop/src/features/projects/ui/ProjectsView.tsx: 948 lines of code desktop/src/features/projects/ui/ProjectsView.tsx:1 — desktop/src/features/projects/ui/ProjectsView.tsx has 948 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/admin-console/AdminConsoleReportsTab.tsx · ×1
  • desktop/src/features/admin-console/AdminConsoleReportsTab.tsx: 945 lines of code desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:1 — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx has 945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/shared/ui/sidebar.tsx · ×1
  • desktop/src/shared/ui/sidebar.tsx: 940 lines of code desktop/src/shared/ui/sidebar.tsx:1 — desktop/src/shared/ui/sidebar.tsx has 940 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx · ×1
  • desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx: 933 lines of code desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1 — desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/messages/ui/MessageTimeline.tsx · ×1
  • desktop/src/features/messages/ui/MessageTimeline.tsx: 933 lines of code desktop/src/features/messages/ui/MessageTimeline.tsx:1 — desktop/src/features/messages/ui/MessageTimeline.tsx has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/channels/useUnreadChannels.ts · ×1
  • desktop/src/features/channels/useUnreadChannels.ts: 931 lines of code desktop/src/features/channels/useUnreadChannels.ts:1 — desktop/src/features/channels/useUnreadChannels.ts has 931 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/search/ui/TopbarSearch.tsx · ×1
  • desktop/src/features/search/ui/TopbarSearch.tsx: 929 lines of code desktop/src/features/search/ui/TopbarSearch.tsx:1 — desktop/src/features/search/ui/TopbarSearch.tsx has 929 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · desktop/src/features/messages/ui/SystemMessageRow.tsx · ×1
  • desktop/src/features/messages/ui/SystemMessageRow.tsx: 923 lines of code desktop/src/features/messages/ui/SystemMessageRow.tsx:1 — desktop/src/features/messages/ui/SystemMessageRow.tsx has 923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (~320 LoC) · ×1
  • Dead file (~320 LoC) desktop/src/features/agents/ui/ModelPicker.tsx — no import path from any entry point (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (~84 LoC) · ×1
  • Dead file (~84 LoC) mobile/scripts/generate-emoji-data.mjs — no import path from any entry point (107 application, 34 tooling, 967 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 (~83 LoC) · ×1
  • Dead file (~83 LoC) web/src/shared/ui/card.tsx — no import path from any entry point (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (107 application, 34 tooling, 967 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 (~5 LoC) · ×1
  • Dead file (~5 LoC) desktop/src/features/projects/lib/projectLabels.ts — no import path from any entry point (107 application, 34 tooling, 967 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 — 217 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate mobile/lib/shared/hosted/hosted_flow.dart:906 — `!_disposed && generation == _generation && account.account?.subject == subject` appears character-identically in 2 files — mobile/lib/shared/hosted/hosted_flow.dart, mobile/lib/shared/hosted/hosted_flow_backup_consent.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:85 — `!_remoteEnabled || _relaySession == null` appears character-identically in 4 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart, mobile/lib/shared/read_state/read_state_manager.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:53 — `!context.mounted || pending == null || pending == isScrolledUnder.value` appears character-identically in 2 files — mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart, mobile/lib/shared/widgets/frosted_scaffold.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/add_members_sheet.dart:33 — `!kIsWeb && defaultTargetPlatform == TargetPlatform.iOS` appears character-identically in 7 files — mobile/lib/features/channels/add_members_sheet.dart, mobile/lib/features/channels/channels_page.dart, mobile/lib/features/channels/message_content/media_carousel.dart, mobile/lib/features/profile/set_status_sheet.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:341 — `(!allowDisposed && _disposed) || !_remoteEnabled || _signedEventRelay == null || !_servesThisCommunity` appears character-identically in 3 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_details_page.dart:334 — `Navigator.canPop(context) && Theme.of(context).platform == TargetPlatform.iOS` appears character-identically in 2 files — mobile/lib/features/channels/channel_details_page.dart, mobile/lib/features/channels/thread_detail_page/app_bar.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/compose_bar/attachments.dart:505 — `_AttachmentSurface.camera || _AttachmentSurface.photos` appears character-identically in 2 files — mobile/lib/features/channels/compose_bar/attachments.dart, mobile/lib/features/channels/compose_bar/compose_bar_widget.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/pairing/pairing_socket.dart:170 — `_authCompleter != null && !_authCompleter!.isCompleted` appears character-identically in 2 files — mobile/lib/features/pairing/pairing_socket.dart, mobile/lib/shared/relay/relay_socket.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:98 — `_disposed || !_remoteEnabled || _relaySession == null` appears character-identically in 3 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sort/channel_sort_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/agent_activity/observer_subscription.dart:113 — `_disposed || epoch != _subscriptionEpoch` appears character-identically in 2 files — mobile/lib/features/channels/agent_activity/observer_subscription.dart, mobile/lib/shared/theme/community_theme_sync.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:354 — `_isIdenticalToLastPublished() || !_servesThisCommunity` appears character-identically in 3 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:129 — `_liveSettled || await _startLiveSubscription()` appears character-identically in 2 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/pairing/pairing_socket.dart:243 — `_pendingAuthEventId != null && eventId == _pendingAuthEventId` appears character-identically in 2 files — mobile/lib/features/pairing/pairing_socket.dart, mobile/lib/shared/relay/relay_socket.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:146 — `_unsubscribe != null || await _startLiveSubscription()` appears character-identically in 2 files — mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_sort/channel_sort_manager.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/shared/relay/relay_session.dart:253 — `active() && !_disposed && generation == _contextGeneration` appears character-identically in 2 files — mobile/lib/shared/relay/relay_session.dart, mobile/lib/shared/relay/relay_session_snapshot.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_detail_page/message_list.dart:331 — `activeDayTimestamp == null || activeDayStartIndex == null` appears character-identically in 2 files — mobile/lib/features/channels/channel_detail_page/message_list.dart, mobile/lib/features/channels/thread_detail_page/sticky_date.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/profile/settings_profile_header.dart:80 — `animatedAvatar != null && stoppedAnimationUrl.value != animatedAvatar.animationUrl` appears character-identically in 2 files — mobile/lib/features/profile/settings_profile_header.dart, mobile/lib/features/profile/user_profile_sheet.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/activity/activity_page/header_actions.dart:80 — `buttonContext.mounted && selected != null` appears character-identically in 2 files — mobile/lib/features/activity/activity_page/header_actions.dart, mobile/lib/features/profile/settings_profile_header.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/shared/hosted/saved_identity_profile.dart:126 — `bytes.length > 2 && bytes[0] == 0x1f && bytes[1] == 0x8b` appears character-identically in 2 files — mobile/lib/shared/hosted/saved_identity_profile.dart, mobile/lib/shared/relay/relay_query_response.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/me/me_page.dart:179 — `c.isMember && !c.isArchived && c.isSoloChat(legacyChannels)` appears character-identically in 2 files — mobile/lib/features/channels/me/me_page.dart, mobile/lib/features/channels/me/me_unread_provider.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/shared/widgets/ios_native_segmented_control.dart:47 — `call.method == 'changed' && call.arguments is int` appears character-identically in 2 files — mobile/lib/shared/widgets/ios_native_segmented_control.dart, mobile/lib/shared/widgets/ios_native_skin_tone_control.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_member_snapshots.dart:13 — `current == null || event.createdAt > current.createdAt` appears character-identically in 3 files — mobile/lib/features/channels/channel_member_snapshots.dart, mobile/lib/features/invites/invite_create_provider.dart, mobile/lib/shared/verified_profiles/verified_profile.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_directory.dart:291 — `current == null || event.createdAt > current.createdAt || (event.createdAt == current.createdAt && event.id.compareTo(current.id) < 0)` appears character-identically in 2 files — mobile/lib/features/channels/channel_directory.dart, mobile/lib/shared/profile/profile_event_parser.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_actions_sheet.dart:117 — `currentMember?.isElevated == true || ownsOwnerAgent` appears character-identically in 2 files — mobile/lib/features/channels/channel_actions_sheet.dart, mobile/lib/features/channels/channel_details_page.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mobile/lib/features/channels/channel_detail_page/message_bubble.dart:78 — `currentPubkey?.toLowerCase() == pk || (profile?.ownerPubkey != null && profile?.ownerPubkey == currentPubkey?.toLowerCase())` appears character-identically in 2 files — mobile/lib/features/channels/channel_detail_page/message_bubble.dart, mobile/lib/features/channels/thread_detail_page/thread_message.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:93 — `warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:113 — `warn!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:121 — `warn!` at line 121 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:130 — `warn!` at line 130 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:137 — `warn!` at line 137 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:144 — `warn!` at line 144 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:480 — `warn!` at line 480 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/discovery.rs:1156 — `warn!` at line 1156 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-ws-client/src/connection.rs:118 — `debug!` at line 118 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-ws-client/src/connection.rs:142 — `debug!` at line 142 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-ws-client/src/connection.rs:233 — `debug!` at line 233 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:678 — `info!` at line 678 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:739 — `warn!` at line 739 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:751 — `info!` at line 751 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:784 — `info!` at line 784 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:814 — `info!` at line 814 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:841 — `info!` at line 841 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:939 — `debug!` at line 939 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:1217 — `warn!` at line 1217 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:244 — `warn!` at line 244 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:250 — `debug!` at line 250 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:337 — `error!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:356 — `error!` at line 356 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:383 — `error!` at line 383 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:450 — `error!` at line 450 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×27
  • Silent fallback default in catch mobile/lib/features/activity/compose_drafts_provider.dart:127 — `build` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch mobile/lib/features/activity/reminders_provider.dart:168 — `_fetch` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch mobile/lib/features/channels/thread_follows/thread_follows_storage.dart:61 — `read` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch mobile/lib/shared/community/community.dart:183 — `nameFromUrl` turns every thrown error into `'Community'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch mobile/lib/shared/community/community_icon_cache.dart:40 — `build` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch mobile/lib/shared/emoji/recent_emoji_provider.dart:134 — `build` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch mobile/lib/shared/security/sensitive_action_authorizer.dart:36 — `enrolledBiometrics` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch desktop/src/app/huddleBackingChannelStorage.ts:10 — `readStoredIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/agents/lib/useBotRecents.ts:70 — `useBotRecents` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/communities/communityStorage.ts:97 — `loadCommunities` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/communities/communityStorage.ts:207 — `deriveCommunityName` swallows every exception into `return "Community"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/communities/communityNavigationStorage.ts:44 — `loadCommunityDestinations` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/channels/readState/readStateIdentity.ts:48 — `loadExtraSlotIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/channels/threadActivityStorage.ts:73 — `readActivityFromStorage` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/communities/communityRelaySet.ts:21 — `communityRelaySetKey` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/home/useFeedItemState.ts:26 — `readStoredIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx:63 — `readDraft` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/messages/lib/formatTimelineMessages.ts:562 — `extractSystemMessagePubkeys` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/messages/lib/useThreadFollows.ts:32 — `readFromStorage` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/messages/ui/useQuickReactionEmojis.ts:92 — `readQuickReactionEntries` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/notifications/lib/desktop.ts:182 — `getDesktopNotificationPermissionState` swallows every exception into `return "default"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/notifications/use-feed-desktop-notifications.ts:55 — `readStoredSeenFeedIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/projects/projectFetch.ts:26 — `readHiddenProjectCards` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/projects/lib/projectsViewHelpers.ts:98 — `readStoredFilter` swallows every exception into `return "all"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch desktop/src/features/projects/lib/projectsViewHelpers.ts:131 — `readStoredRepositoryScope` swallows every exception into `return "all"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • + 2 more in this group — see findings.md.
D24 · Comment Value · redundant comment · ×18
  • redundant comment desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs:1397 — "The parsed human message reaches toast.error." repeats the code it sits on: 5 of its 6 words (parsed, human, message, toast, error) are already in `assert.ok(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs:1409 — "No success toast on a rejected resolve." repeats the code it sits on: 5 of its 5 words (no, success, toast, rejected, resolve) are already in `assert.ok(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/agent-memory/lib/buildMemoryGraph.test.mjs:65 — "Orphans sorted by slug → alpha before zeta" repeats the code it sits on: 4 of its 5 words (orphans, slug, alpha, zeta) are already in `assert.deepEqual(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/agent-memory/lib/buildMemoryGraph.test.mjs:101 — "mem/missing referenced by core; mem/also-missing referenced by mem/orphan" repeats the code it sits on: 5 of its 5 words (mem, missing, referenced, core, orphan) are already in `assert.deepEqual(g.dangling, [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/agents/ui/EnvVarsEditor.test.mjs:772 — "User edits the generic USER_VAR row." repeats the code it sits on: 4 of its 5 words (user, edits, var, row) are already in `const editedRows = rowsAfterSwitch.map((r) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/agents/ui/agentSnapshotSend.test.mjs:133 — "Guard is idle after both settle." repeats the code it sits on: 3 of its 3 words (guard, idle, settle) are already in `assert.equal(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/agents/ui/agentSnapshotSend.test.mjs:226 — "Guard is idle after both settle." repeats the code it sits on: 3 of its 3 words (guard, idle, settle) are already in `assert.equal(guard.inFlight, false, "guard should be idle after both settle");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/channels/readState/readStateManager.test.mjs:735 — "Channel key in slot 0." repeats the code it sits on: 3 of its 3 words (channel, key, slot) are already in `assert.ok(makeChannelKey(1) in result.slots[0], "channel key in slot 0");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/messages/lib/useDrafts.test.mjs:487 — "No sent records." repeats the code it sits on: 3 of its 3 words (no, sent, records) are already in `assert.equal(getSentDraftEntries().length, 0, "no sent records");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/messages/lib/useDrafts.test.mjs:872 — "localStorage unchanged." repeats the code it sits on: 3 of its 3 words (local, storage, unchanged) are already in `assert.deepStrictEqual(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/messages/lib/useDrafts.test.mjs:904 — "deepStrictEqual on the surviving canonical record." repeats the code it sits on: 5 of its 6 words (deep, strict, equal, canonical, record) are already in `assert.deepStrictEqual(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/messages/ui/MessageComposerDraftPredicate.test.mjs:169 — "Active key is cleared; active draft removed." repeats the code it sits on: 4 of its 5 words (active, key, cleared, draft) are already in `assert.equal(loadDraftEntry(draftKey), undefined, "active key cleared");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/features/settings/ui/SettingsPanels.tsx:466 — "All light themes (paired light + light-only)" repeats the code it sits on: 4 of its 4 words (light, themes, paired, only) are already in `const allLightThemes = useMemo(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/shared/api/relayClosedRecovery.test.mjs:368 — "Arm the gate via a rate-limited history CLOSED." repeats the code it sits on: 5 of its 6 words (gate, rate, limited, history, closed) are already in `handleRelayClosed({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/src/shared/lib/localStorageSweep.test.mjs:612 — "Stale key removed despite the per-key error on its sibling." repeats the code it sits on: 5 of its 6 words (stale, key, removed, despite, error) are already in `assert.equal(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/tests/e2e/inbox-live-update.spec.ts:725 — "Detail shows cold anchor as selected message." repeats the code it sits on: 5 of its 6 words (detail, cold, anchor, selected, message) are already in `await expect(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/tests/e2e/inbox-live-update.spec.ts:921 — "Cold anchor is the highlighted selected message." repeats the code it sits on: 4 of its 5 words (cold, anchor, selected, message) are already in `await expect(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment desktop/tests/e2e/sidebar.spec.ts:864 — "Sidebar card shows the manual update card." repeats the code it sits on: 4 of its 5 words (sidebar, card, manual, update) are already in `const updateCard = page.getByTestId("sidebar-update-card-manual");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×18
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned file · ×11
  • Orphaned file desktop/src/shared/lib/datetime.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src-tauri/src/mesh_llm/identity.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src-tauri/src/mouse_nav.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src/features/search/lib/parseSearchOperators.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src/features/home/ui/InboxFilterMenu.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src/shared/lib/safeStorage.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src/features/messages/useLoadMissingAncestors.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src/features/agents/lib/agentAccessWarning.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src-tauri/src/managed_agents/readiness/cli_login.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src/shared/ui/PageHeader.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file desktop/src-tauri/src/mesh_llm/progress.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X7 · Silent fallback defaults · Silent fallback default on Err · ×10
  • Silent fallback default on Err crates/buzz-agent/src/agent.rs:1220 — `format_hook_output_body` turns every `Err` into `String::from("{\"hook\":\"\",\"server\":\"\",\"text\":\"\"}")` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/buzz-cli/src/commands/notes.rs:224 — `resolve_author` turns every `Err` into `false` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/buzz-cli/src/desktop_provider.rs:790 — `advertisements_in` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/buzz-cli/src/desktop_provider.rs:1206 — `paired_relays_in` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/buzz-relay/src/api/git/cas_publish.rs:960 — `read_prefix` turns every `Err` into `"<stderr unavailable>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/buzz-relay/src/api/git/transport.rs:1656 — `read_log_prefix` turns every `Err` into `"<stderr unavailable>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err desktop/src-tauri/src/commands/identity_archive.rs:446 — `fetch_archived_pubkeys_at` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err desktop/src-tauri/src/commands/project_git_diff.rs:189 — `diff_range` turns every `Err` into `"HEAD^..HEAD".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err desktop/src-tauri/src/managed_agents/storage.rs:855 — `read_all_agent_runtime_receipts` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err desktop/src-tauri/src/managed_agents/storage.rs:883 — `read_all_agent_pid_files` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×9
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 81 significant file(s) lose their only recent owner: mobile/lib/features/profile/animated_avatar_capture.dart, mobile/lib/features/profile/profile_avatar_editor.dart, mobile/ios/Runner/NativeAttachmentPopover.swift, mobile/lib/features/profile/profile_edit_page.dart, mobile/lib/shared/huddle/huddle_media.dart, mobile/ios/Runner/NativeProfileTextEditor.swift, desktop/src/features/messages/ui/AudioMessageAttachment.tsx, mobile/lib/features/channels/mobile_huddle_controller.dart (+73 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 46 significant file(s) lose their only recent owner: crates/buzz-auth/src/nip_fi/command.rs, desktop/src-tauri/src/secret_store.rs, desktop/src-tauri/src/managed_agents/custom_harnesses.rs, desktop/src-tauri/src/commands/admin/mod.rs, desktop/src/features/admin-console/AdminConsoleReportsTab.tsx, desktop/src-tauri/src/managed_agents/repos.rs, desktop/src-tauri/src/managed_agents/runtime/sweep.rs, desktop/src/features/admin-console/api.ts (+38 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 32 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 (+24 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 27 significant file(s) lose their only recent owner: mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift, mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift, mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift, crates/buzz-push-gateway/src/app_attest.rs, mobile/lib/shared/push/dev_push_lease.dart, mobile/lib/shared/push/push_bootstrap.dart, crates/buzz-push-gateway/src/config.rs, crates/buzz-push-gateway/src/app_attest/testing.rs (+19 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 17 significant file(s) lose their only recent owner: desktop/src/features/messages/ui/useComposerLinkPreviews.tsx, desktop/src/features/messages/ui/ComposerImageEditor.tsx, desktop/src-tauri/src/commands/link_preview_youtube.rs, desktop/src/shared/theme/communityThemeSync.ts, desktop/src/features/messages/lib/linkPreviewPreparationStore.ts, REDACTED, desktop/src/shared/theme/CommunityThemeController.tsx, desktop/src/features/messages/ui/useAutoPinMentionedAgents.ts (+9 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 17 significant file(s) lose their only recent owner: desktop/src-tauri/src/managed_agents/persona_avatars.rs, crates/buzz-core/src/private_managed_agent.rs, desktop/src/features/terminal/TerminalSubstrate.tsx, crates/buzz-db/src/store/read_state.rs, REDACTED, desktop/src/features/channels/channelSnapshot.ts, desktop/src/features/onboarding/ui/LandingBees.tsx, desktop/src-tauri/src/prevent_sleep.rs (+9 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 10 significant file(s) lose their only recent owner: crates/buzz-core/src/git_perms.rs, desktop/src-tauri/src/huddle/tts_playback.rs, desktop/src/features/community-members/useCommunityJoinAlerts.ts, crates/buzz-backend-kubernetes/src/config.rs, crates/buzz-auth/src/scope.rs, desktop/src/features/community-members/lib/joinAlerts.ts, crates/buzz-backend-kubernetes/src/image.rs, desktop/src/features/messages/lib/channelWindowResponse.ts (+2 more). 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-acp/src/acp_frame_writer.rs, mobile/ios/BuzzPushKit/Sources/BuzzPushKit/Bech32.swift, crates/buzz-acp/src/edit_routing.rs, crates/buzz-acp/src/recovery_wake.rs, mobile/lib/features/channels/channel_identity_names_provider.dart, mobile/lib/features/channels/laid_out_viewport.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 5 significant file(s) lose their only recent owner: crates/buzz-feature-flags/src/launchdarkly.rs, crates/buzz-relay/src/tenant.rs, crates/buzz-db/src/store/reminder.rs, crates/buzz-feature-flags/src/lib.rs, desktop/src/features/profile/lib/userLabelStorage.ts. Pair on, review, or document these before any departure.
X9 · Subsumed condition operand · Subsumed condition operand · ×8
  • Subsumed condition operand web/src/features/repos/git-client.ts:325 — `ref.startsWith("//")` can never decide this `||` — every value satisfying `ref.startsWith("//")` also satisfies `ref.startsWith("/")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand desktop/src-tauri/src/managed_agents/team_catalog/tests.rs:939 — `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand desktop/src-tauri/src/commands/agents_pending.rs:333 — `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand desktop/src-tauri/src/commands/agents_pending.rs:419 — `err.contains("archive insert blocked")` can never decide this `||` — every value satisfying `err.contains("archive insert blocked")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand desktop/src-tauri/src/commands/teams/tests.rs:153 — `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand desktop/src-tauri/src/commands/personas/pending.rs:583 — `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand desktop/src/features/workflows/ui/workflowDefinition.ts:181 — `detail.startsWith(" is not ")` can never decide this `||` — every value satisfying `detail.startsWith(" is not ")` also satisfies `detail.startsWith(" is ")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/buzz-test-client/tests/e2e_relay.rs:1919 — `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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Pending state with no failure state · ×3
  • Pending state with no failure state desktop/src/features/settings/ui/PreventSleepSettingsCard.tsx:47 — The view draws `Waiting for agents to start` under `enabled && ! hasRunningAgents`, but `enabled` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state desktop/src/features/reminders/ui/RemindMeLaterDialog.tsx:147 — The view draws `<span class="absolute inset-0 flex items-center justify-center">` under `create . isPending`, but `create` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state desktop/src/features/projects/ui/DiscussionChannels.tsx:400 — The view draws `<BuzzLoadingState label="Loading channel discussions"/>` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
D20 · ADR Quality · ADR has no Context and Decision section · ×2
  • ADR has no Context and Decision section docs/adr/0001-internal-and-public-mobile-builds.md:1 — docs/adr/0001-internal-and-public-mobile-builds.md has no Context and Decision section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
  • ADR has no Context and Decision section docs/adr/0002-notification-message-text.md:1 — docs/adr/0002-notification-message-text.md has no Context and Decision section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D21 · Naming Consistency · `relayUrl` spells `Url` where 25 names in the project spell it `URL` · ×2
  • `relayUrl` spells `Url` where 25 names in the project spell it `URL` mobile/ios/BuzzPushKit/Sources/BuzzPushKit/PushLease.swift:14 — 25 of 27 names in project mobile~ios~BuzzPushKit~BuzzPushKit spell the token `URL` (25 of 27; unit: names in project mobile~ios~BuzzPushKit~BuzzPushKit containing `URL`). Peers: BuzzAgeRestrictionSession.restrict(containerURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzAgeRestrictionSession.swift:18); BuzzAgeRestrictionSession.isRestricted(containerURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzAgeRestrictionSession.swift:52); BuzzAgeRestrictionSession.handoffIfAllowed(containerURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzAgeRestrictionSession.swift:69); BuzzDevPushEnrollmentDriver.gatewayBaseURL (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:334); BuzzDevPushEnrollmentDriver.init(gatewayBaseURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:345). Rename to `relayURL`. [rule N6]
  • `relayUrl` spells `Url` where 25 names in the project spell it `URL` mobile/ios/BuzzPushKit/Sources/BuzzPushKit/PushLease.swift:22 — 25 of 27 names in project mobile~ios~BuzzPushKit~BuzzPushKit spell the token `URL` (25 of 27; unit: names in project mobile~ios~BuzzPushKit~BuzzPushKit containing `URL`). Peers: BuzzAgeRestrictionSession.restrict(containerURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzAgeRestrictionSession.swift:18); BuzzAgeRestrictionSession.isRestricted(containerURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzAgeRestrictionSession.swift:52); BuzzAgeRestrictionSession.handoffIfAllowed(containerURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzAgeRestrictionSession.swift:69); BuzzDevPushEnrollmentDriver.gatewayBaseURL (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:334); BuzzDevPushEnrollmentDriver.init(gatewayBaseURL) (mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:345). Rename to `relayURL`. [rule N6]
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 11 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 (256 single-owned of 2514 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2514 of the 3560 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 (2 file(s)), anonymized user #13 (2 file(s)), anonymized user #14 (1 file(s)), anonymized user #15 (1 file(s)) (+5 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/buzz-relay/src/lifecycle.rs, crates/buzz-db/src/runtime/connection_observability.rs, crates/ifc-core/src/lib.rs, desktop/src-tauri/src/hpke_key_backup.rs, desktop/src-tauri/src/nostr_bind.rs, desktop/src/shared/ui/markdown/ImageLightboxZoomControls.tsx, desktop/src/shared/lib/videoPlaybackSpeedPreference.ts, desktop/src/features/channels/ui/ThreadViewModeToggle.tsx (+7 more).
D21 · Naming Consistency · `isHTMLElement` spells `HTML` where 15 names in the project spell it `Html` · ×1
  • `isHTMLElement` spells `HTML` where 15 names in the project spell it `Html` desktop/src/shared/hooks/useWebviewScrollBoundaryLock.ts:8 — 15 of 16 names in project buzz-workspace spell the token `Html` (15 of 16; unit: names in project buzz-workspace containing `Html`). Peers: agentSnapshotClipboard.escapeHtml (REDACTED:22); agentSnapshotClipboard.buildSnapshotClipboardHtml (REDACTED:44); agentSnapshotClipboard.buildAgentSnapshotClipboardHtml (REDACTED:67); agentSnapshotClipboard.buildTeamSnapshotClipboardHtml (REDACTED:73); agentSnapshotClipboard.parseSnapshotClipboardHtml (REDACTED:86). Rename to `isHtmlElement`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 5 of 45 project(s) overshoot their size bounds, lowering Project Cohesion to 7.8/10. The most over is `desktop` (329054 LoC, 2029 module-visible types across 104 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 11 of 2514 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2514 of the 3560 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: desktop/src/shared/lib/datetime.ts, desktop/src-tauri/src/mesh_llm/identity.rs, desktop/src-tauri/src/mouse_nav.rs, desktop/src/features/search/lib/parseSearchOperators.ts, desktop/src/features/home/ui/InboxFilterMenu.tsx, desktop/src/shared/lib/safeStorage.ts, desktop/src/features/messages/useLoadMissingAncestors.ts, desktop/src/features/agents/lib/agentAccessWarning.ts (and 3 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 21/30 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 4 more.
R7 · Dead Code · Unused export 'CM_OP_PUBKEY' · ×1
  • Unused export 'CM_OP_PUBKEY' desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:356 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'AdminReadError' · ×1
  • Unused export 'AdminReadError' desktop/src/features/admin-console/api.ts:626 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'useSetManagedAgentAutoRestartMutation' · ×1
  • Unused export 'useSetManagedAgentAutoRestartMutation' desktop/src/features/agents/hooks.ts:646 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'useEnsureChannelAgentPresetMutation' · ×1
  • Unused export 'useEnsureChannelAgentPresetMutation' desktop/src/features/agents/hooks.ts:752 — Nothing imports this binding — it is safe to review for removal.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected deploy/compose/Caddyfile:4 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
X2 · Cancellation propagation · Not all functions that make a request accept an AbortSignal or a CancelToken · ×1
  • Not all functions that make a request accept an AbortSignal or a CancelToken — Only 21/32 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; Dio, AbortableRequest) accept an AbortSignal or a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Dart: `CancelToken? cancelToken`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 3/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex REDACTED:327 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Minor — 1 finding(s)
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:140 — 0 of 51 documented parameters and 1 of 4407 summaries in `buzz` only repeat the member or parameter name (e.g. "Label for each action." for `actionLabel`). Delete the restating tags, or add what the name does not say.

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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-19baaf74cd3e4927a6336c5bf5a42abe/history.json --exit-code 0 --source .19artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-19baaf74cd3e4927a6336c5bf5a42abe/tree.json --exit-code 0 --source .12artifacts/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/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .65artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .78artifacts/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 34 file(s) — `admin-web/src/App.tsx`, `desktop/src/app/useAppShellDesktopNotifications.ts`, `desktop/src/features/agents/channelAgents.ts`, `desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx`, `desktop/src/features/agents/ui/activityRenderClasses/TranscriptActivityItem.tsx`, … (+29 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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/** .0artifacts/raw/trivy-fs.json

Run 01a1da9b-5c42-7e03-bcb8-4f10711a0195 · 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