Public report of spotiflacapp/SpotiFLAC-Mobile, published 12 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.3). 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, 12 November 2026, 03:18 UTC · Survey ID cd_46ffb9a818404702a37233c2eadb6209

spotiflacapp/SpotiFLAC-Mobile

Measured 12 November 2026, 03:17 UTC, at code version 45df986

CAI score 66out of 100 Adequate
CriticalWeakAdequateStrongExemplary
No change since the last survey

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

A large codebase: 359,024 lines of product code in 21 projects, tests not counted · Estimated rebuild effort: about 4.3 person-years · Weakest lens: Code Health, 62

Findings by how serious they are

20 critical 2309 serious 53 minor

17 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
12 November 2026, 03:17 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.

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 ▸

60of 60 dimensions measured by tools.
2369of 2382 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
60dimensions across 7 lenses, read from 359,024 lines of product code in 21 projects.
Chapters

Executive summary

spotiflacapp/SpotiFLAC-Mobile falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 66 out of 100 and is rated Adequate, and seven of its 20 critical findings are security problems.

Code Health, at 62, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 2 points. Simplifying the hardest methods would lift Code Health itself, also worth about 2. Raising Code Health to 70 would lift the score to about 68.

Four weaknesses in the code could be used by an attacker. Two pipeline steps run downloads nobody checks, and seven sets of files in separate parts keep changing together, which points to hidden dependencies. Fixing the weaknesses the scanner points to, checking each download against a checksum and making the hidden dependencies explicit would close these risks. The password or key in the code's history needs replacing, with the old one switched off. Giving the shared object a factory instead of the short-lived one would take care of the six shared objects holding on to short-lived ones.

The product code is 359,024 lines, about €620,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.
Code Health 62 · counts for 46%Production Readiness 64 · counts for 25%Security and Compliance 68 · counts for 14%Maturity 68 · counts for 8%Architecture 86 · counts for 4%Performance 89 · counts for 2%Domain Modelling 100 · counts for 1%

If Code Health rose from 62 to 70, the lowest score rated Strong, the score would rise from 66 to about 68.

Code composition: what the lines of code are
Product code 62%Tests 38%
New since the last survey: 839 findings

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

  • Cyclomatic Complexity · _LibrarySearchResultsState._buildSlivers (cyclomatic 54) lib/widgets/library_search_results.dart
  • Cyclomatic Complexity · LinkLibraryExecutor.call (cyclomatic 49) lib/services/link/desktop/link_library_executor.dart
  • Cyclomatic Complexity · LyricsTranslator.translate (cyclomatic 46) lib/services/lyrics_translation.dart
  • Cyclomatic Complexity · DownloadFileRecovery._recover (cyclomatic 44) lib/services/download_file_recovery.dart
  • Cyclomatic Complexity · LinkDesktopRemote._applyLocally (cyclomatic 44) lib/services/link/features/link_desktop_remote.dart
  • Cyclomatic Complexity · _MusicGapless._prepare (cyclomatic 43) lib/services/music_player_gapless.dart
  • Cyclomatic Complexity · mornye_mobile::native_autoplay_taste::execute (cyclomatic 42) rust_backend/crates/mobile/src/native_autoplay_taste.rs
  • Cyclomatic Complexity · LinkLibraryJobsHost.handle (cyclomatic 33) lib/services/link/desktop/link_library_jobs_host.dart
  • Cyclomatic Complexity · DownloadFileFinalizer.autoConvert (cyclomatic 32) lib/services/download_file_finalizer.dart
  • Cyclomatic Complexity · LinkPlaysOnDesktop.build (cyclomatic 32) lib/services/link/features/link_remote_playback.dart
  • Cyclomatic Complexity · Backend::cache_cover (cyclomatic 32) rust_backend/crates/extensions/src/backend/cover.rs
  • Cyclomatic Complexity · LyricsDraft.parse (cyclomatic 31) lib/utils/lyrics_draft.dart
  • Cyclomatic Complexity · LyricsTranslationController.translate (cyclomatic 30) lib/providers/lyrics_translation_provider.dart
  • Cyclomatic Complexity · _NowPlayingScreenState._showMoreActions (cyclomatic 30) lib/screens/now_playing_screen.dart
  • Cyclomatic Complexity · LinkLibraryJobRow.build (cyclomatic 30) lib/widgets/link/link_library_actions.dart
  • Cyclomatic Complexity · _MixBuilder.build (cyclomatic 29) lib/services/library_mixes.dart
  • Cyclomatic Complexity · LinkHistorySyncStore.apply (cyclomatic 29) lib/services/link/sync/link_history_sync_store.dart
  • Cyclomatic Complexity · _LibraryDirectoryViewState.build (cyclomatic 29) lib/widgets/library_directory_view.dart
  • Cyclomatic Complexity · NetworkOfflineNotifier.save (cyclomatic 28) lib/providers/network_offline_provider.dart
  • Cyclomatic Complexity · LinkPhoneSession.apply (cyclomatic 27) lib/services/link/features/link_phone_session.dart
  • Cyclomatic Complexity · LinkCollectionSyncStore._withData (cyclomatic 27) lib/services/link/sync/link_collection_sync_store.dart
  • Cyclomatic Complexity · LinkHistoryArtwork.sync (cyclomatic 27) lib/services/link/sync/link_history_artwork.dart
  • Cyclomatic Complexity · _LastfmSettingsState.build (cyclomatic 27) lib/widgets/lastfm_settings.dart
  • Cyclomatic Complexity · _HomeContinueListeningCardState.build (cyclomatic 26) lib/screens/home_tab_intro.dart
  • Cyclomatic Complexity · LinkClientSession._connect (cyclomatic 26) lib/services/link/client/link_client_session.dart
  • Cyclomatic Complexity · ExclusiveOutputDeck._switchTo (cyclomatic 25) lib/services/exclusive_output_deck.dart
  • Cyclomatic Complexity · LibrarySchema.rebaseContainerPaths (cyclomatic 25) lib/services/library_schema.dart
  • Cyclomatic Complexity · LinkDesktopOps.runCommand (cyclomatic 25) lib/services/link/desktop/link_desktop_ops.dart
  • Cyclomatic Complexity · LinkWebCovers._run (cyclomatic 25) lib/services/link/desktop/link_web_covers.dart
  • Cyclomatic Complexity · _LinkSyncHandlers.star (cyclomatic 25) lib/services/link/sync/link_sync_handlers.dart
  • Cyclomatic Complexity · MusicPlayerHandler.onSourceMetadataChanged (cyclomatic 25) lib/services/music_player_service.dart
  • Cyclomatic Complexity · SubsonicClient.cachedCover (cyclomatic 25) lib/services/network_storage_subsonic.dart
  • Cyclomatic Complexity · _DesktopShortcutsState._run (cyclomatic 25) lib/widgets/desktop/desktop_shortcuts.dart
  • Cyclomatic Complexity · LinkMirroredPlayback._resolve (cyclomatic 24) lib/services/link/link_mirrored_playback.dart
  • Cyclomatic Complexity · _LibraryDirectoryViewState._buildFolder (cyclomatic 24) lib/widgets/library_directory_view.dart
  • Cyclomatic Complexity · _LyricsOptionsButtonState._showMenu (cyclomatic 24) lib/widgets/lyrics_options_button.dart
  • Cyclomatic Complexity · _TvNavigationState._handleKey (cyclomatic 24) lib/widgets/tv_navigation.dart
  • Cyclomatic Complexity · _HomeSections.build (cyclomatic 23) lib/screens/home_tab_intro.dart
  • Cyclomatic Complexity · CueSplitLibraryService.publish (cyclomatic 23) lib/services/cue_split_library_service.dart
  • Cyclomatic Complexity · MetadataPersistenceService._saveLocal (cyclomatic 23) lib/services/metadata_persistence_service.dart
  • Cyclomatic Complexity · SongAnalysis._sweepLibrary (cyclomatic 23) lib/services/song_analysis.dart
  • Cyclomatic Complexity · SongFeatureAnalyzer.analyze (cyclomatic 23) lib/services/song_feature_analyzer.dart
  • Cyclomatic Complexity · CastService::call (cyclomatic 23) rust_backend/crates/cast/src/service.rs
  • Cyclomatic Complexity · _LibraryTracksFolderScreenState._buildSelectionBottomBar (cyclomatic 22) lib/screens/library_tracks_folder_screen.dart
  • Cyclomatic Complexity · LinkClientController._updateDiscovery (cyclomatic 22) lib/services/link/client/link_client_controller.dart
  • Cyclomatic Complexity · _TransferSongRow.build (cyclomatic 22) lib/widgets/link/link_transfer_tile.dart
  • Cyclomatic Complexity · LinkNowPlayingController.handle (cyclomatic 22) ios/Runner/LinkNowPlayingBridge.swift
  • Cyclomatic Complexity · PlayerMetadataController.searchOnline (cyclomatic 21) lib/controllers/player_metadata_controller.dart
  • Cyclomatic Complexity · LastfmService.finishConnection (cyclomatic 21) lib/services/lastfm/lastfm_service.dart
  • Cyclomatic Complexity · LinkPairingClient.pair (cyclomatic 21) lib/services/link/client/link_client_pairing.dart
  • Cyclomatic Complexity · LinkPhoneCatalogs._page (cyclomatic 21) lib/services/link/desktop/link_phone_catalogs.dart
  • Cyclomatic Complexity · SharedLyricsTranslation.fromJson (cyclomatic 21) lib/services/lyrics_translation_sharing.dart
  • Cyclomatic Complexity · NetworkStorageService._openRead (cyclomatic 21) lib/services/network_storage_service.dart
  • Cyclomatic Complexity · DesktopInspector.build (cyclomatic 21) lib/widgets/desktop/desktop_inspector.dart
  • Cyclomatic Complexity · _PlaybackTimeBuilderState._sync (cyclomatic 21) lib/widgets/playback_time_builder.dart
  • Cyclomatic Complexity · CastOutputPlugin.handle (cyclomatic 21) android/app/src/main/kotlin/com/zarz/mornye/CastOutputPlugin.kt
  • Cyclomatic Complexity · NativeFinalizerContainerKt.finalizeAutoConversion (cyclomatic 21) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerContainer.kt
  • Cyclomatic Complexity · LinkDesktopHost.exportCatalog (cyclomatic 20) lib/services/link/desktop/link_desktop_host.dart
  • Cyclomatic Complexity · RuntimeLinkPlayerPort.snapshot (cyclomatic 20) lib/services/link/desktop/link_player.dart
  • Cyclomatic Complexity · LinkSyncRunner._syncOnce (cyclomatic 20) lib/services/link/sync/link_sync_runner.dart
  • Cyclomatic Complexity · _AudioOutputButtonState._showPicker (cyclomatic 20) lib/widgets/audio_output_button.dart
  • Cyclomatic Complexity · MaterialPlayerLayout.build (cyclomatic 20) lib/widgets/material_player_layout.dart
  • Cyclomatic Complexity · _MornyePlaybackButtonState.build (cyclomatic 20) lib/widgets/mornye_playback_button.dart
  • Cyclomatic Complexity · mornye_link::subsonic::forward::call (cyclomatic 20) rust_backend/crates/link/src/subsonic/forward.rs
  • Cyclomatic Complexity · mornye_mobile::native_directory_stats::scan (cyclomatic 20) rust_backend/crates/mobile/src/native_directory_stats.rs
  • Cyclomatic Complexity · LinkDesktopSettingsPage.build (cyclomatic 19) lib/screens/settings/link_desktop_settings_page.dart
  • Cyclomatic Complexity · SoundAutoplaySignal.prepare (cyclomatic 19) lib/services/autoplay_sound_signal.dart
  • Cyclomatic Complexity · ExtensionStorageService.setUnsecuredStorage (cyclomatic 19) lib/services/extension_storage_service.dart
  • Cyclomatic Complexity · LinkDownloadUpdates._drain (cyclomatic 19) lib/services/link/desktop/link_downloads.dart
  • Cyclomatic Complexity · LinkPhoneSources.onMessage (cyclomatic 19) lib/services/link/desktop/link_phone_sources.dart
  • Cyclomatic Complexity · _MusicCast._changed (cyclomatic 19) lib/services/music_player_cast.dart
  • Cyclomatic Complexity · _MusicGapless.handoff (cyclomatic 19) lib/services/music_player_gapless.dart
  • Cyclomatic Complexity · NetworkMetadataService._load (cyclomatic 19) lib/services/network_metadata_service.dart
  • Cyclomatic Complexity · HeaderCircleButton.build (cyclomatic 19) lib/widgets/album_detail_header.dart
  • Cyclomatic Complexity · mornye_link::ws::session (cyclomatic 19) rust_backend/crates/link/src/ws.rs
  • Cyclomatic Complexity · NetworkPermissions::validate_with_grants (cyclomatic 19) rust_backend/crates/network/src/policy.rs
  • Cyclomatic Complexity · _SetupScreenState.build (cyclomatic 18) lib/screens/setup_screen.dart
  • Cyclomatic Complexity · _EditMetadataSheetState._save (cyclomatic 18) lib/screens/track_metadata_edit_sheet.dart
  • Cyclomatic Complexity · LastfmService._flush (cyclomatic 18) lib/services/lastfm/lastfm_service.dart
  • Cyclomatic Complexity · LinkClientController._onDiscoveryChanged (cyclomatic 18) lib/services/link/client/link_client_controller.dart
  • Cyclomatic Complexity · LinkCollectionSyncStore._write (cyclomatic 18) lib/services/link/sync/link_collection_sync_store.dart
  • Cyclomatic Complexity · LinkHistoryArtwork._apply (cyclomatic 18) lib/services/link/sync/link_history_artwork.dart
  • Cyclomatic Complexity · AudioplayersPlaybackDeck.refreshNativeStatus (cyclomatic 18) lib/services/music_playback_deck.dart
  • Cyclomatic Complexity · MusicPlayerHandler._resolveSource (cyclomatic 18) lib/services/music_player_service.dart
  • Cyclomatic Complexity · _LibrarySearchResultsState._tile (cyclomatic 18) lib/widgets/library_search_results.dart
  • Cyclomatic Complexity · _LyricsOptionsButtonState._buildButton (cyclomatic 18) lib/widgets/lyrics_options_button.dart
  • Cyclomatic Complexity · _PlaybackFeedbackState.initState (cyclomatic 18) lib/widgets/playback_feedback.dart
  • Cyclomatic Complexity · _SearchCoverCell.build (cyclomatic 17) lib/screens/home_tab_search_wide.dart
  • Cyclomatic Complexity · _LibraryTracksFolderScreenState._showEntryMenu (cyclomatic 17) lib/screens/library_tracks_folder_screen.dart
  • Cyclomatic Complexity · _NetworkConnectionFormState._save (cyclomatic 17) lib/screens/network_storage_screen.dart
  • Cyclomatic Complexity · _WhatsNewScreenState.build (cyclomatic 17) lib/screens/whats_new_screen.dart
  • Cyclomatic Complexity · FFmpegMetadataInput.prepare (cyclomatic 17) lib/services/ffmpeg_metadata_input.dart
  • Cyclomatic Complexity · _MixBuilder._index (cyclomatic 17) lib/services/library_mixes.dart
  • Cyclomatic Complexity · LinkArrivingFiles._serve (cyclomatic 17) lib/services/link/desktop/link_arriving_files.dart
  • Cyclomatic Complexity · LinkPhoneCatalogs._addCovers (cyclomatic 17) lib/services/link/desktop/link_phone_catalogs.dart
  • Cyclomatic Complexity · LinkTrackResolver.resolve (cyclomatic 17) lib/services/link/features/link_track_resolver.dart
  • Cyclomatic Complexity · LinkPhoneSong.toJson (cyclomatic 17) lib/services/link/link_protocol.dart
  • Cyclomatic Complexity · LinkCollectionSyncStore.apply (cyclomatic 17) lib/services/link/sync/link_collection_sync_store.dart
  • Cyclomatic Complexity · MediaKitPlaybackDeck.queueNextSource (cyclomatic 17) lib/services/media_kit_playback_deck.dart
  • Cyclomatic Complexity · _MusicFailures.skipMissing (cyclomatic 17) lib/services/music_player_failures.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: 383 findings

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

  • Cyclomatic Complexity · MainActivity.configureFlutterEngine (cyclomatic 85) android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt
  • Cyclomatic Complexity · _LibrarySearchResultsState.build (cyclomatic 34) lib/widgets/library_search_results.dart
  • Cyclomatic Complexity · MetadataPersistenceService.save (cyclomatic 22) lib/services/metadata_persistence_service.dart
  • Cyclomatic Complexity · check_backend_ios.audit (cyclomatic 21) scripts/check_backend_ios.py
  • Cyclomatic Complexity · PlaybackController._resolveTrackPaths (cyclomatic 20) lib/providers/playback_provider.dart
  • Cyclomatic Complexity · SettingsGroup.build (cyclomatic 19) lib/widgets/settings_group.dart
  • Cyclomatic Complexity · AppIconButton.build (cyclomatic 17) lib/widgets/app_icon_button.dart
  • Cyclomatic Complexity · PlayerPlaybackModeButton.build (cyclomatic 17) lib/widgets/player_playback_controls.dart
  • Cyclomatic Complexity · LibraryTrackSelectionBar.build (cyclomatic 16) lib/widgets/library_track_selection_bar.dart
  • Cyclomatic Complexity · NetworkPermissions::validate (cyclomatic 16) rust_backend/crates/network/src/policy.rs
  • Cognitive Complexity · _LibrarySearchResultsState.build (cognitive 67) lib/widgets/library_search_results.dart
  • Cognitive Complexity · MetadataPersistenceService.save (cognitive 42) lib/services/metadata_persistence_service.dart
  • Cognitive Complexity · PlaybackController._resolveTrackPaths (cognitive 32) lib/providers/playback_provider.dart
  • Cognitive Complexity · check_backend_ios.audit (cognitive 28) scripts/check_backend_ios.py
  • Cognitive Complexity · _NowPlayingScreenState._showLyricsOptions (cognitive 26) lib/screens/now_playing_screen.dart
  • Cognitive Complexity · SubsonicClient.catalog (cognitive 24) lib/services/network_storage_subsonic.dart
  • Cognitive Complexity · M3uPlaylistService.parseM3u (cognitive 23) lib/services/m3u_playlist_service.dart
  • Cognitive Complexity · LibrarySchema.migrateIosContainerPaths (cognitive 21) lib/services/library_schema.dart
  • Cognitive Complexity · SafCueScanKt.extractCueAudioFileName (cognitive 21) android/app/src/main/kotlin/com/zarz/mornye/SafCueScan.kt
  • Cognitive Complexity · _NowPlayingScreenState._goToCurrentAlbum (cognitive 20) lib/screens/now_playing_screen.dart
  • Cognitive Complexity · _TrackItemWithStatus._handleTap (cognitive 19) lib/screens/home_tab_widgets.dart
  • Cognitive Complexity · check_backend_apk.check_backend_markers (cognitive 19) scripts/check_backend_apk.py
  • Cognitive Complexity · NetworkPermissions::validate (cognitive 19) rust_backend/crates/network/src/policy.rs
  • Cognitive Complexity · UpdateChecker._fetchReleasesBody (cognitive 18) lib/services/update_checker.dart
  • Cognitive Complexity · check_backend_ios.check_main_arches (cognitive 18) scripts/check_backend_ios.py
  • Cognitive Complexity · MainActivityProgressStreamsKt.startDownloadProgressStream (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/MainActivityProgressStreams.kt
  • Cognitive Complexity · RustCoreBackend.readAudioMetadata (cognitive 17) android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt
  • Cognitive Complexity · prepare_discord_sdk.prepare (cognitive 17) scripts/prepare_discord_sdk.py
  • Cognitive Complexity · MusicPlayerHandler.onSourceDeleted (cognitive 16) lib/services/music_player_service.dart
  • God Classes · MethodTooLong: _DesktopMenuBar.build lib/widgets/desktop/desktop_shortcuts.dart
  • God Classes · MethodTooLong: _RailDestinationState.build lib/widgets/desktop/desktop_navigation.dart
  • God Classes · MethodTooLong: _LibrarySearchResultsState.build lib/widgets/library_search_results.dart
  • God Classes · ClassTooLong: _CacheManagementPageState lib/screens/settings/cache_management_page.dart
  • God Classes · ClassTooLong: _PlaylistScreenState lib/screens/playlist_screen.dart
  • God Classes · MethodTooLong: MetadataSettingsPage.build lib/screens/settings/metadata_settings_page.dart
  • God Classes · MethodTooLong: _LyricsShareScreenState.build lib/screens/lyrics_share_screen.dart
  • God Classes · ClassTooLong: _ExtensionDetailPageState lib/screens/settings/extension_detail_page.dart
  • God Classes · FileTooLong: settings/cache_management_page.dart lib/screens/settings/cache_management_page.dart
  • God Classes · MethodTooLong: _PlaylistScreenState._buildTrackList lib/screens/playlist_screen.dart
  • God Classes · MethodTooLong: SettingsGroup.build lib/widgets/settings_group.dart
  • Code Duplication · Near-duplicate member pair (61 shared lines) lib/services/library_queue_store.dart
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) lib/models/download_history.dart
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/screens/settings/cache_management_page.dart
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) rust_backend/crates/extensions/src/backend/cover.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/services/history_row_mapper.dart
  • Code Duplication · Duplicated block (49 lines × 2) lib/screens/downloaded_album_screen.dart
  • Code Duplication · Duplicated block (31–34 lines × 2) lib/services/library_queue_store.dart
  • Code Duplication · Duplicated block (26–27 lines × 2) lib/services/library_queue_store.dart
  • Code Duplication · Duplicated block (22 lines × 2) lib/screens/settings/extension_detail_page_widgets.dart
  • Code Duplication · Duplicated block (21 lines × 2) lib/screens/downloaded_album_screen.dart
  • Code Duplication · Duplicated block (21 lines × 2) lib/screens/downloaded_album_screen.dart
  • Code Duplication · Duplicated block (21 lines × 2) lib/services/library_queue_store.dart
  • Code Duplication · Duplicated block (19 lines × 2) lib/screens/settings/download_settings_page.dart
  • Code Duplication · Duplicated block (18 lines × 2) lib/services/library_queue_store.dart
  • Code Duplication · Duplicated block (16 lines × 2) lib/screens/settings/cache_management_page.dart
  • Code Duplication · Duplicated block (14–16 lines × 2) lib/widgets/mornye_player_queue.dart
  • Code Duplication · Duplicated block (15 lines × 2) lib/providers/download_history_provider.dart
  • Code Duplication · Duplicated block (15 lines × 2) lib/screens/downloaded_album_screen.dart
  • Code Duplication · Duplicated block (15 lines × 2) lib/screens/settings/download_settings_page.dart
  • Code Duplication · Duplicated block (15 lines × 2) lib/services/library_queue_store.dart
  • Code Duplication · Duplicated block (14–15 lines × 2) lib/widgets/desktop/desktop_mini_player.dart
  • Code Duplication · Duplicated block (15 lines × 2) lib/widgets/download_service_picker.dart
  • Code Duplication · Duplicated block (14 lines × 2) lib/models/unified_library_item.dart
  • Code Duplication · Duplicated block (13–14 lines × 2) lib/screens/repo_tab.dart
  • Code Duplication · Duplicated block (14 lines × 2) lib/screens/settings/files_settings_page.dart
  • Code Duplication · Duplicated block (14 lines × 2) lib/screens/settings/library_settings_page.dart
  • Code Duplication · Duplicated block (14 lines × 2) lib/services/library_queue_store.dart
  • Code Duplication · Duplicated block (8–13 lines × 2) lib/models/settings.dart
  • Code Duplication · Duplicated block (13 lines × 2) lib/services/library_schema.dart
  • Code Duplication · Duplicated block (12 lines × 2) lib/screens/settings/download_settings_page.dart
  • Code Duplication · Duplicated block (12 lines × 2) lib/services/library_ingestion_store.dart
  • Code Duplication · Duplicated block (10–11 lines × 3) lib/models/download_item.dart
  • Code Duplication · Duplicated block (11 lines × 2) lib/services/history_database.dart
  • Code Duplication · Duplicated block (10 lines × 5) lib/screens/settings/cache_management_page.dart
  • Code Duplication · Duplicated block (10 lines × 3) lib/screens/settings/library_settings_page.dart
  • Code Duplication · Duplicated block (10 lines × 2) lib/screens/settings/lyrics_provider_priority_page.dart
  • Code Duplication · Duplicated block (10 lines × 2) lib/services/history_database.dart
  • Code Duplication · Duplicated block (9 lines × 6) lib/models/download_history.dart
  • Code Duplication · Duplicated block (9 lines × 2) lib/providers/download_history_provider.dart
  • Code Duplication · Duplicated block (9 lines × 2) lib/screens/setup_screen.dart
  • Code Duplication · Duplicated block (9 lines × 2) lib/widgets/desktop/track_table.dart
  • Code Duplication · Duplicated block (8 lines × 7) lib/models/download_history.dart
  • Code Duplication · Duplicated block (8 lines × 2) lib/models/settings.dart
  • Code Duplication · Duplicated block (7–8 lines × 2) lib/services/history_row_mapper.dart
  • Code Duplication · Duplicated block (8 lines × 2) lib/widgets/animation_utils.dart
  • Code Duplication · Duplicated block (7 lines × 2) lib/screens/album_screen.dart
  • Code Duplication · Duplicated block (5 lines × 2) lib/models/extension.dart
  • Code Duplication · Duplicated block (5 lines × 2) lib/screens/track_metadata_screen.dart
  • Code Duplication · Duplicated block (6 lines × 2) lib/services/media_session_mpris.dart
  • Code Duplication · Duplicated block (7 lines × 2) lib/widgets/desktop/desktop_inspector.dart
  • Code Duplication · Duplicated block (21 lines × 2) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt
  • Code Duplication · Duplicated block (11 lines × 2) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2) REDACTED
  • Code Duplication · Duplicated block (5 lines × 2) android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt
  • Code Duplication · Duplicated block (5 lines × 2) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt
  • Code Duplication · Duplicated block (11 lines × 2) rust_backend/crates/extensions/src/backend/cover.rs
  • Code Duplication · Duplicated block (10 lines × 6) rust_backend/crates/extensions/src/backend/cover.rs
Rebuild cost: about €620,000 · Estimate
Cost to rebuild€210,000 to €1,000,000, for 3,437 to 10,903 hours of work, about 4.3 person-years for 2 to 9 engineers
Difficulty of the problemLow, 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.9 at a score of 66. 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.
SizeLarge: 359,024 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
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 2 points · Low effort · ADR Quality
2
Thread a CancelToken through functions that make requests, so the work stops when its caller gives up.
Raises the score by about 2 points · Medium effort · Cancellation propagation
3
Swallowed exception (empty catch)
Raises the score by about 2 points · Medium effort · Exception handling

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 €620,000 to build again, about 4.3 person-years of work. Its weakest lens is Code Health, at 62 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 2 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 771,204 lines over the last 90 days, which is about 3,127,661 lines a year. At that pace, the extra work comes to an estimated 336.9 to 2021.2 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 android android android:app android:app audioplayers_android audioplayers_android audioplayers_darwin audioplayers_darwin ffmpeg-kit-flutter-android ffmpeg-kit-flutter-android ffmpeg_kit_flutter_new_audio ffmpeg_kit_flutter_new_audio ffmpeg_kit_flutter_new_audio (third_party/ffmpeg_kit_flutter_new_audio/ios/ffmpeg_kit_flutter_new_audio) ffmpeg_kit_flutter_new_audio) ffmpeg_kit_flutter_new_audio (third_party/ffmpeg_kit_flutter_new_audio/macos/ffmpeg_kit_flutter_new_audio) ffmpeg_kit_flutter_new_audio) mornye mornye mornye->ffmpeg_kit_flutter_new_audio mornye_discord mornye_discord mornye->mornye_discord mornye-cast mornye-cast mornye-network mornye-network mornye-cast->mornye-network mornye-core mornye-core mornye-desktop mornye-desktop mornye-desktop->mornye-cast mornye-link mornye-link mornye-desktop->mornye-link mornye-mobile mornye-mobile mornye-desktop->mornye-mobile mornye-extensions mornye-extensions mornye-extensions->mornye-core mornye-extensions->mornye-network mornye-providers mornye-providers mornye-extensions->mornye-providers mornye-link->mornye-core mornye-mobile->mornye-cast mornye-mobile->mornye-core mornye-mobile->mornye-extensions mornye-mobile->mornye-network mornye-mobile->mornye-providers mornye-providers->mornye-core mornye-providers->mornye-network mornye_audio mornye_audio mornye_flac mornye_flac mornye_audio->mornye_flac __more__ +1 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.

725 modules, with 1058 dependencies between them. 16 loops run through 53 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 685 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 cap_primitives.fs.follow_symlinks2 cap_primitives.fs.permissions3 com.zarz.mornye4 mornye_core.app_version5 mornye_core.json6 mornye_extensions.files7 mornye_link.types8 mornye_mobile.cancellation9 mornye_network.client10 mornye_providers.deezer.cache11 mornye_providers.lyrics.service12 rustix.backend.libc.fs.types13 rustix.clockid14 rustix.maybe_polyfill.no_std.os.fd.owned15 rustix.pid16 rustix.signal17 rustix.timespec18 rustix.ugid19 cap_primitives.fs.metadata20 cap_primitives.fs.open_options21 mornye_core.cancellation22 mornye_core.resolver23 mornye_desktop.runtime24 mornye_extensions.auth25 mornye_extensions.runtime.control26 rustix.backend.libc.process.syscalls27 rustix.backend.libc.thread.syscalls28 rustix.backend.linux_raw.fs.syscalls29 rustix.backend.linux_raw.process.syscalls30 rustix.backend.linux_raw.thread.syscalls31 rustix.io_uring32 rustix.net.types33 mornye_core.downloads34 mornye_extensions.manifest35 rustix.backend.linux_raw.reg36 rustix.net.socket_addr_any37 mornye_extensions.runtime38 mornye_extensions.environment39 mornye_extensions.manager40 mornye_extensions.backend
1 cap_primitives.fs.follow_symlinks
2 cap_primitives.fs.permissions
3 com.zarz.mornye
4 mornye_core.app_version
5 mornye_core.json
6 mornye_extensions.files
7 mornye_link.types
8 mornye_mobile.cancellation
9 mornye_network.client
10 mornye_providers.deezer.cache
11 mornye_providers.lyrics.service
12 rustix.backend.libc.fs.types
13 rustix.clockid
14 rustix.maybe_polyfill.no_std.os.fd.owned
15 rustix.pid
16 rustix.signal
17 rustix.timespec
18 rustix.ugid
19 cap_primitives.fs.metadata1
20 cap_primitives.fs.open_options1
21 mornye_core.cancellation2
22 mornye_core.resolver13
23 mornye_desktop.runtime1
24 mornye_extensions.auth1
25 mornye_extensions.runtime.control1
26 rustix.backend.libc.process.syscalls11111
27 rustix.backend.libc.thread.syscalls11112
28 rustix.backend.linux_raw.fs.syscalls1312
29 rustix.backend.linux_raw.process.syscalls11111
30 rustix.backend.linux_raw.thread.syscalls11112
31 rustix.io_uring12
32 rustix.net.types12
33 mornye_core.downloads11
34 mornye_extensions.manifest21
35 rustix.backend.linux_raw.reg91111214
36 rustix.net.socket_addr_any1
37 mornye_extensions.runtime11231121
38 mornye_extensions.environment11121112113
39 mornye_extensions.manager111142
40 mornye_extensions.backend211111111
Uses a module listed above itPart of a loopThe module itself
1 cap_primitives.fs.follow_symlinks2 cap_primitives.fs.permissions3 com.zarz.mornye4 mornye_core.app_version5 mornye_core.json6 mornye_extensions.files7 mornye_link.types8 mornye_mobile.cancellation9 mornye_network.client10 mornye_providers.deezer.cache11 mornye_providers.lyrics.service12 rustix.backend.libc.fs.types13 rustix.clockid14 rustix.maybe_polyfill.no_std.os.fd.owned15 rustix.pid16 rustix.signal17 rustix.timespec18 rustix.ugid19 cap_primitives.fs.metadata20 cap_primitives.fs.open_options21 mornye_core.cancellation22 mornye_core.resolver23 mornye_desktop.runtime24 mornye_extensions.auth25 mornye_extensions.runtime.control26 rustix.backend.libc.process.syscalls27 rustix.backend.libc.thread.syscalls28 rustix.backend.linux_raw.fs.syscalls29 rustix.backend.linux_raw.process.syscalls30 rustix.backend.linux_raw.thread.syscalls31 rustix.io_uring32 rustix.net.types33 mornye_core.downloads34 mornye_extensions.manifest35 rustix.backend.linux_raw.reg36 rustix.net.socket_addr_any37 mornye_extensions.runtime38 mornye_extensions.environment39 mornye_extensions.manager40 mornye_extensions.backendcap_primitives.fs.follow_symlinks1cap_primitives.fs.permissions2com.zarz.mornye3mornye_core.app_version4mornye_core.json5mornye_extensions.files6mornye_link.types7mornye_mobile.cancellation8mornye_network.client9mornye_providers.deezer.cache10mornye_providers.lyrics.service11rustix.backend.libc.fs.types12rustix.clockid13rustix.maybe_polyfill.no_std.os.fd.owned14rustix.pid15rustix.signal16rustix.timespec17rustix.ugid18cap_primitives.fs.metadata19cap_primitives.fs.open_options20mornye_core.cancellation21mornye_core.resolver22mornye_desktop.runtime23mornye_extensions.auth24mornye_extensions.runtime.control25rustix.backend.libc.process.syscalls26rustix.backend.libc.thread.syscalls27rustix.backend.linux_raw.fs.syscalls28rustix.backend.linux_raw.process.syscalls29rustix.backend.linux_raw.thread.syscalls30rustix.io_uring31rustix.net.types32mornye_core.downloads33mornye_extensions.manifest34rustix.backend.linux_raw.reg35rustix.net.socket_addr_any36mornye_extensions.runtime37mornye_extensions.environment38mornye_extensions.manager39mornye_extensions.backend4011213111111111111213121111111112121211219111121411123112111121112113111142211111111+685 more modules (most-connected shown)

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

At a glance — Architecture · 86% · Strong ·

At a glance — Maturity · 68% · Adequate · gated by M2 ·

At a glance — Readiness · 64% · Adequate ·

At a glance — Security · 68% · Checked 4 of 10 · gated by D29 ·

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

At a glance — Performance · 89% · 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
A05:2025 — Injection9High / Critical
A03:2025 — Software Supply Chain Failures5Medium
A07:2025 — Authentication Failures2High / Critical

Roadmap

Top priorities: Thread a CancelToken through functions that make requests, so the work stops when its caller gives up; Swallowed exception (empty catch); Resolve the 1 No ADRs found finding(s) in ADR Quality.

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

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.+1.8 ptsLowADR Quality
Thread a CancelToken through functions that make requests, so the work stops when its caller gives up.+2.3 ptsMediumCancellation propagation
Swallowed exception (empty catch)+2.1 ptsMediumException handling
Bring the 55 bodies over 60 down to 60 or less in Cognitive Complexity — start with _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cognitive 278), NetworkLibraryScanner._scan (cognitive 209), _MusicAutoMix._start (cognitive 168).+1.7 ptsHighCognitive Complexity
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+1.6 ptsMediumArchitecture documentation
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+1.4 ptsMediumDR & Backup
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+1.2 ptsMediumDeployment & Rollback
Resolve the 153 MethodTooLong finding(s) in God Classes — start with download_queue_provider_single_item.dart (4), settings_tab.dart (3), library_tracks_folder_screen.dart (3).+1.1 ptsHighGod Classes

File quality

Per-file score 0–10 — a quality signature. Of 559 files carrying findings, judged against the Production bar: 1% slop · 73% mixed · 26% near-clean.

FileScoreBandWorst signal
lib/screens/queue_tab.dart2.6SlopChange Coupling: Boundary-crossing change coupling: queue_tab.dart ↔ audio_conversion_utils.dart
lib/screens/album_screen.dart3.5SlopChange Coupling: Boundary-crossing change coupling: album_screen.dart ↔ track_collection_quick_actions.dart
lib/screens/downloaded_album_screen.dart3.5SlopChange Coupling: Boundary-crossing change coupling: downloaded_album_screen.dart ↔ audio_conversion_utils.dart
lib/providers/download_queue_state.dart4.8MixedCyclomatic Complexity: DownloadQueueLookup.withoutIndex (cyclomatic 20)
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
lib/screens/now_playing_screen.dart5.0MixedChange Coupling: Boundary-crossing change coupling: now_playing_screen.dart ↔ mornye_landscape_player.dart
lib/screens/local_album_screen.dart5.1MixedChange Coupling: Boundary-crossing change coupling: local_album_screen.dart ↔ audio_conversion_utils.dart
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
lib/screens/home_tab.dart5.5MixedCyclomatic Complexity: _HomeTabState.build (cyclomatic 100)
lib/widgets/player_lyrics.dart5.5MixedCyclomatic Complexity: _SyncedLyricsViewState._buildLyrics (cyclomatic 82)
lib/providers/download_queue_provider.dart5.5MixedCyclomatic Complexity: DownloadQueueNotifier._processQueueSingleFlight (cyclomatic 74)
lib/screens/settings/library_settings_page.dart5.5MixedCyclomatic Complexity: _LibrarySettingsPageState.build (cyclomatic 50)
lib/services/backup_service.dart5.5MixedCyclomatic Complexity: BackupService._parseArchive (cyclomatic 35)
lib/screens/main_shell.dart5.5MixedCyclomatic Complexity: _MainShellState._handleBackPress (cyclomatic 25)
lib/services/library_collections_database.dart5.5MixedCyclomatic Complexity: LibraryCollectionsDatabase.replaceDatabaseFromBackup (cyclomatic 19)
lib/providers/extension_provider.dart5.5MixedCyclomatic Complexity: ExtensionNotifier.restoreFromBackup (cyclomatic 18)
lib/services/media_kit_playback_deck.dart5.5MixedCyclomatic Complexity: MediaKitPlaybackDeck.queueNextSource (cyclomatic 17)
lib/services/history_database.dart5.5MixedCognitive Complexity: HistoryDatabase.findExistingTracks (cognitive 23)
lib/services/app_state_database.dart5.5MixedCyclomatic Complexity: AppStateDatabase.migrateRecentAccessFromSharedPreferences (cyclomatic 19)
lib/providers/track_provider.dart5.5MixedCyclomatic Complexity: TrackNotifier.fetchFromUrl (cyclomatic 38)

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

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

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

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

Could not be resolved — 17

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 60 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, 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 — 60 dimensions across the health lenses
D1D2D3D4D5D6D13D14D15D19D20D26D28D29D30D34D35D36D43D44AX1AX10AX3AX5AX8AX9DM5GD1IC1M1M2M3M4P1P10P2P3P4P5P6PF1PF3X1X12X13X14X15X16X17X18X2X21X23X25X27X28X29X3X30X5

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, 2369 of 2382 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1cdc2-7612-7ac9-8139-beb04f7b8154.

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: test source is present (.dart, .rs, .kt) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `flutter test --coverage` (or `dart test --coverage=coverage` then `dart run coverage:format_coverage --lcov`), or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `flutter test --coverage` (or `dart test --coverage=coverage` then `dart run coverage:format_coverage --lcov`), or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.dart, .rs, .kt) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • 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 — 6 Maven/Gradle manifest(s) were read, stating a version for 21 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Cargo manifest, but the licence verdict published here was taken over its pub package dependencies. Nothing was read about its Cargo dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its pub package dependencies. Nothing was read about its Gradle dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For rust_backend/crates/extensions/src/repository/model.rs, rust_backend/crates/extensions/src/manifest.rs, rust_backend/crates/core/src/metadata/reenrich.rs, rust_backend/crates/core/src/metadata/deezer.rs, rust_backend/crates/core/src/lyrics/payloads.rs, … that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (18 contributor(s) across 4287 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 17 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming 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. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — 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 — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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. `android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt`, `ios/Runner/LinkNowPlayingBridge.swift` 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.
  • 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.
  • AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: a native UI project (pubspec.yaml). The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • 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.
  • 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.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X12 Unreachable branch — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X13 Undrained process stream — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X16 Unfloored truncation loop — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X17 Uncapped recursion over a caller-supplied document — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X18 Disposal-pattern correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X23 Unguarded diagnostic materialisation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X25 Inert configuration knob — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X26 Unsynchronised callback handoff — 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 292 further occurrence(s) are not listed individually; the score already reflects all 332.

Repo exclusion declarations: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

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.
  • 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.
  • 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.
  • 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.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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.9 / 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.9 / 10 · rule-coverage 100% · ceiling Prevented

453 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile at 154. A further 20 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 DownloadRequest::update at 108 — 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: rust_backend/crates/core/src/downloads.rs (DownloadRequest::update at 108), android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt (MainActivity.configureFlutterEngine at 89), rust_backend/crates/core/src/metadata/deezer/catalog.rs (FullAlbum::update at 32), rust_backend/crates/core/src/metadata/deezer.rs (Track::update at 30), rust_backend/crates/mobile/src/data_jobs.rs (mornye_mobile::data_jobs::execute 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.

mornye_core::tags::write::id3::read_frames (cyclomatic 58) · ×34rust_backend/crates/core/src/tags/write/id3.rs:220
mornye_mobile::native_autoplay_taste::execute (cyclomatic 42) · ×13rust_backend/crates/mobile/src/native_autoplay_taste.rs:99
mornye_extensions::download::chunked::download (cyclomatic 51) · ×12rust_backend/crates/extensions/src/download/chunked.rs:14
Backend::plan_download (cyclomatic 50) · ×7rust_backend/crates/extensions/src/backend/downloads.rs:168
(anonymous)::filenameMetadata::visit (cyclomatic 36) · ×4rust_backend/crates/extensions/src/prelude.js:566

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cyclomatic 154). — Refactoring it lifts Cyclomatic Complexity from 3.9 to about 4.4/10.

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

750 method(s) exceeded the cognitive complexity threshold of 15; the worst was _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile at 278.

mornye_core::tags::write::id3::read_frames (cognitive 94) · ×56rust_backend/crates/core/src/tags/write/id3.rs:220
mornye_extensions::download::chunked::download (cognitive 96) · ×25rust_backend/crates/extensions/src/download/chunked.rs:14
mornye_mobile::native_autoplay_taste::execute (cognitive 92) · ×24rust_backend/crates/mobile/src/native_autoplay_taste.rs:99
Backend::plan_download (cognitive 90) · ×15rust_backend/crates/extensions/src/backend/downloads.rs:168
ExtensionManager::provider_operation_value (cognitive 77) · ×4rust_backend/crates/extensions/src/manager/providers.rs:206

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

What to do

  1. Bring the 55 bodies over 60 down to 60 or less in Cognitive Complexity — start with _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cognitive 278), NetworkLibraryScanner._scan (cognitive 209), _MusicAutoMix._start (cognitive 168). — 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 55 together lifts Cognitive Complexity from 2.0 to about 4.0/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes7.0 / 10Adequate✓ Tool-verified

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

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

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

402 god class(es) detected.

MethodTooLong: _PlaybackSettingsPageState.build · ×153lib/screens/settings/playback_settings_page.dart:148
FileTooLong: services/music_player_service.dart · ×120lib/services/music_player_service.dart
ClassTooLong: PlatformBridge · ×63lib/services/platform_bridge.dart:74
TooManyMethods: PlatformBridge · ×40lib/services/platform_bridge.dart:74
FunctionTooLong: mornye_extensions::download::chunked::download · ×24rust_backend/crates/extensions/src/download/chunked.rs:14

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

What to do

  1. Resolve the 153 MethodTooLong finding(s) in God Classes — start with download_queue_provider_single_item.dart (4), settings_tab.dart (3), library_tracks_folder_screen.dart (3). — One of this dimension's main actionable groups (153 warning-level).
  2. Resolve the 120 FileTooLong finding(s) in God Classes — start with music_player_service.dart, platform_bridge.dart, download_queue_provider_single_item.dart. — One of this dimension's main actionable groups (120 warning-level).
  3. Resolve the 63 ClassTooLong finding(s) in God Classes — start with platform_bridge.dart, music_player_service.dart, download_queue_provider_single_item.dart. — One of this dimension's main actionable groups (63 warning-level).

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

D4 · Code Duplication9.8 / 10Stronggated by 383 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

161 duplicated block group(s) detected. A further 222 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 383 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Edited copy of a member (8 corresponding lines) · ×17lib/services/network_storage_service.dart:434
Duplicated block (7 lines × 2) · ×17lib/models/extension.dart:269
Edited copy of a member (13 corresponding lines) · ×16rust_backend/crates/mobile/src/native_backup/legacy.rs:46
Duplicated block (10 lines × 2) · ×16lib/providers/track_provider.dart:412
Duplicated block (8 lines × 2) · ×14lib/providers/download_history_provider.dart:739

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

What to do

  1. Resolve the 17 Edited copy of a member (8 corresponding lines) finding(s) in Code Duplication — start with network_storage_service.dart, track_collection_quick_actions.dart, library_tracks_folder_screen.dart. — One of this dimension's main actionable groups (17 warning-level).
  2. Resolve the 17 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with extension.dart, artist_screen.dart, history_row_mapper.dart. — One of this dimension's main actionable groups (17 warning-level).
  3. Resolve the 16 Edited copy of a member (13 corresponding lines) finding(s) in Code Duplication — start with platform_bridge.dart (2), legacy.rs, animation_utils.dart. — One of this dimension's main actionable groups (16 warning-level).

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

D5 · Coupling8.8 / 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 8.8 / 10 · rule-coverage 100% · ceiling Prevented

21 production modules (Gradle+Cargo+SwiftPM+pub+CMake), 0 dependency cycle(s), 1 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; 2 module(s) off the main sequence, with abstractness counted on 10 of the 21 (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: mornye-core · ×2
Unstable project mornye-mobile

What to do

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

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

D6 · Cohesion (LCOM4)9.4 / 10Stronggated by 36 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.4 / 10 · rule-coverage 100% · ceiling Verified

36 of 732 classes have LCOM4 above 3.

Low cohesion: LibraryCollectionsDatabase (LCOM4 25) · ×36lib/services/library_collections_database.dart:78

What to do

  1. Resolve the 36 Low cohesion finding(s) in Cohesion (LCOM4) — start with download_queue_state.dart (2), library_collections_database.dart, library_database.dart. — One of this dimension's main actionable groups (36 warning-level).

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

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.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 222 resolved pub package(s) use a banned license. Licences were read from pub.dev's analysis of each package's licence file, over every package this repository's pubspec.lock resolves from pub.dev, direct and transitive, at the locked version; the 9 package(s) the lock marks direct dev are excluded, and SDK, path and git packages have no registry release to read. pub.dev analyses only recent releases, so for 21 package(s) locked at an older version the licence read is that of the package's latest analysed release, not of the locked one. 1 of them carry no licence pub.dev recognises; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's pub package dependencies and nothing else. The repository also declares a Cargo manifest and a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.3 / 10Stronggated by 222 serious findings✓ 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.3 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: lib/screens/now_playing_screen.dart (103×97=9991); lib/screens/home_tab.dart (74×100=7400); android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt (80×89=7120) Repeated repair below the complexity floor: lib/services/notification_service.dart (7 of 13 changes were fixes); lib/services/link/sync/link_sync_protocol.dart (5 of 8 changes were fixes); lib/services/library_native_adapter.dart (4 of 7 changes were fixes)

Hotspot: lib/screens/now_playing_screen.dart · ×204lib/screens/now_playing_screen.dart:311
Repeated repair: lib/services/notification_service.dart · ×18lib/services/notification_service.dart:310

What to do

  1. Resolve the 204 Hotspot finding(s) in Churn × Complexity Hotspots — start with downloads.rs (2), reenrich.rs (2), now_playing_screen.dart. — One of this dimension's main actionable groups (204 warning-level).
  2. Resolve the 18 Repeated repair finding(s) in Churn × Complexity Hotspots — start with notification_service.dart, link_sync_protocol.dart, library_native_adapter.dart. — One of this dimension's main actionable groups (18 warning-level).

Detailed fixes: d15_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

1 of 1 documentation facets pass in full. 14 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D26 · Project Cohesion5.8 / 10Adequate✓ 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 5.8 / 10 · rule-coverage 100% · ceiling Documented

4 of 19 build units (Cargo, Gradle, SwiftPM, Xcode, 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)3.0 / 10Weak✓ 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 3.0 / 10 · rule-coverage 100% · ceiling Documented

9 finding(s): 0 critical, 6 high, 3 medium, 0 low. semgrep hit a parse error in 15 file(s) — `android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt` (line 210), `third_party/ffmpeg_kit_flutter_new_audio/android/gradlew` (line 72, line 178), `third_party/ffmpeg_kit_flutter_new_audio/ios/ffmpeg_kit_flutter_new_audio/Sources/ffmpeg_kit_flutter_new_audio/include/ffmpeg_kit_flutter_new_audio/FFmpegKitFlutterPlugin.h` (line 22, lines 22–23), `third_party/ffmpeg_kit_flutter_new_audio/macos/ffmpeg_kit_flutter_new_audio/Sources/ffmpeg_kit_flutter_new_audio/include/ffmpeg_kit_flutter_new_audio/FFmpegKitFlutterPlugin.h` (line 22, lines 22–23), `third_party/ffmpeg_kit_flutter_new_audio/windows/src/ffmpegkit_c_api.h` (line 26, line 27, line 28, …), … (+10 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 2 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

What to do

  1. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D30 · Dependency Vulnerabilities9.6 / 10Stronggated by 2 serious findings✓ 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 9.6 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 0 high, 2 medium, 0 low.

REDACTED

What to do

  1. Resolve the 2 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

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

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

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

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

Strongest change-coupling: now_playing_screen.dart↔mornye_landscape_player.dart 77%; album_screen.dart↔playlist_screen.dart 77%; downloaded_album_screen.dart↔local_album_screen.dart 71%

Boundary-crossing change coupling: now_playing_screen.dart ↔ mornye_landscape_player.dart · ×7lib/screens/now_playing_screen.dart:1
Change coupling: album_screen.dart ↔ playlist_screen.dart · ×9lib/screens/album_screen.dart:1
Change coupling clique: settings.dart, playback_settings_page.dart, settings_search_catalog.dartlib/models/settings.dart

What to do

  1. Resolve the 7 Boundary-crossing change coupling finding(s) in Change Coupling — start with queue_tab.dart (2), now_playing_screen.dart, MainActivity.kt. — One of this dimension's main actionable groups (7 issue-level).
  2. Resolve the 9 Change coupling finding(s) in Change Coupling — start with album_screen.dart, downloaded_album_screen.dart, download_settings_page.dart. — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with settings.dart. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

2/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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 7 platform declaration(s) and 21 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.

AX1 · Captive dependencies6.8 / 10Adequate✓ 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.

  • `linkRemotePlaybackProvider` is a keep-alive Riverpod provider and calls `ref.read(linkDesktopRemoteProvider…)`, which is declared auto-dispose (lib/services/link/features/link_desktop_remote.dart:376). Read in build, `linkDesktopRemoteProvider` has no listener once the read returns, so it is disposed at once — its ref.onDispose closes what it handed out — while `linkRemotePlaybackProvider` keeps that value for the life of the ProviderContainer. Mark `linkDesktopRemoteProvider` keepAlive too, make `linkRemotePlaybackProvider` auto-dispose, or read it per use outside build. (×4) — lib/services/link/features/link_remote_playback.dart:150, lib/services/link/features/link_remote_playback.dart:177, lib/services/link/features/link_remote_playback.dart:201, …
  • `linkRemotePlaybackProvider` is a keep-alive Riverpod provider and calls `ref.listen(linkDesktopRemoteProvider…)`, which is declared auto-dispose (lib/services/link/features/link_desktop_remote.dart:376). The keep-alive provider listens to it for the life of the ProviderContainer, so `linkDesktopRemoteProvider` 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 `linkDesktopRemoteProvider` keepAlive too, make `linkRemotePlaybackProvider` auto-dispose, or read it per use outside build. — lib/services/link/features/link_remote_playback.dart:173
  • `libraryMixesProvider` is a keep-alive Riverpod provider and calls `ref.watch(libraryCountsProvider…)`, which is declared auto-dispose (lib/providers/library_counts_provider.dart:75). The keep-alive provider listens to it for the life of the ProviderContainer, so `libraryCountsProvider` 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 `libraryCountsProvider` keepAlive too, make `libraryMixesProvider` auto-dispose, or read it per use outside build. — lib/providers/library_mixes_provider.dart:164

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

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

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

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

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.

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

Other · Domain Modelling — Whether an entity protects its own invariants — a class whose identity is derived from its fields (value equality) but whose fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.

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.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Dart: methods whose whole body still throws UnimplementedError or a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Dart: methods that only throw UnimplementedError or a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

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

What to do

  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Describe the projects a newcomer cannot place from the root README: 9 of 12 have no README of their own, in their folder or in their family's project (`rust_backend/crates/bindgen`, `rust_backend/crates/cast`, `rust_backend/crates/core`, `rust_backend/crates/desktop`, `rust_backend/crates/extensions` and 4 more).
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 · Observability6.5 / 10Adequate✓ 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 4/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `macos`, `rust_backend/crates/bindgen`, `rust_backend/crates/cast`, `rust_backend/crates/network`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add OpenTelemetry tracing/metrics (the opentelemetry package) so requests are traceable across the system, not just health-probable.
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 & Rollback5.0 / 10Adequate✓ 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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P5 · DR & Backup4.0 / 10Weak✓ 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.

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 hygiene10.0 / 10Exemplary✓ 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.

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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification6.1 / 10Adequate✓ Tool-verified

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

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

  • This function unwraps IPv4-MAPPED IPv6 (`[10] == 0xff`, line 86) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 84 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright. — lib/services/local_network_access.dart:84

What to do

  • Each finding names the IPv4 branch that rejects the host and the IPv6 branch that accepts the same host in another notation. Confirm from the two, then unwrap every IPv4-in-IPv6 embedding before classifying, or reject non-native IPv6 outright.
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.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document2.7 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `coverUrl` is public, takes a document from its caller (line 531) and hands it to `fromValue`, which calls itself at line 539 (`fromValue`) with a piece of `value` (and at line 545) — and nowhere in `fromValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `fromValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/services/metadata_autofill_service.dart:539
  • `customSearchWithExtension` is public, takes a document from its caller (line 2226) and hands it to `_canonicalizeJsonLike`, which calls itself at line 740 (`_canonicalizeJsonLike`) with a piece of `value` (and at line 744) — and nowhere in `_canonicalizeJsonLike` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_canonicalizeJsonLike` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/services/platform_bridge.dart:740

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on 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 0/1 functions that make a cancellable request (Dio, AbortableRequest) accept a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a screen navigated away from, a disposed widget, a superseded search. Take a `CancelToken? cancelToken` and hand it to the request as `cancelToken:` (or hold one and cancel it in `dispose`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `_requestStoragePermission` calls `audio.request(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/screens/setup_screen.dart:260

What to do

  • Thread 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.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

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

X3 · Exception handling5.0 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×22) — rust_backend/crates/extensions/src/prelude.js:127, rust_backend/crates/extensions/src/prelude.js:129, rust_backend/crates/extensions/src/prelude.js:131, …
  • `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — rust_backend/crates/extensions/src/prelude.js:527
  • `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×17) — lib/widgets/app_announcement_dialog.dart:40, lib/widgets/audio_info_sheet.dart:173, lib/widgets/lyrics_provider_picker.dart:140, …

What to do

  • Swallowed exception (empty catch)
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.

X5 · Nullable reference types9.2 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Dart's sound null safety is on and is not undermined by null assertions — a package whose `environment: sdk:` lower bound is 2.12 or above is null safe, so `String` cannot hold null and `String?` must be checked before use, and each postfix `!` is a run-time `Null check operator used on a null value` the author has told the analyzer cannot happen.

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

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 Health62%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture86%StrongSolid.
Maturity68%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness64%AdequateAcceptable, with room to improve.
Security68%Checked 4 of 10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplaryStrongest area.
Performance89%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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 16 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 1 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 — 58 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. 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.
  • AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — AX6 reached only 0% of this repository's production lines — dart (250,072 lines), rust (87,601 lines), kotlin (17,196 lines), swift (3,544 lines), cpp (1,772 lines), python (611 lines), c (274 lines), objectivec (115 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • D10 Test Quality — ~218878 lines of test source are present (.dart, .rs, .kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — no .dart test runner
  • D12 Dependency Hygiene — Not scored — 6 Maven/Gradle manifest(s) were read, stating a version for 21 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D17 Explicit Debt — the C# workspace loaded 0 projects, so explicit-debt density could not be measured
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; Dart, Java, Kotlin, Python, Rust, Swift not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, Swift surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .dart, .kt, .py, .rs, .swift source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.dart), 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.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Aggregate boundaries — not scored for Dart: aggregate-vs-value-object classification cannot be told apart in source (every class-holding-class reads alike), and a child COLLECTION (legitimate membership) vs a single embedded aggregate is indistinguishable — reported as guidance rather than measured
  • DM2 Strongly-typed ids — no in-repo typed-id idiom — primitive-obsession recorded as advisory DM8, DM2 not gated
  • DM3 Integration-event coupling — not scored for Dart: a cross-package domain leak cannot be told apart in source from a legitimate shared-kernel package, and most repositories ship a single package — reported as guidance rather than measured
  • DM4 Rich vs anemic domain model — this Dart repository declares no domain-layer entity carrying stored data (every type is a typed-id wrapper, DTO/config, ORM row or presentation container), so DM4's rich-vs-anemic read has no population to be taken over
  • DM6 Domain ↔ infrastructure boundary — this Dart repository maps no type to a persistence framework (drift/floor/isar/objectbox/hive), so DM6's domain↔infrastructure fusion read has no population to be taken over
  • DM7 Repository granularity — not scored for Dart: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — 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 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Dart, JVM, JavaScript/TypeScript, Rust, Swift source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `flutter test --coverage` (or `dart test --coverage=coverage` then `dart run coverage:format_coverage --lcov`)) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • 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.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • 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
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — X26 reached only 6% of this repository's production lines — dart (250,072 lines), rust (87,601 lines), cpp (1,772 lines), javascript (1,136 lines), c (274 lines), objectivec (115 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.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Dart was read, and it logs through none: package:logging, package:logger, talker and dart:developer take one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. Sentry's structured logs (`Sentry.logger`) would be judged.

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 — 20 finding(s)
D35 · Change Coupling · Boundary-crossing change coupling · ×7
  • Boundary-crossing change coupling: now_playing_screen.dart ↔ mornye_landscape_player.dart lib/screens/now_playing_screen.dart:1 — `lib/screens/now_playing_screen.dart` (context screens) and `lib/widgets/mornye_landscape_player.dart` (context widgets) sit in DIFFERENT parts of the tree yet change together 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `6d017634` feat(player): make automatic fullscreen lyrics optional; `c489960b` feat(player): let the Now Playing menu hide the volume slider; `0914e7d9` feat(mornye): restore liquid glass with continuous draggable navigation — run `git show` on any of them.
  • Boundary-crossing change coupling: MainActivity.kt ↔ AppDelegate.swift android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt:1 — `android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt` (context android) and `ios/Runner/AppDelegate.swift` (context ios) sit in DIFFERENT parts of the tree yet change together 60% of the time (52 of the 86 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 52 shared commits counted here, the most recent 3 are `6e964bb2` feat(player): open audio files and folders directly; `ca950dc3` refactor(android): remove backend switches that became constants (at that commit the file was still `android/app/src/main/kotlin/com/zarz/spotiflac/MainActivity.kt`); `11c6cf99` feat(player): synchronize music haptics with local playback (at that commit the file was still `android/app/src/main/kotlin/com/zarz/spotiflac/MainActivity.kt`) — run `git show` on any of them.
  • Boundary-crossing change coupling: queue_tab.dart ↔ audio_conversion_utils.dart lib/screens/queue_tab.dart:1 — `lib/screens/queue_tab.dart` (context screens) and `lib/utils/audio_conversion_utils.dart` (context utils) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `05415d96` refactor(screens): unify album header, selection UI, and batch engine; `54246481` feat(audio): add dither and resampler options for lossless conversion; `5dc0980c` l10n: localize audio conversion labels and confirmations — run `git show` on any of them.
  • Boundary-crossing change coupling: queue_tab.dart ↔ batch_convert_sheet.dart lib/screens/queue_tab.dart:1 — `lib/screens/queue_tab.dart` (context screens) and `lib/widgets/batch_convert_sheet.dart` (context widgets) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `e97ecf38` Use more specific MediaQuery methods to reduce unnecessary rebuilds (…; `61f62363` fix(convert): make convert bottom sheets draggable and scroll-controlled; `54246481` feat(audio): add dither and resampler options for lossless conversion — run `git show` on any of them.
  • Boundary-crossing change coupling: album_screen.dart ↔ track_collection_quick_actions.dart lib/screens/album_screen.dart:1 — `lib/screens/album_screen.dart` (context screens) and `lib/widgets/track_collection_quick_actions.dart` (context widgets) sit in DIFFERENT parts of the tree yet change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `da528689` chore(link): drop imports the Link actions now export; `091efe24` feat(link): add the Devices sheet and desktop actions on phones; `18ee7700` refactor: make ClickableArtistName single-line with ellipsis — run `git show` on any of them.
  • Boundary-crossing change coupling: local_album_screen.dart ↔ audio_conversion_utils.dart lib/screens/local_album_screen.dart:1 — `lib/screens/local_album_screen.dart` (context screens) and `lib/utils/audio_conversion_utils.dart` (context utils) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `05415d96` refactor(screens): unify album header, selection UI, and batch engine; `54246481` feat(audio): add dither and resampler options for lossless conversion; `5dc0980c` l10n: localize audio conversion labels and confirmations — run `git show` on any of them.
  • Boundary-crossing change coupling: downloaded_album_screen.dart ↔ audio_conversion_utils.dart lib/screens/downloaded_album_screen.dart:1 — `lib/screens/downloaded_album_screen.dart` (context screens) and `lib/utils/audio_conversion_utils.dart` (context utils) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `05415d96` refactor(screens): unify album header, selection UI, and batch engine; `54246481` feat(audio): add dither and resampler options for lossless conversion; `5dc0980c` l10n: localize audio conversion labels and confirmations — run `git show` on any of them.
AX1 · Captive dependencies · Captive dependency · ×6
  • Captive dependency: keepAlive provider linkRemotePlaybackProvider captures autoDispose linkDesktopRemoteProvider lib/services/link/features/link_remote_playback.dart:150 — `linkRemotePlaybackProvider` is a keep-alive Riverpod provider and calls `ref.read(linkDesktopRemoteProvider…)`, which is declared auto-dispose (lib/services/link/features/link_desktop_remote.dart:376). Read in build, `linkDesktopRemoteProvider` has no listener once the read returns, so it is disposed at once — its ref.onDispose closes what it handed out — while `linkRemotePlaybackProvider` keeps that value for the life of the ProviderContainer. Mark `linkDesktopRemoteProvider` keepAlive too, make `linkRemotePlaybackProvider` auto-dispose, or read it per use outside build.
  • Captive dependency: keepAlive provider linkRemotePlaybackProvider captures autoDispose linkDesktopRemoteProvider lib/services/link/features/link_remote_playback.dart:173 — `linkRemotePlaybackProvider` is a keep-alive Riverpod provider and calls `ref.listen(linkDesktopRemoteProvider…)`, which is declared auto-dispose (lib/services/link/features/link_desktop_remote.dart:376). The keep-alive provider listens to it for the life of the ProviderContainer, so `linkDesktopRemoteProvider` 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 `linkDesktopRemoteProvider` keepAlive too, make `linkRemotePlaybackProvider` auto-dispose, or read it per use outside build.
  • Captive dependency: keepAlive provider linkRemotePlaybackProvider captures autoDispose linkDesktopRemoteProvider lib/services/link/features/link_remote_playback.dart:177 — `linkRemotePlaybackProvider` is a keep-alive Riverpod provider and calls `ref.read(linkDesktopRemoteProvider…)`, which is declared auto-dispose (lib/services/link/features/link_desktop_remote.dart:376). Read in build, `linkDesktopRemoteProvider` has no listener once the read returns, so it is disposed at once — its ref.onDispose closes what it handed out — while `linkRemotePlaybackProvider` keeps that value for the life of the ProviderContainer. Mark `linkDesktopRemoteProvider` keepAlive too, make `linkRemotePlaybackProvider` auto-dispose, or read it per use outside build.
  • Captive dependency: keepAlive provider linkRemotePlaybackProvider captures autoDispose linkDesktopRemoteProvider lib/services/link/features/link_remote_playback.dart:201 — `linkRemotePlaybackProvider` is a keep-alive Riverpod provider and calls `ref.read(linkDesktopRemoteProvider…)`, which is declared auto-dispose (lib/services/link/features/link_desktop_remote.dart:376). Read in build, `linkDesktopRemoteProvider` has no listener once the read returns, so it is disposed at once — its ref.onDispose closes what it handed out — while `linkRemotePlaybackProvider` keeps that value for the life of the ProviderContainer. Mark `linkDesktopRemoteProvider` keepAlive too, make `linkRemotePlaybackProvider` auto-dispose, or read it per use outside build.
  • Captive dependency: keepAlive provider linkRemotePlaybackProvider captures autoDispose linkDesktopRemoteProvider lib/services/link/features/link_remote_playback.dart:221 — `linkRemotePlaybackProvider` is a keep-alive Riverpod provider and calls `ref.read(linkDesktopRemoteProvider…)`, which is declared auto-dispose (lib/services/link/features/link_desktop_remote.dart:376). Read in build, `linkDesktopRemoteProvider` has no listener once the read returns, so it is disposed at once — its ref.onDispose closes what it handed out — while `linkRemotePlaybackProvider` keeps that value for the life of the ProviderContainer. Mark `linkDesktopRemoteProvider` keepAlive too, make `linkRemotePlaybackProvider` auto-dispose, or read it per use outside build.
  • Captive dependency: keepAlive provider libraryMixesProvider captures autoDispose libraryCountsProvider lib/providers/library_mixes_provider.dart:164 — `libraryMixesProvider` is a keep-alive Riverpod provider and calls `ref.watch(libraryCountsProvider…)`, which is declared auto-dispose (lib/providers/library_counts_provider.dart:75). The keep-alive provider listens to it for the life of the ProviderContainer, so `libraryCountsProvider` 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 `libraryCountsProvider` keepAlive too, make `libraryMixesProvider` auto-dispose, or read it per use outside build.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
Serious — 2309 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×204
  • Hotspot: lib/screens/now_playing_screen.dart lib/screens/now_playing_screen.dart:311 — lib/screens/now_playing_screen.dart changed 103 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 97 in _NowPlayingScreenState._buildPlayer at line 311. 35 of those changes were fix/bug commits, and the other 68 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/now_playing_screen.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: lib/screens/home_tab.dart lib/screens/home_tab.dart:769 — lib/screens/home_tab.dart changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in _HomeTabState.build at line 769. 21 of those changes were fix/bug commits, and the other 53 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/home_tab.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: android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt:464 — android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt changed 80 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in MainActivity.configureFlutterEngine at line 464. 5 of those changes were fix/bug commits, and the other 75 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/services/music_player_service.dart lib/services/music_player_service.dart:1733 — lib/services/music_player_service.dart changed 98 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in MusicPlayerHandler._loadIndex at line 1733. 44 of those changes were fix/bug commits, and the other 54 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/music_player_service.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: lib/screens/queue_tab.dart lib/screens/queue_tab.dart:524 — lib/screens/queue_tab.dart changed 76 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in _QueueTabState.build at line 524. 19 of those changes were fix/bug commits, and the other 57 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/queue_tab.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: lib/providers/download_queue_provider_single_item.dart lib/providers/download_queue_provider_single_item.dart:607 — lib/providers/download_queue_provider_single_item.dart changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in _DownloadRun._handleDownloadSuccess at line 607. 17 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/providers/download_queue_provider_single_item.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: lib/services/platform_bridge.dart lib/services/platform_bridge.dart:454 — lib/services/platform_bridge.dart changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in PlatformBridge._ensureBackendEventHandler at line 454. 27 of those changes were fix/bug commits, and the other 52 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/platform_bridge.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: lib/screens/settings/playback_settings_page.dart lib/screens/settings/playback_settings_page.dart:148 — lib/screens/settings/playback_settings_page.dart changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in _PlaybackSettingsPageState.build at line 148. 5 of those changes were fix/bug commits, and the other 30 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/settings/playback_settings_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: lib/screens/library_tracks_folder_screen.dart lib/screens/library_tracks_folder_screen.dart:902 — lib/screens/library_tracks_folder_screen.dart changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in _LibraryTracksFolderScreenState._buildAppBar at line 902. 10 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/library_tracks_folder_screen.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: lib/screens/settings/library_settings_page.dart lib/screens/settings/library_settings_page.dart:469 — lib/screens/settings/library_settings_page.dart changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in _LibrarySettingsPageState.build at line 469. 11 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/settings/library_settings_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: REDACTED REDACTED:120 — REDACTED changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in MainActivitySafScanKt.scanSafTree at line 120. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/services/music_player_automix.dart lib/services/music_player_automix.dart:288 — lib/services/music_player_automix.dart changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in _MusicAutoMix._start at line 288. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/music_player_automix.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: lib/widgets/player_lyrics.dart lib/widgets/player_lyrics.dart:888 — lib/widgets/player_lyrics.dart changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in _SyncedLyricsViewState._buildLyrics at line 888. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/widgets/player_lyrics.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: lib/widgets/mornye_chrome.dart lib/widgets/mornye_chrome.dart:214 — lib/widgets/mornye_chrome.dart changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in MornyeGlass.build at line 214. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/widgets/mornye_chrome.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: lib/screens/main_shell.dart lib/screens/main_shell.dart:596 — lib/screens/main_shell.dart changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in _MainShellState._handleBackPress at line 596. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/main_shell.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: lib/services/network_storage_service.dart lib/services/network_storage_service.dart:1135 — lib/services/network_storage_service.dart changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in NetworkStorageService.parseListing at line 1135. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/network_storage_service.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: ios/Runner/CoreBackend.swift ios/Runner/CoreBackend.swift:643 — ios/Runner/CoreBackend.swift changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in RustCoreBackend.invokeApplication at line 643. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- ios/Runner/CoreBackend.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: ios/Runner/AppDelegate.swift ios/Runner/AppDelegate.swift:532 — ios/Runner/AppDelegate.swift changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in AppDelegate.invokeOsMethod at line 532. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- ios/Runner/AppDelegate.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/screens/artist_screen.dart lib/screens/artist_screen.dart:634 — lib/screens/artist_screen.dart changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in _ArtistScreenState._buildPage at line 634. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/artist_screen.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: lib/services/library_database.dart lib/services/library_database.dart:957 — lib/services/library_database.dart changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in LibraryDatabase.updateAudioMetadata at line 957. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/library_database.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: lib/providers/download_history_provider.dart lib/providers/download_history_provider.dart:854 — lib/providers/download_history_provider.dart changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in DownloadHistoryNotifier._inspectOrphanedEntries at line 854. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/providers/download_history_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: lib/providers/settings_provider.dart lib/providers/settings_provider.dart:300 — lib/providers/settings_provider.dart changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in SettingsNotifier._runMigrations at line 300. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/providers/settings_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: lib/widgets/mini_player.dart lib/widgets/mini_player.dart:206 — lib/widgets/mini_player.dart changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in _MiniPlayerBodyState.build at line 206. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/widgets/mini_player.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: android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:88 — android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in NativeDownloadFinalizer.finalize at line 88. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/services/network_library_scanner.dart lib/services/network_library_scanner.dart:122 — lib/services/network_library_scanner.dart changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in NetworkLibraryScanner._scan at line 122. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/network_library_scanner.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.
  • + 179 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×153
  • MethodTooLong: _PlaybackSettingsPageState.build lib/screens/settings/playback_settings_page.dart:148 — MethodTooLong — build runs 409 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 309 over it, 4.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _QueueTabState.build lib/screens/queue_tab.dart:524 — MethodTooLong — build runs 397 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 297 over it, 3.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _NowPlayingScreenState._buildPlayer lib/screens/now_playing_screen.dart:311 — MethodTooLong — _buildPlayer 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: _LibrarySettingsPageState.build lib/screens/settings/library_settings_page.dart:469 — MethodTooLong — build runs 334 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ExtensionDetailPageState.build lib/screens/settings/extension_detail_page.dart:85 — MethodTooLong — build runs 318 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 218 over it, 3.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppSettings.copyWith lib/models/settings.dart:436 — MethodTooLong — copyWith runs 302 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 202 over it, 3.02× 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: _SyncedLyricsViewState._buildLyrics lib/widgets/player_lyrics.dart:888 — MethodTooLong — _buildLyrics runs 300 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MainActivitySafScanKt.scanSafTree REDACTED:120 — MethodTooLong — scanSafTree runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.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: MornyePlayerLayout.build lib/widgets/mornye_player_layout.dart:87 — MethodTooLong — build runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.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: Backend.download_attempt rust_backend/crates/extensions/src/backend/downloads.rs:661 — MethodTooLong — download_attempt runs 292 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 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _TrackOptionsSheet.build lib/widgets/track_collection_quick_actions.dart:264 — MethodTooLong — build runs 260 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× 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: _RewindSlide._content lib/screens/listening_rewind_slides.dart:81 — MethodTooLong — _content runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.57× 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: NetworkLibraryScanner._scan lib/services/network_library_scanner.dart:122 — MethodTooLong — _scan runs 256 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 156 over it, 2.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: _NetworkStorageScreenState.build lib/screens/network_storage_screen.dart:318 — MethodTooLong — build runs 254 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 154 over it, 2.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: _MornyeLibraryScreenState.build lib/screens/mornye_library_screen.dart:309 — MethodTooLong — build runs 242 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 142 over it, 2.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RustCoreBackendApplicationKt.dispatchApplication android/app/src/rust/kotlin/com/zarz/mornye/RustCoreBackendApplication.kt:9 — MethodTooLong — dispatchApplication runs 241 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 141 over it, 2.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.
  • MethodTooLong: _DownloadSettingsPageState.build lib/screens/settings/download_settings_page.dart:32 — MethodTooLong — build runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _FilesSettingsPageState.build lib/screens/settings/files_settings_page.dart:125 — MethodTooLong — build runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DownloadService.processConcurrentNativeRequest android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1067 — MethodTooLong — processConcurrentNativeRequest runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _UpdateDialogState.build lib/widgets/update_dialog.dart:246 — MethodTooLong — build runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LinkLibraryExecutor.call lib/services/link/desktop/link_library_executor.dart:76 — MethodTooLong — call runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× 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: _MusicAutoMix._start lib/services/music_player_automix.dart:288 — MethodTooLong — _start runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ConcertDetailScreenState._page lib/screens/concert_detail_screen.dart:152 — MethodTooLong — _page runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _EqualizerScreenState._buildPage lib/screens/equalizer_screen.dart:211 — MethodTooLong — _buildPage runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RustCoreBackend.invokeApplication ios/Runner/CoreBackend.swift:643 — MethodTooLong — invokeApplication runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.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.
  • + 128 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×120
  • FileTooLong: services/music_player_service.dart lib/services/music_player_service.dart — FileTooLong — 2105 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: MusicPlayerHandler (136-2815). The bar is 500 significant lines; this is 1605 over it, 4.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/platform_bridge.dart lib/services/platform_bridge.dart — FileTooLong — 2065 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: PlatformBridge (74-3021). The bar is 500 significant lines; this is 1565 over it, 4.13× 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: providers/download_queue_provider_single_item.dart lib/providers/download_queue_provider_single_item.dart — FileTooLong — 1407 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: _DownloadRun (83-1881). The bar is 500 significant lines; this is 907 over it, 2.81× 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: mornye/DownloadService.kt android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt — FileTooLong — 1289 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: DownloadService (46-1745). The bar is 500 significant lines; this is 789 over it, 2.58× 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: screens/library_tracks_folder_screen.dart lib/screens/library_tracks_folder_screen.dart — FileTooLong — 1232 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: _LibraryTracksFolderScreenState (88-1333). The bar is 500 significant lines; this is 732 over it, 2.46× 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: screens/home_tab_intro.dart lib/screens/home_tab_intro.dart — FileTooLong — 1212 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 712 over it, 2.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: screens/artist_screen_widgets.dart lib/screens/artist_screen_widgets.dart — FileTooLong — 1205 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 705 over it, 2.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: providers/download_queue_provider_native_worker.dart lib/providers/download_queue_provider_native_worker.dart — FileTooLong — 1204 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 704 over it, 2.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: services/network_storage_service.dart lib/services/network_storage_service.dart — FileTooLong — 1188 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: NetworkStorageService (325-1596). The bar is 500 significant lines; this is 688 over it, 2.38× 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: widgets/player_lyrics.dart lib/widgets/player_lyrics.dart — FileTooLong — 1173 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: _SyncedLyricsViewState (98-1322). The bar is 500 significant lines; this is 673 over it, 2.35× 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: screens/home_tab.dart lib/screens/home_tab.dart — FileTooLong — 1164 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: _HomeTabState (127-1581). The bar is 500 significant lines; this is 664 over it, 2.33× 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: widgets/animation_utils.dart lib/widgets/animation_utils.dart — FileTooLong — 1149 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 649 over it, 2.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: providers/download_history_provider.dart lib/providers/download_history_provider.dart — FileTooLong — 1132 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: DownloadHistoryNotifier (141-1345). The bar is 500 significant lines; this is 632 over it, 2.26× 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: screens/queue_tab_item_widgets.dart lib/screens/queue_tab_item_widgets.dart — FileTooLong — 1073 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 573 over it, 2.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: services/library_collections_database.dart lib/services/library_collections_database.dart — FileTooLong — 1053 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: LibraryCollectionsDatabase (78-1314). The bar is 500 significant lines; this is 553 over it, 2.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/library_queue_store.dart lib/services/library_queue_store.dart — FileTooLong — 1050 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 550 over it, 2.10× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: desktop/desktop_navigation.dart lib/widgets/desktop/desktop_navigation.dart — FileTooLong — 1042 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 542 over it, 2.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: screens/now_playing_screen.dart lib/screens/now_playing_screen.dart — FileTooLong — 1033 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: _NowPlayingScreenState (124-1376). The bar is 500 significant lines; this is 533 over it, 2.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: screens/main_shell.dart lib/screens/main_shell.dart — FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: _MainShellState (129-1417). The bar is 500 significant lines; this is 528 over it, 2.06× 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: screens/network_storage_screen.dart lib/screens/network_storage_screen.dart — FileTooLong — 962 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 462 over it, 1.92× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: desktop/link_desktop_host.dart lib/services/link/desktop/link_desktop_host.dart — FileTooLong — 900 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: LinkDesktopHost (182-1283). The bar is 500 significant lines; this is 400 over it, 1.80× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/library_database.dart lib/services/library_database.dart — FileTooLong — 888 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: LibraryDatabase (32-1187). The bar is 500 significant lines; this is 388 over it, 1.78× 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: screens/queue_tab_filter_widgets.dart lib/screens/queue_tab_filter_widgets.dart — FileTooLong — 875 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 375 over it, 1.75× 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: screens/whats_new_screen.dart lib/screens/whats_new_screen.dart — FileTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 350 over it, 1.70× 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: backend/downloads.rs rust_backend/crates/extensions/src/backend/downloads.rs — FileTooLong — 842 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: Backend (58-1097). The bar is 500 significant lines; this is 342 over it, 1.68× 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.
  • + 95 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×63
  • ClassTooLong: PlatformBridge lib/services/platform_bridge.dart:74 — ClassTooLong — 2012 significant lines (blank, comment-only and punctuation-only lines excluded), 251 methods. The bar is 400 significant lines; this is 1612 over it, 5.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: MusicPlayerHandler lib/services/music_player_service.dart:136 — ClassTooLong — 2001 significant lines (blank, comment-only and punctuation-only lines excluded), 103 methods. The bar is 400 significant lines; this is 1601 over it, 5.00× 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: _DownloadRun lib/providers/download_queue_provider_single_item.dart:79 — ClassTooLong — 1351 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 951 over it, 3.38× 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: DownloadService android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:46 — ClassTooLong — 1253 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 853 over it, 3.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _HomeTabState lib/screens/home_tab.dart:127 — ClassTooLong — 1046 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 646 over it, 2.62× 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: NetworkStorageService lib/services/network_storage_service.dart:325 — ClassTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 549 over it, 2.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.
  • ClassTooLong: _NowPlayingScreenState lib/screens/now_playing_screen.dart:124 — ClassTooLong — 948 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 548 over it, 2.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.
  • ClassTooLong: _SyncedLyricsViewState lib/widgets/player_lyrics.dart:98 — ClassTooLong — 943 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 543 over it, 2.36× 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: _LibraryTracksFolderScreenState lib/screens/library_tracks_folder_screen.dart:88 — ClassTooLong — 935 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 535 over it, 2.34× 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: LibraryCollectionsDatabase lib/services/library_collections_database.dart:78 — ClassTooLong — 929 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 529 over it, 2.32× 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: DownloadHistoryNotifier lib/providers/download_history_provider.dart:141 — ClassTooLong — 900 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 500 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: _MainShellState lib/screens/main_shell.dart:129 — ClassTooLong — 877 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 477 over it, 2.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LibraryDatabase lib/services/library_database.dart:32 — ClassTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 437 over it, 2.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LinkDesktopHost lib/services/link/desktop/link_desktop_host.dart:179 — ClassTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 367 over it, 1.92× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _QueueTabState lib/screens/queue_tab.dart:131 — ClassTooLong — 752 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 352 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: SettingsSearchCatalog lib/utils/settings_search_catalog.dart:53 — ClassTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 336 over it, 1.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DownloadedEmbeddedCoverResolver lib/services/downloaded_embedded_cover_resolver.dart:61 — ClassTooLong — 716 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 316 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: _LibrarySearchResultsState lib/widgets/library_search_results.dart:63 — ClassTooLong — 678 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 278 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _LibraryDirectoryViewState lib/widgets/library_directory_view.dart:78 — ClassTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 246 over it, 1.62× 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: _LibrarySettingsPageState lib/screens/settings/library_settings_page.dart:41 — ClassTooLong — 643 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 243 over it, 1.61× 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: _AlbumScreenState lib/screens/album_screen.dart:93 — ClassTooLong — 637 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 237 over it, 1.59× 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: SettingsNotifier lib/providers/settings_provider.dart:105 — ClassTooLong — 627 significant lines (blank, comment-only and punctuation-only lines excluded), 146 methods. The bar is 400 significant lines; this is 227 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.
  • ClassTooLong: _FilesSettingsPageState lib/screens/settings/files_settings_page.dart:54 — ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 225 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppSettings lib/models/settings.dart:47 — ClassTooLong — 623 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 223 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LibraryCollectionsNotifier lib/providers/library_collections_provider.dart:21 — ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 222 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 38 more in this group — see findings.md.
D2 · Cognitive Complexity · mornye_core · ×56
  • mornye_core::tags::write::id3::read_frames (cognitive 94) rust_backend/crates/core/src/tags/write/id3.rs:220 — mornye_core::tags::write::id3::read_frames has cognitive complexity 94 (threshold 15). Drivers by points: if/else 42 (79 pts), boolean chains 7, loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_core::tags::write::riff::edit (cognitive 94) rust_backend/crates/core/src/tags/write/riff.rs:6 — mornye_core::tags::write::riff::edit has cognitive complexity 94 (threshold 15). Drivers by points: if/else 46 (82 pts), boolean chains 8, match/switch 1 (3 pts), loops 1 (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.
  • mornye_core::cue::parse (cognitive 65) rust_backend/crates/core/src/cue.rs:40 — mornye_core::cue::parse has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (55 pts), match/switch 2 (8 pts), boolean chains 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.
  • mornye_core::media::hires::check_file (cognitive 58) rust_backend/crates/core/src/media/hires.rs:198 — mornye_core::media::hires::check_file has cognitive complexity 58 (threshold 15). Drivers by points: if/else 28 (34 pts), boolean chains 12, loops 4 (8 pts), match/switch 2 (4 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, 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.
  • mornye_core::tags::write::flac_header (cognitive 56) rust_backend/crates/core/src/tags/write.rs:303 — mornye_core::tags::write::flac_header has cognitive complexity 56 (threshold 15). Drivers by points: if/else 25 (43 pts), loops 5 (10 pts), boolean chains 3 (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.
  • mornye_core::media::audio::riff_quality (cognitive 53) rust_backend/crates/core/src/media/audio.rs:255 — mornye_core::media::audio::riff_quality has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (40 pts), boolean chains 12, 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.
  • mornye_core::tags::id3::frames (cognitive 53) rust_backend/crates/core/src/tags/id3.rs:205 — mornye_core::tags::id3::frames has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 14, loops 2 (4 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.
  • mornye_core::tags::write::mp4::edit (cognitive 52) rust_backend/crates/core/src/tags/write/mp4.rs:21 — mornye_core::tags::write::mp4::edit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (43 pts), loops 6 (7 pts), boolean chains 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.
  • mornye_core::media::audio::mp3_quality (cognitive 50) rust_backend/crates/core/src/media/audio.rs:8 — mornye_core::media::audio::mp3_quality has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 10, loops 2 (3 pts), match/switch 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.
  • mornye_core::native_palette::wsmeans (cognitive 50) rust_backend/crates/core/src/native_palette.rs:329 — mornye_core::native_palette::wsmeans has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 10 (21 pts), boolean chains 1 (nesting depth added 28). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
  • mornye_core::native_audio_analysis::estimate_spectral_cutoff (cognitive 49) rust_backend/crates/core/src/native_audio_analysis.rs:250 — mornye_core::native_audio_analysis::estimate_spectral_cutoff has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 9 (13 pts), boolean chains 5 (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.
  • mornye_core::tags::write::ape::edit (cognitive 49) rust_backend/crates/core/src/tags/write/ape.rs:13 — mornye_core::tags::write::ape::edit has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 6, 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.
  • mornye_core::metadata::musicbrainz::casing::title (cognitive 42) rust_backend/crates/core/src/metadata/musicbrainz/casing.rs:26 — mornye_core::metadata::musicbrainz::casing::title has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (5 pts), boolean chains 3 (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.
  • mornye_core::tags::write::id3::edit_header (cognitive 41) rust_backend/crates/core/src/tags/write/id3.rs:48 — mornye_core::tags::write::id3::edit_header has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 6 (8 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.
  • mornye_core::tags::write::edit_comments (cognitive 39) rust_backend/crates/core/src/tags/write.rs:493 — mornye_core::tags::write::edit_comments has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 7 (14 pts), boolean chains 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.
  • mornye_core::tags::write::mp4::shift_offsets (cognitive 39) rust_backend/crates/core/src/tags/write/mp4.rs:374 — mornye_core::tags::write::mp4::shift_offsets has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 4 (8 pts), match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_core::tags::write::ogg::rewrite (cognitive 38) rust_backend/crates/core/src/tags/write/ogg.rs:49 — mornye_core::tags::write::ogg::rewrite has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 4 (5 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.
  • mornye_core::tags::containers::ogg_packets_until (cognitive 35) rust_backend/crates/core/src/tags/containers.rs:245 — mornye_core::tags::containers::ogg_packets_until has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_core::tags::file::read_metadata (cognitive 33) rust_backend/crates/core/src/tags/file.rs:34 — mornye_core::tags::file::read_metadata has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 5 (8 pts), boolean chains 4 (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.
  • mornye_core::lyrics::payloads::format_apple_payload (cognitive 32) rust_backend/crates/core/src/lyrics/payloads.rs:254 — mornye_core::lyrics::payloads::format_apple_payload has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 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.
  • mornye_core::metadata::share::select (cognitive 31) rust_backend/crates/core/src/metadata/share.rs:210 — mornye_core::metadata::share::select has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_core::tags::containers::riff_chunks (cognitive 31) rust_backend/crates/core/src/tags/containers.rs:477 — mornye_core::tags::containers::riff_chunks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (26 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.
  • mornye_core::tags::library::read (cognitive 30) rust_backend/crates/core/src/tags/library.rs:136 — mornye_core::tags::library::read has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (8 pts), boolean chains 5, 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.
  • mornye_core::native_audio_analysis::analyze_automix_pcm (cognitive 29) rust_backend/crates/core/src/native_audio_analysis.rs:56 — mornye_core::native_audio_analysis::analyze_automix_pcm has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 12 (14 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.
  • mornye_core::tags::write::mp4::ac4::config (cognitive 29) rust_backend/crates/core/src/tags/write/mp4/ac4.rs:55 — mornye_core::tags::write::mp4::ac4::config has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 31 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×40
  • TooManyMethods: PlatformBridge lib/services/platform_bridge.dart:74 — TooManyMethods — 251 methods. The bar is 30 methods; this is 221 over it, 8.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: SettingsNotifier lib/providers/settings_provider.dart:105 — TooManyMethods — 146 methods. The bar is 30 methods; this is 116 over it, 4.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.
  • TooManyMethods: MusicPlayerHandler lib/services/music_player_service.dart:136 — TooManyMethods — 103 methods. The bar is 30 methods; this is 73 over it, 3.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Backend rust_backend/crates/extensions/src/backend.rs:35 — TooManyMethods — 100 methods, declared across 14 files: src/backend.rs (12), library/scan.rs (12), backend/metadata.rs (12), backend/lyrics.rs (11), +10 more file(s). The bar is 30 methods; this is 70 over it, 3.33× 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: ExtensionManager rust_backend/crates/extensions/src/manager.rs:75 — TooManyMethods — 73 methods, declared across 8 files: src/manager.rs (15), manager/providers.rs (12), manager/downloads.rs (11), manager/install.rs (9), +4 more file(s). The bar is 30 methods; this is 43 over it, 2.43× 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: ExtensionManager rust_backend/crates/mobile/src/manager.rs:28 — TooManyMethods — 73 methods, declared across 5 files: src/manager.rs (30), src/tags.rs (18), src/metadata.rs (16), src/lyrics.rs (8), +1 more file(s). The bar is 30 methods; this is 43 over it, 2.43× 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: LibraryDatabase lib/services/library_database.dart:32 — 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: LinkDesktopHost lib/services/link/desktop/link_desktop_host.dart:179 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.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: LibraryCollectionsDatabase lib/services/library_collections_database.dart:78 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 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.
  • TooManyMethods: RustCoreBackend android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt:63 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. Most of these members implement mornye.CoreBackend (38 of 54 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: RustCoreBackend ios/Runner/CoreBackend.swift:191 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MediaKitPlaybackDeck lib/services/media_kit_playback_deck.dart:225 — 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: _HomeTabState lib/screens/home_tab.dart:127 — 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: DownloadedEmbeddedCoverResolver lib/services/downloaded_embedded_cover_resolver.dart:61 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ExtensionEnvironment rust_backend/crates/extensions/src/environment.rs:80 — TooManyMethods — 43 methods, declared across 2 files: src/environment.rs (39), environment/index.rs (4). The bar is 30 methods; this is 13 over it, 1.43× 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: MusicPlayerRuntime lib/services/music_player_runtime.dart:301 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DownloadHistoryNotifier lib/providers/download_history_provider.dart:141 — 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: LinkMirroredPlayback lib/services/link/link_mirrored_playback.dart:48 — 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: DownloadService android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:46 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppStateDatabase lib/services/app_state_database.dart:30 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NetworkStorageService lib/services/network_storage_service.dart:325 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HistoryDatabase lib/services/history_database.dart:103 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NotificationService lib/services/notification_service.dart:14 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _QueueTabState lib/screens/queue_tab.dart:131 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LastfmService lib/services/lastfm/lastfm_service.dart:21 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 15 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×36
  • Low cohesion: LibraryCollectionsDatabase (LCOM4 25) lib/services/library_collections_database.dart:78 — LibraryCollectionsDatabase's methods fall into 25 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 25 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: LibraryDatabase (LCOM4 21) lib/services/library_database.dart:32 — LibraryDatabase's methods fall into 21 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 21 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: AppStateDatabase (LCOM4 20) lib/services/app_state_database.dart:30 — AppStateDatabase's methods fall into 20 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 20 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: HistoryDatabase (LCOM4 13) lib/services/history_database.dart:103 — HistoryDatabase's methods fall into 13 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 13 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: MusicPlayerController (LCOM4 10) lib/providers/music_player_provider.dart:386 — MusicPlayerController's methods fall into 10 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 10 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: NowPlayingRoute (LCOM4 10) lib/routes/now_playing_route.dart:9 — NowPlayingRoute's methods fall into 10 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 10 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: DownloadQueueNotifier (LCOM4 8) lib/providers/download_queue_provider.dart:136 — DownloadQueueNotifier's methods fall into 8 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 8 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: _HomeTabState (LCOM4 7) lib/screens/home_tab.dart:127 — _HomeTabState's methods fall into 7 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 7 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: CastPlaybackDeck (LCOM4 7) lib/services/cast_playback_deck.dart:7 — CastPlaybackDeck's methods fall into 7 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 7 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: PlaybackDependencies (LCOM4 7) lib/services/music_player_runtime.dart:64 — PlaybackDependencies's methods fall into 7 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 7 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: _RemovedQueueIndex (LCOM4 6) lib/providers/download_queue_state.dart:72 — _RemovedQueueIndex's methods fall into 6 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 6 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: RepoNotifier (LCOM4 6) lib/providers/repo_provider.dart:176 — RepoNotifier's methods fall into 6 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 6 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: _LibrarySettingsPageState (LCOM4 6) lib/screens/settings/library_settings_page.dart:41 — _LibrarySettingsPageState's methods fall into 6 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 6 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: _TrackMetadataScreenState (LCOM4 6) lib/screens/track_metadata_screen.dart:174 — _TrackMetadataScreenState's methods fall into 6 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 6 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: TrackNotifier (LCOM4 5) lib/providers/track_provider.dart:156 — TrackNotifier'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: _QueueTabState (LCOM4 5) lib/screens/queue_tab.dart:131 — _QueueTabState'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: DesktopDiagnostics (LCOM4 5) lib/services/desktop_diagnostics.dart:13 — DesktopDiagnostics'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: DesktopUpdater (LCOM4 5) lib/services/desktop_updater.dart:21 — DesktopUpdater'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: MprisPlayerObject (LCOM4 5) lib/services/media_session_mpris.dart:68 — MprisPlayerObject'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: RecordMicrophone (LCOM4 5) lib/services/music_recognition.dart:229 — RecordMicrophone'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: _AppRefreshIndicatorState (LCOM4 5) lib/widgets/app_refresh_indicator.dart:44 — _AppRefreshIndicatorState'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: _DesktopShortcutsState (LCOM4 5) lib/widgets/desktop/desktop_shortcuts.dart:47 — _DesktopShortcutsState'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: _LiquidMenuGlassState (LCOM4 5) lib/widgets/mornye_context_menu.dart:163 — _LiquidMenuGlassState'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: DownloadHistoryState (LCOM4 4) lib/models/download_history.dart:292 — DownloadHistoryState'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.
  • Low cohesion: _IndexedQueueMap (LCOM4 4) lib/providers/download_queue_state.dart:6 — _IndexedQueueMap'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.
  • + 11 more in this group — see findings.md.
D1 · Cyclomatic Complexity · mornye_core · ×34
  • mornye_core::tags::write::id3::read_frames (cyclomatic 58) rust_backend/crates/core/src/tags/write/id3.rs:220 — mornye_core::tags::write::id3::read_frames has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mornye_core::media::hires::check_file (cyclomatic 47) rust_backend/crates/core/src/media/hires.rs:198 — mornye_core::media::hires::check_file 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.
  • mornye_core::tags::write::riff::edit (cyclomatic 46) rust_backend/crates/core/src/tags/write/riff.rs:6 — mornye_core::tags::write::riff::edit 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.
  • mornye_core::tags::id3::apply (cyclomatic 44) rust_backend/crates/core/src/tags/id3.rs:317 — mornye_core::tags::id3::apply has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mornye_core::tags::file::read_metadata (cyclomatic 40) rust_backend/crates/core/src/tags/file.rs:34 — mornye_core::tags::file::read_metadata has cyclomatic complexity 40 (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.
  • mornye_core::tags::comments::apply (cyclomatic 38) rust_backend/crates/core/src/tags/comments.rs:117 — mornye_core::tags::comments::apply has cyclomatic complexity 38 (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.
  • mornye_core::media::audio::mp3_quality (cyclomatic 35) rust_backend/crates/core/src/media/audio.rs:8 — mornye_core::media::audio::mp3_quality 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.
  • mornye_core::filename::date::render (cyclomatic 34) rust_backend/crates/core/src/filename/date.rs:151 — mornye_core::filename::date::render 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.
  • mornye_core::tags::library::read (cyclomatic 34) rust_backend/crates/core/src/tags/library.rs:136 — mornye_core::tags::library::read has cyclomatic complexity 34 (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.
  • mornye_core::tags::id3::frames (cyclomatic 32) rust_backend/crates/core/src/tags/id3.rs:205 — mornye_core::tags::id3::frames 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.
  • mornye_core::media::audio::riff_quality (cyclomatic 31) rust_backend/crates/core/src/media/audio.rs:255 — mornye_core::media::audio::riff_quality 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.
  • mornye_core::tags::write::mp4::edit (cyclomatic 31) rust_backend/crates/core/src/tags/write/mp4.rs:21 — mornye_core::tags::write::mp4::edit 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.
  • mornye_core::cue::parse (cyclomatic 30) rust_backend/crates/core/src/cue.rs:40 — mornye_core::cue::parse 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.
  • mornye_core::native_audio_analysis::estimate_spectral_cutoff (cyclomatic 30) rust_backend/crates/core/src/native_audio_analysis.rs:250 — mornye_core::native_audio_analysis::estimate_spectral_cutoff 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.
  • mornye_core::tags::write::ape::edit (cyclomatic 28) rust_backend/crates/core/src/tags/write/ape.rs:13 — mornye_core::tags::write::ape::edit 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.
  • mornye_core::tags::write::flac_header (cyclomatic 27) rust_backend/crates/core/src/tags/write.rs:303 — mornye_core::tags::write::flac_header 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.
  • mornye_core::tags::write::id3::edit_header (cyclomatic 25) rust_backend/crates/core/src/tags/write/id3.rs:48 — mornye_core::tags::write::id3::edit_header 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.
  • mornye_core::native_audio_analysis::analyze_automix_pcm (cyclomatic 23) rust_backend/crates/core/src/native_audio_analysis.rs:56 — mornye_core::native_audio_analysis::analyze_automix_pcm 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.
  • mornye_core::tags::mp4::read (cyclomatic 23) rust_backend/crates/core/src/tags/mp4.rs:17 — mornye_core::tags::mp4::read has cyclomatic complexity 23 (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.
  • mornye_core::native_palette::wsmeans (cyclomatic 22) rust_backend/crates/core/src/native_palette.rs:329 — mornye_core::native_palette::wsmeans has cyclomatic complexity 22 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
  • mornye_core::tags::write::ogg::rewrite (cyclomatic 22) rust_backend/crates/core/src/tags/write/ogg.rs:49 — mornye_core::tags::write::ogg::rewrite 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.
  • mornye_core::resolver::titles_match (cyclomatic 21) rust_backend/crates/core/src/resolver.rs:169 — mornye_core::resolver::titles_match 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.
  • mornye_core::metadata::share::select (cyclomatic 20) rust_backend/crates/core/src/metadata/share.rs:210 — mornye_core::metadata::share::select 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.
  • mornye_core::media::audio::ogg_quality (cyclomatic 19) rust_backend/crates/core/src/media/audio.rs:185 — mornye_core::media::audio::ogg_quality 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.
  • mornye_core::tags::write::edit_comments (cyclomatic 19) rust_backend/crates/core/src/tags/write.rs:493 — mornye_core::tags::write::edit_comments 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.
  • + 9 more in this group — see findings.md.
D2 · Cognitive Complexity · mornye_extensions · ×25
  • mornye_extensions::download::chunked::download (cognitive 96) rust_backend/crates/extensions/src/download/chunked.rs:14 — mornye_extensions::download::chunked::download has cognitive complexity 96 (threshold 15). Drivers by points: if/else 22 (59 pts), boolean chains 21, match/switch 3 (9 pts), loops 4 (7 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_extensions::download::download (cognitive 91) rust_backend/crates/extensions/src/download.rs:129 — mornye_extensions::download::download has cognitive complexity 91 (threshold 15). Drivers by points: if/else 32 (68 pts), boolean chains 15, match/switch 2 (5 pts), loops 2 (3 pts) (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.
  • mornye_extensions::download::segments::download (cognitive 71) rust_backend/crates/extensions/src/download/segments.rs:29 — mornye_extensions::download::segments::download has cognitive complexity 71 (threshold 15). Drivers by points: if/else 16 (49 pts), loops 6 (13 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 44). 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.
  • mornye_extensions::file_host::call (cognitive 58) rust_backend/crates/extensions/src/file_host.rs:55 — mornye_extensions::file_host::call has cognitive complexity 58 (threshold 15). Drivers by points: if/else 24 (50 pts), loops 2 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 30). 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.
  • mornye_extensions::download::segments::fetch (cognitive 51) rust_backend/crates/extensions/src/download/segments.rs:256 — mornye_extensions::download::segments::fetch has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 7, loops 3 (7 pts), match/switch 2 (7 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.
  • mornye_extensions::file_transform::transform (cognitive 44) rust_backend/crates/extensions/src/file_transform.rs:10 — mornye_extensions::file_transform::transform has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 9, match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_extensions::backend::health::classify_body (cognitive 33) rust_backend/crates/extensions/src/backend/health.rs:464 — mornye_extensions::backend::health::classify_body has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4, match/switch 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.
  • mornye_extensions::ffmpeg_host::conversion_arguments (cognitive 33) rust_backend/crates/extensions/src/ffmpeg_host.rs:89 — mornye_extensions::ffmpeg_host::conversion_arguments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 2 (4 pts), boolean chains 3 (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.
  • mornye_extensions::runtime::vm::run_worker (cognitive 32) rust_backend/crates/extensions/src/runtime/vm.rs:13 — mornye_extensions::runtime::vm::run_worker has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (11 pts), 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.
  • mornye_extensions::backend::downloads::metadata::download_metadata_fields (cognitive 25) rust_backend/crates/extensions/src/backend/downloads/metadata.rs:45 — mornye_extensions::backend::downloads::metadata::download_metadata_fields has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4 (6 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.
  • mornye_extensions::backend::downloads::result::success (cognitive 24) rust_backend/crates/extensions/src/backend/downloads/result.rs:10 — mornye_extensions::backend::downloads::result::success has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, 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.
  • mornye_extensions::crypto::transform (cognitive 23) rust_backend/crates/extensions/src/crypto.rs:84 — mornye_extensions::crypto::transform has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (10 pts) (nesting depth added 13). 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.
  • mornye_extensions::network_host::parse_json (cognitive 22) rust_backend/crates/extensions/src/network_host.rs:94 — mornye_extensions::network_host::parse_json has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts), boolean chains 2, 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.
  • mornye_extensions::crypto_host::segments (cognitive 21) rust_backend/crates/extensions/src/crypto_host.rs:177 — mornye_extensions::crypto_host::segments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, 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.
  • mornye_extensions::provider::audio_traits (cognitive 21) rust_backend/crates/extensions/src/provider.rs:12 — mornye_extensions::provider::audio_traits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 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.
  • mornye_extensions::manager::downloads::normalize_decryption (cognitive 20) rust_backend/crates/extensions/src/manager/downloads.rs:364 — mornye_extensions::manager::downloads::normalize_decryption has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 1 (2 pts), match/switch 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.
  • mornye_extensions::manager::metadata::track_input (cognitive 20) rust_backend/crates/extensions/src/manager/metadata.rs:314 — mornye_extensions::manager::metadata::track_input has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 3 (4 pts), boolean chains 3, loops 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.
  • mornye_extensions::host::register (cognitive 19) rust_backend/crates/extensions/src/host.rs:16 — mornye_extensions::host::register has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 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, 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.
  • mornye_extensions::backend::downloads::matching::probe_result (cognitive 18) rust_backend/crates/extensions/src/backend/downloads/matching.rs:11 — mornye_extensions::backend::downloads::matching::probe_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (4 pts), boolean chains 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.
  • mornye_extensions::download_host::register (cognitive 18) rust_backend/crates/extensions/src/download_host.rs:6 — mornye_extensions::download_host::register has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 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.
  • mornye_extensions::package::central_names (cognitive 18) rust_backend/crates/extensions/src/package.rs:264 — mornye_extensions::package::central_names has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_extensions::runtime::vm::eval_cached (cognitive 18) rust_backend/crates/extensions/src/runtime/vm.rs:147 — mornye_extensions::runtime::vm::eval_cached has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 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.
  • mornye_extensions::signed_session::protocol::parse_time (cognitive 18) rust_backend/crates/extensions/src/signed_session/protocol.rs:108 — mornye_extensions::signed_session::protocol::parse_time has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2 (nesting depth added 4). Of this number, 17 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.
  • mornye_extensions::backend::downloads::metadata::apply_metadata (cognitive 17) rust_backend/crates/extensions/src/backend/downloads/metadata.rs:134 — mornye_extensions::backend::downloads::metadata::apply_metadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, 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.
  • mornye_extensions::backend::downloads::metadata::preferred_track_id (cognitive 16) rust_backend/crates/extensions/src/backend/downloads/metadata.rs:201 — mornye_extensions::backend::downloads::metadata::preferred_track_id has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 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 · mornye_mobile · ×24
  • mornye_mobile::native_autoplay_taste::execute (cognitive 92) rust_backend/crates/mobile/src/native_autoplay_taste.rs:99 — mornye_mobile::native_autoplay_taste::execute has cognitive complexity 92 (threshold 15). Drivers by points: if/else 23 (55 pts), loops 15 (30 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_mobile::usb_audio::descriptors::parse (cognitive 74) rust_backend/crates/mobile/src/usb_audio/descriptors.rs:49 — mornye_mobile::usb_audio::descriptors::parse has cognitive complexity 74 (threshold 15). Drivers by points: if/else 17 (51 pts), boolean chains 12, loops 3 (9 pts), match/switch 1 (2 pts) (nesting depth added 41). 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.
  • mornye_mobile::usb_audio::volume::feature (cognitive 58) rust_backend/crates/mobile/src/usb_audio/volume.rs:26 — mornye_mobile::usb_audio::volume::feature has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 7, match/switch 2 (6 pts), loops 3 (4 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.
  • mornye_mobile::native_library::import (cognitive 51) rust_backend/crates/mobile/src/native_library.rs:371 — mornye_mobile::native_library::import has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 5 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_mobile::native_directory_stats::scan (cognitive 50) rust_backend/crates/mobile/src/native_directory_stats.rs:37 — mornye_mobile::native_directory_stats::scan has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (42 pts), match/switch 2 (7 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_mobile::native_lyrics::lrc::parse_lrc (cognitive 50) rust_backend/crates/mobile/src/native_lyrics/lrc.rs:18 — mornye_mobile::native_lyrics::lrc::parse_lrc has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (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.
  • mornye_mobile::native_lyrics::ttml::parse_ttml (cognitive 43) rust_backend/crates/mobile/src/native_lyrics/ttml.rs:185 — mornye_mobile::native_lyrics::ttml::parse_ttml has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 5 (8 pts), boolean chains 4 (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.
  • mornye_mobile::native_cache::unix::collect (cognitive 37) rust_backend/crates/mobile/src/native_cache/unix.rs:168 — mornye_mobile::native_cache::unix::collect has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 3 (10 pts), boolean chains 3, loops 2 (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.
  • mornye_mobile::native_library::path_keys::build (cognitive 36) rust_backend/crates/mobile/src/native_library/path_keys.rs:233 — mornye_mobile::native_library::path_keys::build has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 7, 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.
  • mornye_mobile::native_lyrics::ttml::xml_source (cognitive 35) rust_backend/crates/mobile/src/native_lyrics/ttml.rs:329 — mornye_mobile::native_lyrics::ttml::xml_source has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (33 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.
  • mornye_mobile::native_backup::archive::read (cognitive 31) rust_backend/crates/mobile/src/native_backup/archive.rs:203 — mornye_mobile::native_backup::archive::read has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_mobile::native_listing::execute (cognitive 30) rust_backend/crates/mobile/src/native_listing.rs:8 — mornye_mobile::native_listing::execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 7, loops 2 (4 pts), match/switch 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.
  • mornye_mobile::native_lyrics::credits::with_credits (cognitive 29) rust_backend/crates/mobile/src/native_lyrics/credits.rs:25 — mornye_mobile::native_lyrics::credits::with_credits has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_mobile::native_lyrics::ttml::visit (cognitive 28) rust_backend/crates/mobile/src/native_lyrics/ttml.rs:122 — mornye_mobile::native_lyrics::ttml::visit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_mobile::usb_audio::descriptors::formats (cognitive 27) rust_backend/crates/mobile/src/usb_audio/descriptors.rs:177 — mornye_mobile::usb_audio::descriptors::formats has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 7, 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.
  • mornye_mobile::native_lyrics_translation::chunks (cognitive 23) rust_backend/crates/mobile/src/native_lyrics_translation.rs:205 — mornye_mobile::native_lyrics_translation::chunks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, 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.
  • mornye_mobile::native_library::snapshot (cognitive 22) rust_backend/crates/mobile/src/native_library.rs:646 — mornye_mobile::native_library::snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 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.
  • mornye_mobile::native_playlists::parse_m3u (cognitive 20) rust_backend/crates/mobile/src/native_playlists.rs:204 — mornye_mobile::native_playlists::parse_m3u has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 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.
  • mornye_mobile::native_backup::import (cognitive 18) rust_backend/crates/mobile/src/native_backup.rs:419 — mornye_mobile::native_backup::import has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (4 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.
  • mornye_mobile::native_backup::encode (cognitive 17) rust_backend/crates/mobile/src/native_backup.rs:172 — mornye_mobile::native_backup::encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 5, 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.
  • mornye_mobile::native_backup::collections::import (cognitive 17) rust_backend/crates/mobile/src/native_backup/collections.rs:105 — mornye_mobile::native_backup::collections::import 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.
  • mornye_mobile::native_cache::unix::prune (cognitive 17) rust_backend/crates/mobile/src/native_cache/unix.rs:371 — mornye_mobile::native_cache::unix::prune has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_mobile::native_library::encode (cognitive 17) rust_backend/crates/mobile/src/native_library.rs:265 — mornye_mobile::native_library::encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 4, 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.
  • mornye_mobile::library_metadata::read_library_metadata_from_descriptor (cognitive 16) rust_backend/crates/mobile/src/library_metadata.rs:87 — mornye_mobile::library_metadata::read_library_metadata_from_descriptor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 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.
D3 · God Classes · FunctionTooLong · ×24
  • FunctionTooLong: mornye_extensions::download::chunked::download rust_backend/crates/extensions/src/download/chunked.rs:14 — FunctionTooLong — mornye_extensions::download::chunked::download runs 227 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 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_extensions::download::download rust_backend/crates/extensions/src/download.rs:129 — FunctionTooLong — mornye_extensions::download::download runs 217 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 117 over it, 2.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: mornye_extensions::host::register rust_backend/crates/extensions/src/host.rs:16 — FunctionTooLong — mornye_extensions::host::register runs 205 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 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_mobile::native_library::import rust_backend/crates/mobile/src/native_library.rs:371 — FunctionTooLong — mornye_mobile::native_library::import runs 202 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 102 over it, 2.02× 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: mornye_mobile::native_autoplay_taste::execute rust_backend/crates/mobile/src/native_autoplay_taste.rs:99 — FunctionTooLong — mornye_mobile::native_autoplay_taste::execute runs 192 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 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_link::subsonic::forward::call rust_backend/crates/link/src/subsonic/forward.rs:35 — FunctionTooLong — mornye_link::subsonic::forward::call runs 179 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 79 over it, 1.79× 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: mornye_extensions::download::segments::download rust_backend/crates/extensions/src/download/segments.rs:29 — FunctionTooLong — mornye_extensions::download::segments::download runs 178 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 78 over it, 1.78× 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: mornye_core::tags::write::riff::edit rust_backend/crates/core/src/tags/write/riff.rs:6 — FunctionTooLong — mornye_core::tags::write::riff::edit runs 174 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 74 over it, 1.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: mornye_extensions::file_host::call rust_backend/crates/extensions/src/file_host.rs:55 — FunctionTooLong — mornye_extensions::file_host::call runs 174 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 74 over it, 1.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: mornye_core::native_audio_analysis::estimate_spectral_cutoff rust_backend/crates/core/src/native_audio_analysis.rs:250 — FunctionTooLong — mornye_core::native_audio_analysis::estimate_spectral_cutoff runs 143 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 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_core::native_audio_analysis::analyze_automix_pcm rust_backend/crates/core/src/native_audio_analysis.rs:56 — FunctionTooLong — mornye_core::native_audio_analysis::analyze_automix_pcm runs 132 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 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_core::tags::write::ape::edit rust_backend/crates/core/src/tags/write/ape.rs:13 — FunctionTooLong — mornye_core::tags::write::ape::edit runs 130 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 30 over it, 1.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: mornye_core::tags::write::id3::read_frames rust_backend/crates/core/src/tags/write/id3.rs:220 — FunctionTooLong — mornye_core::tags::write::id3::read_frames runs 126 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 26 over it, 1.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: mornye_mobile::native_lyrics::lrc::parse_lrc rust_backend/crates/mobile/src/native_lyrics/lrc.rs:18 — FunctionTooLong — mornye_mobile::native_lyrics::lrc::parse_lrc runs 119 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 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_extensions::file_transform::transform rust_backend/crates/extensions/src/file_transform.rs:10 — FunctionTooLong — mornye_extensions::file_transform::transform runs 118 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 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_mobile::native_lyrics::ttml::parse_ttml rust_backend/crates/mobile/src/native_lyrics/ttml.rs:185 — FunctionTooLong — mornye_mobile::native_lyrics::ttml::parse_ttml runs 118 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 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_extensions::download_host::register rust_backend/crates/extensions/src/download_host.rs:6 — FunctionTooLong — mornye_extensions::download_host::register runs 116 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 16 over it, 1.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: mornye_core::tags::write::mp4::edit rust_backend/crates/core/src/tags/write/mp4.rs:21 — FunctionTooLong — mornye_core::tags::write::mp4::edit runs 115 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 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_mobile::native_listing::execute rust_backend/crates/mobile/src/native_listing.rs:8 — FunctionTooLong — mornye_mobile::native_listing::execute runs 113 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 13 over it, 1.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: mornye_mobile::native_backup::import rust_backend/crates/mobile/src/native_backup.rs:419 — FunctionTooLong — mornye_mobile::native_backup::import runs 112 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 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_core::tags::write::id3::edit_header rust_backend/crates/core/src/tags/write/id3.rs:48 — FunctionTooLong — mornye_core::tags::write::id3::edit_header runs 110 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 10 over it, 1.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: mornye_extensions::utility_host::register rust_backend/crates/extensions/src/utility_host.rs:7 — FunctionTooLong — mornye_extensions::utility_host::register runs 110 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 10 over it, 1.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: mornye_core::cue::parse rust_backend/crates/core/src/cue.rs:40 — FunctionTooLong — mornye_core::cue::parse runs 108 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 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mornye_extensions::download::segments::fetch rust_backend/crates/extensions/src/download/segments.rs:256 — FunctionTooLong — mornye_extensions::download::segments::fetch runs 105 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 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
X3 · Exception handling · Swallowed exception (empty catch) · ×22
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/prelude.js:127 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/prelude.js:129 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/prelude.js:131 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/prelude.js:531 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/prelude.js:569 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/prelude.js:570 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/prelude.js:594 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/provider.js:29 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/provider.js:31 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/provider.js:33 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/provider.js:53 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) rust_backend/crates/extensions/src/provider.js:327 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/cached_cover_image.dart:497 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/file_access.dart:258 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/logger.dart:259 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/lyrics_metadata_helper.dart:175 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/lyrics_metadata_helper.dart:191 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/path_match_keys.dart:126 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/path_match_keys.dart:132 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/path_match_keys.dart:146 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/path_match_keys.dart:157 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/utils/path_match_keys.dart:249 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D15 · Churn × Complexity Hotspots · Repeated repair · ×18
  • Repeated repair: lib/services/notification_service.dart lib/services/notification_service.dart:310 — lib/services/notification_service.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 12 (its worst body is NotificationService._details at line 310), 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(android): size notification mark for the status bar”; “fix(link): sync playback modes and restore queue covers”; “fix(notifications): handle Linux launch callbacks and contain queue alerts”; “fix(library): recover interrupted scans and stale notifications”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/notification_service.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: lib/services/link/sync/link_sync_protocol.dart lib/services/link/sync/link_sync_protocol.dart:209 — lib/services/link/sync/link_sync_protocol.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 13 (its worst body is LinkHistoryEvent.fromJson at line 209), 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(link): exchange missing listening statistics covers”; “fix(link): keep a song's network cover when a peer's edit comes back”; “fix(link): sync collection songs without network cover references”; “fix(link): sync no loopback artwork from older statistics”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/link/sync/link_sync_protocol.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: lib/services/library_native_adapter.dart lib/services/library_native_adapter.dart:213 — lib/services/library_native_adapter.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 7 (its worst body is LibraryNativeAdapter._import at line 213), 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(library): keep scanning when a row has no scan time or is invalid”; “fix(library): prune stale NAS rows outside failed scan paths”; “fix(desktop): report the desktop platform to native jobs and logs”; “fix(library): retry transient SQLite locks before scan transactions”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/library_native_adapter.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: rust_backend/crates/core/src/tags.rs rust_backend/crates/core/src/tags.rs:259 — rust_backend/crates/core/src/tags.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 10 (its worst body is mornye_core::tags::read_tags at line 259), 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(library): read Opus tags with large artwork”; “fix(downloads): trust the audio bytes over a provider's FLAC label”; “fix(library): index songs whose tags fail to parse”; “fix(metadata): read tags and covers from MP4 files named opus”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- rust_backend/crates/core/src/tags.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: lib/widgets/audio_quality_badges.dart lib/widgets/audio_quality_badges.dart:94 — lib/widgets/audio_quality_badges.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 ExplicitTrackTitle.build at line 94), 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(ui): align Material screens with the design guide”; “fix(ui): show Dolby Atmos as a compact logo”; “fix(ui): align explicit badges with track titles”; “fix(ui): align metadata and wrap track badges”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/widgets/audio_quality_badges.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: lib/screens/settings/keyboard_shortcuts_page.dart lib/screens/settings/keyboard_shortcuts_page.dart:19 — lib/screens/settings/keyboard_shortcuts_page.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 14 (its worst body is KeyboardShortcutsPage.build at line 19), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): keep Escape on the page and record every destination”; “fix(desktop): hide window controls in fullscreen”; “fix(desktop): list full screen and borderless shortcuts”; “fix(desktop): steady pull to refresh on macOS and add Cmd+R”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/screens/settings/keyboard_shortcuts_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.
  • Repeated repair: lib/services/link/desktop/link_catalog_exporter.dart lib/services/link/desktop/link_catalog_exporter.dart:351 — lib/services/link/desktop/link_catalog_exporter.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 6 (its worst body is LinkCatalogExporter.export at line 351), 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(link): export web cover copies as webCoverPath”; “fix(link): use a web cover copy only for songs without a picture”; “fix(link): serve desktop web-only covers from a lasting Link folder”; “fix(link): show a downloaded song's cover when a phone plays it”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/link/desktop/link_catalog_exporter.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: rust_backend/crates/mobile/src/library_metadata.rs rust_backend/crates/mobile/src/library_metadata.rs:87 — rust_backend/crates/mobile/src/library_metadata.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 9 (its worst body is mornye_mobile::library_metadata::read_library_metadata_from_descriptor at line 87), 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(covers): key library thumbnails by 128-bit SHA-256”; “fix(library): index songs whose tags fail to parse”; “fix(metadata): preserve original artwork resolution for SAF files”; “fix(android): preserve remote SAF descriptors for audio and artwork”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- rust_backend/crates/mobile/src/library_metadata.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: lib/services/media_library_browser.dart lib/services/media_library_browser.dart:571 — lib/services/media_library_browser.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 13 (its worst body is MediaLibraryBrowser.queueFor at line 571), 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(player): look for the cover provider again after a failure”; “fix(player): show local covers in Android Auto browse lists”; “fix(player): keep stored loopback covers out of the Android Auto browser”; “fix(library): keep scanned songs unplayable while Local Library is off”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/media_library_browser.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: rust_backend/crates/link/src/subsonic/covers.rs rust_backend/crates/link/src/subsonic/covers.rs:410 — rust_backend/crates/link/src/subsonic/covers.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 11 (its worst body is mornye_link::subsonic::covers::sniff at line 410), 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(link): rank web cover copies after every other cover”; “fix(link): key extracted cover pictures by their audio file”; “fix(link): fall back when a listed cover file is gone”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- rust_backend/crates/link/src/subsonic/covers.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: lib/providers/recent_access_provider.dart lib/providers/recent_access_provider.dart:142 — lib/providers/recent_access_provider.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 14 (its worst body is RecentAccessNotifier._loadHistory at line 142), 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(covers): keep temporary player covers out of Loved and recents”; “fix(recents): preserve early edits during history loading”; “fix(home): clear recent activity permanently”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/providers/recent_access_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: lib/widgets/explore_featured_section.dart lib/widgets/explore_featured_section.dart:19 — lib/widgets/explore_featured_section.dart changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ExploreFeaturedSection.build at line 19), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(home): run Material desktop Home across the whole pane”; “fix(home): anchor track menus to their source cards”; “fix(ui): resolve album titles and show Home explicit badges”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/widgets/explore_featured_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: lib/widgets/lyric_gap_indicator.dart lib/widgets/lyric_gap_indicator.dart:41 — lib/widgets/lyric_gap_indicator.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 13 (its worst body is _LyricGapIndicatorState.build at line 41), 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(lyrics): slow instrumental dot pulse”; “fix(lyrics): pulse instrumental dots in unison”; “fix(lyrics): pulse instrumental countdown dots”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/widgets/lyric_gap_indicator.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: macos/Runner/AppDelegate.swift macos/Runner/AppDelegate.swift:22 — macos/Runner/AppDelegate.swift changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is AppDelegate.application at line 22), 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(macos): keep one instance for debug builds too”; “fix(macos): give the Window menu the system tiling items”; “fix(desktop): report crashes only with evidence and keep one macOS instance”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- macos/Runner/AppDelegate.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: lib/services/link/features/link_phone_library.dart lib/services/link/features/link_phone_library.dart:393 — lib/services/link/features/link_phone_library.dart changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is LinkPhoneLibrary._build at line 393), 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(link): send a phone's large embedded covers shrunk”; “fix(link): fetch covers of downloaded phone songs on the desktop”; “fix(link): keep a phone's song list until its Library changes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/link/features/link_phone_library.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: android/app/src/main/kotlin/com/zarz/mornye/CoverContentProvider.kt android/app/src/main/kotlin/com/zarz/mornye/CoverContentProvider.kt:83 — android/app/src/main/kotlin/com/zarz/mornye/CoverContentProvider.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is CoverContentProvider.openCover at line 83), 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(android): close a cover descriptor on any failed check”; “fix(android): show local covers in Android Auto's queue view”; “fix(android): check cover names per folder and serve the opened file”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- android/app/src/main/kotlin/com/zarz/mornye/CoverContentProvider.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: lib/services/music_player_covers.dart lib/services/music_player_covers.dart:99 — lib/services/music_player_covers.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is _MusicCovers._show at line 99), 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(covers): keep a stored tag cover when a read has none”; “fix(covers): keep desktop covers fresh and drop removed tag covers”; “fix(covers): show a known tag cover and fetch changed covers on use”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/music_player_covers.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: lib/services/link/desktop/link_phone_playback.dart lib/services/link/desktop/link_phone_playback.dart:37 — lib/services/link/desktop/link_phone_playback.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is LinkPhonePlayback.send at line 37), 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(link): show stored covers on mirrored playback”; “fix(link): hold seek position until the playing device confirms”; “fix(link): resolve phone artwork on desktop and refresh late covers”. 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-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 19:09:37 +07:00' --until='2026-11-07 19:09:37 +07:00' --full-history --no-merges -- lib/services/link/desktop/link_phone_playback.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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×18
  • Swallowed exception (caught, then discarded) rust_backend/crates/extensions/src/prelude.js:527 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) lib/widgets/app_announcement_dialog.dart:40 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/audio_info_sheet.dart:173 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/lyrics_provider_picker.dart:140 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/lyrics_provider_picker.dart:154 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/playback_source_label.dart:14 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/file_access.dart:273 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/file_access.dart:356 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/file_access.dart:403 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/lyrics_parser.dart:802 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/lyrics_parser.dart:830 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/playback_artwork.dart:26 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/saf_display_path.dart:63 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/saf_display_path.dart:96 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/utils/saf_display_path.dart:135 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/theme/cover_palette.dart:214 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/services/apk_downloader.dart:175 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/services/apk_downloader.dart:213 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×17
  • Edited copy of a member (8 corresponding lines) lib/services/network_storage_service.dart:434 — lib/services/network_storage_service.dart:434-442 | lib/services/network_storage_service.dart:444-451 — 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) lib/widgets/track_collection_quick_actions.dart:649 — lib/widgets/track_collection_quick_actions.dart:649-656 | lib/widgets/track_collection_quick_actions.dart:658-667 — 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) lib/screens/library_tracks_folder_screen.dart:1127 — lib/screens/library_tracks_folder_screen.dart:1127-1134 | lib/screens/library_tracks_folder_screen.dart:1136-1145 — 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) lib/models/extension.dart:610 — lib/models/extension.dart:610-618 | lib/models/extension.dart:634-641 — 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) rust_backend/crates/providers/src/musicbrainz/http.rs:51 — rust_backend/crates/providers/src/musicbrainz/http.rs:51-58 | rust_backend/crates/providers/src/recognition.rs:410-417 — 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) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:44 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:44-51 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:139-146 — 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) lib/services/link/client/link_client_library.dart:97 — lib/services/link/client/link_client_library.dart:97-108 | lib/services/link/desktop/link_phone_library.dart:46-53 — 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) rust_backend/crates/link/src/auth.rs:77 — rust_backend/crates/link/src/auth.rs:77-85 | rust_backend/crates/link/src/catalog/text.rs:54-61 — 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) lib/providers/library_collections_provider.dart:399 — lib/providers/library_collections_provider.dart:399-406 | lib/providers/library_collections_provider.dart:408-415 — 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) lib/services/audio_analysis_cache.dart:47 — lib/services/audio_analysis_cache.dart:47-54 | lib/services/platform_bridge.dart:1838-1845 — 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) rust_backend/crates/extensions/src/repository/model.rs:135 — rust_backend/crates/extensions/src/repository/model.rs:135-143 | rust_backend/crates/extensions/src/signed_session/store.rs:86-93 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) rust_backend/crates/extensions/src/backend/metadata.rs:189 — rust_backend/crates/extensions/src/backend/metadata.rs:189-196 | rust_backend/crates/providers/src/resolver/availability/cache.rs:149-156 — 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) lib/services/exclusive_output_deck.dart:78 — lib/services/exclusive_output_deck.dart:78-85 | lib/services/media_kit_playback_deck.dart:534-541 — 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) lib/services/media_kit_playback_deck.dart:613 — lib/services/media_kit_playback_deck.dart:613-620 | lib/services/music_playback_deck.dart:354-361 — 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) lib/widgets/library_directory_view.dart:133 — lib/widgets/library_directory_view.dart:133-140 | lib/widgets/library_search_results.dart:161-168 — 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) lib/providers/recent_access_provider.dart:39 — lib/providers/recent_access_provider.dart:39-47 | lib/services/weekly_releases.dart:24-31 — 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) lib/services/link/features/link_phone_library_sync.dart:329 — lib/services/link/features/link_phone_library_sync.dart:329-336 | lib/services/link/features/link_phone_session.dart:87-96 — 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 · Duplicated block (7 lines × 2) · ×17
  • Duplicated block (7 lines × 2) lib/models/extension.dart:269 — lib/models/extension.dart:269-275 | lib/models/extension.dart:290-296 — both copies are in the same file, so extract the 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 `lib/models/extension.dart:269` 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) lib/screens/artist_screen.dart:332 — lib/screens/artist_screen.dart:332-338 | lib/screens/artist_screen.dart:381-388 — both copies are in the same file, so extract the 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 `lib/screens/artist_screen.dart:332` 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) lib/services/history_row_mapper.dart:75 — lib/services/history_row_mapper.dart:75-81 | lib/services/history_row_mapper.dart:97-103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) lib/widgets/audio_quality_badges.dart:178 — lib/widgets/audio_quality_badges.dart:178-184 | lib/widgets/audio_quality_badges.dart:190-196 — both copies are in the same file, so extract the 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 `lib/widgets/audio_quality_badges.dart:178` 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) lib/widgets/extension_row.dart:48 — lib/widgets/extension_row.dart:48-54 | lib/widgets/extension_row.dart:59-65 — both copies are in the same file, so extract the block into 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) lib/widgets/playlist_picker_sheet.dart:266 — lib/widgets/playlist_picker_sheet.dart:266-272 | lib/widgets/playlist_picker_sheet.dart:321-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) lib/services/link/desktop/link_desktop_host.dart:356 — lib/services/link/desktop/link_desktop_host.dart:356-362 | lib/services/link/features/link_phone_options.dart:79-85 — 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) lib/widgets/now_playing_indicator.dart:44 — lib/widgets/now_playing_indicator.dart:44-50 | lib/widgets/overflow_marquee.dart:42-48 — 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) lib/widgets/nav_destination_icons.dart:80 — lib/widgets/nav_destination_icons.dart:80-86 | lib/widgets/selection_bottom_bar.dart:222-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. 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) rust_backend/crates/core/src/native_audio_analysis.rs:154 — rust_backend/crates/core/src/native_audio_analysis.rs:154-160 | rust_backend/crates/core/src/native_audio_analysis.rs:171-177 — both copies are in the same file, so extract the 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 `rust_backend/crates/core/src/native_audio_analysis.rs:154` 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) rust_backend/crates/core/src/native_palette.rs:427 — rust_backend/crates/core/src/native_palette.rs:427-433 | rust_backend/crates/mobile/src/native_autoplay_taste.rs:16-22 — 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) rust_backend/crates/core/src/tags/containers.rs:180 — rust_backend/crates/core/src/tags/containers.rs:180-186 | rust_backend/crates/core/src/tags/write/id3.rs:224-230 — 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 `rust_backend/crates/core/src/tags/containers.rs:180` 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) rust_backend/crates/extensions/src/download/segment_store.rs:185 — rust_backend/crates/extensions/src/download/segment_store.rs:185-191 | rust_backend/crates/extensions/src/download/store.rs:159-165 — before extracting anything, compare `rust_backend/crates/extensions/src/download/segment_store.rs` and `rust_backend/crates/extensions/src/download/store.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) rust_backend/crates/mobile/src/usb_audio/transport.rs:112 — rust_backend/crates/mobile/src/usb_audio/transport.rs:112-118 | rust_backend/crates/mobile/src/usb_audio/transport.rs:127-133 — both copies are in the same file, so extract the block into 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) rust_backend/crates/network/src/url.rs:206 — rust_backend/crates/network/src/url.rs:206-212 | rust_backend/crates/network/src/url.rs:330-336 — both copies are in the same file, so extract the 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 `rust_backend/crates/network/src/url.rs:206` 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, `rust_backend/crates/network/src/url.rs:213` calls `is_empty`, `clone_from` and `rust_backend/crates/network/src/url.rs:337` 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) rust_backend/crates/providers/src/resolver/availability/cache.rs:100 — rust_backend/crates/providers/src/resolver/availability/cache.rs:100-106 | rust_backend/crates/providers/src/resolver/service.rs:83-89 — 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) rust_backend/crates/extensions/src/host.rs:183 — rust_backend/crates/extensions/src/host.rs:183-189 | rust_backend/crates/extensions/src/host.rs:192-198 — both copies are in the same file, so extract the 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 `rust_backend/crates/extensions/src/host.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.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×16
  • Edited copy of a member (13 corresponding lines) rust_backend/crates/mobile/src/native_backup/legacy.rs:46 — rust_backend/crates/mobile/src/native_backup/legacy.rs:46-58 | rust_backend/crates/mobile/src/native_backup/legacy.rs:74-91 — 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) lib/widgets/animation_utils.dart:1621 — lib/widgets/animation_utils.dart:1621-1633 | lib/widgets/animation_utils.dart:1685-1697 — 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) lib/widgets/audio_info_sheet.dart:305 — lib/widgets/audio_info_sheet.dart:305-319 | lib/widgets/metadata_editor_fields.dart:17-29 — 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) lib/models/extension.dart:268 — lib/models/extension.dart:268-280 | lib/models/extension.dart:289-301 — 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) lib/services/backup_service.dart:116 — lib/services/backup_service.dart:116-128 | lib/services/platform_bridge/bridge_library_scan.dart:19-32 — 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) lib/services/platform_bridge.dart:634 — lib/services/platform_bridge.dart:634-646 | lib/services/platform_bridge.dart:2393-2405 — 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) lib/screens/downloaded_album_screen.dart:825 — lib/screens/downloaded_album_screen.dart:825-841 | lib/screens/library_mix_screen.dart:212-224 — 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) lib/widgets/nav_destination_icons.dart:16 — lib/widgets/nav_destination_icons.dart:16-28 | lib/widgets/nav_destination_icons.dart:102-114 — 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) lib/providers/download_queue_state.dart:56 — lib/providers/download_queue_state.dart:56-69 | lib/widgets/pinned_section_sliver_list.dart:50-62 — 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) lib/screens/music_recognition_screen.dart:64 — lib/screens/music_recognition_screen.dart:64-76 | lib/screens/settings/lyrics_ai_translation_page.dart:363-376 — 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) lib/services/app_state_database.dart:117 — lib/services/app_state_database.dart:117-132 | lib/services/library_collections_database.dart:243-255 — 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) lib/services/notification_service.dart:623 — lib/services/notification_service.dart:623-635 | lib/services/notification_service.dart:676-691 — 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) rust_backend/crates/core/src/native_palette.rs:446 — rust_backend/crates/core/src/native_palette.rs:446-458 | rust_backend/crates/mobile/src/native_autoplay_taste.rs:34-47 — 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) lib/services/platform_bridge.dart:1297 — lib/services/platform_bridge.dart:1297-1309 | lib/services/platform_bridge.dart:1739-1753 — 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) lib/screens/album_screen.dart:877 — lib/screens/album_screen.dart:877-889 | lib/screens/playlist_screen.dart:541-556 — 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) rust_backend/crates/extensions/src/backend/lyrics.rs:35 — rust_backend/crates/extensions/src/backend/lyrics.rs:35-47 | rust_backend/crates/extensions/src/backend/tags.rs:22-37 — 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 · Duplicated block (10 lines × 2) · ×16
  • Duplicated block (10 lines × 2) lib/providers/track_provider.dart:412 — lib/providers/track_provider.dart:412-421 | lib/providers/track_provider.dart:478-488 — both copies are in the same file, so extract the 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 `lib/providers/track_provider.dart:412` 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) lib/screens/album_screen.dart:412 — lib/screens/album_screen.dart:412-421 | lib/screens/artist_screen.dart:570-579 — 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, `lib/screens/artist_screen.dart:580` calls `toString` and `lib/screens/album_screen.dart:422` 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 (10 lines × 2) lib/screens/artist_concerts_screen.dart:66 — lib/screens/artist_concerts_screen.dart:66-75 | lib/screens/concert_detail_screen.dart:175-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) lib/screens/downloaded_album_screen.dart:291 — lib/screens/downloaded_album_screen.dart:291-300 | lib/screens/local_album_screen.dart:335-344 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 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 `lib/screens/downloaded_album_screen.dart:291` 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) lib/screens/settings/app_settings_page.dart:150 — lib/screens/settings/app_settings_page.dart:150-159 | lib/screens/settings/app_settings_page.dart:184-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 `lib/screens/settings/app_settings_page.dart:150` 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, `lib/screens/settings/app_settings_page.dart:160` calls `read`, `setSaveDownloadHistory` and `lib/screens/settings/app_settings_page.dart:194` 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 (10 lines × 2) lib/screens/settings/lyrics_provider_priority_page.dart:315 — lib/screens/settings/lyrics_provider_priority_page.dart:315-324 | lib/widgets/reorderable_priority_item.dart:24-33 — 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 `lib/screens/settings/lyrics_provider_priority_page.dart:315` 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) lib/services/library_queue_store.dart:670 — lib/services/library_queue_store.dart:670-679 | lib/services/library_queue_store.dart:735-744 — both copies are in the same file, so extract the 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 `lib/services/library_queue_store.dart:670` 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) lib/theme/app_theme.dart:57 — lib/theme/app_theme.dart:57-66 | lib/theme/app_theme.dart:108-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 (10 lines × 2) lib/widgets/metadata_editor_fields.dart:189 — lib/widgets/metadata_editor_fields.dart:189-198 | lib/widgets/metadata_text_field.dart:54-63 — 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 `lib/widgets/metadata_editor_fields.dart:189` 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, `lib/widgets/metadata_editor_fields.dart:188` calls `circular` and `lib/widgets/metadata_text_field.dart:53` 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) REDACTED:214 — REDACTED:214-223 | REDACTED:631-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:214` 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 (10 lines × 2) REDACTED:588 — REDACTED:588-597 | REDACTED:620-629 — both copies are in the same file, so extract the 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 lines × 2) REDACTED:737 — REDACTED:737-746 | REDACTED:825-834 — both copies are in the same file, so extract the 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:737` 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 (10 lines × 2) rust_backend/crates/core/src/tags/write/id3.rs:116 — rust_backend/crates/core/src/tags/write/id3.rs:116-128 | rust_backend/crates/core/src/tags/write/mp4.rs:54-63 — 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 `rust_backend/crates/core/src/tags/write/id3.rs:116` 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) rust_backend/crates/extensions/src/signed_session/fetch.rs:32 — rust_backend/crates/extensions/src/signed_session/fetch.rs:32-41 | rust_backend/crates/extensions/src/signed_session/fetch.rs:49-58 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust_backend/crates/extensions/src/manager.rs:290 — rust_backend/crates/extensions/src/manager.rs:290-299 | rust_backend/crates/extensions/src/manager.rs:315-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust_backend/crates/extensions/src/download.rs:329 — rust_backend/crates/extensions/src/download.rs:329-338 | rust_backend/crates/extensions/src/download/chunked.rs:195-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_backend/crates/extensions/src/download.rs:339` calls `checkpoint` and `rust_backend/crates/extensions/src/download/chunked.rs:205` 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.
D2 · Cognitive Complexity · Backend · ×15
  • Backend::plan_download (cognitive 90) rust_backend/crates/extensions/src/backend/downloads.rs:168 — Backend::plan_download has cognitive complexity 90 (threshold 15). Drivers by points: if/else 40 (72 pts), boolean chains 10, match/switch 4 (7 pts), loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Backend::scan_library (cognitive 76) rust_backend/crates/extensions/src/backend/library/scan.rs:366 — Backend::scan_library has cognitive complexity 76 (threshold 15). Drivers by points: if/else 29 (52 pts), loops 10 (17 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Backend::download_attempt (cognitive 70) rust_backend/crates/extensions/src/backend/downloads.rs:661 — Backend::download_attempt has cognitive complexity 70 (threshold 15). Drivers by points: if/else 38 (49 pts), boolean chains 16, loops 2 (4 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
  • Backend::resolve_reenrich_request (cognitive 64) rust_backend/crates/extensions/src/backend/reenrich.rs:215 — Backend::resolve_reenrich_request has cognitive complexity 64 (threshold 15). Drivers by points: if/else 16 (51 pts), boolean chains 8, loops 1 (5 pts) (nesting depth added 39). 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.
  • Backend::reenrich_file (cognitive 54) rust_backend/crates/extensions/src/backend/reenrich.rs:21 — Backend::reenrich_file has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 5, loops 1, match/switch 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.
  • Backend::cache_cover (cognitive 43) rust_backend/crates/extensions/src/backend/cover.rs:331 — Backend::cache_cover has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29 (34 pts), boolean chains 6, match/switch 2 (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.
  • Backend::enrich_download_extended (cognitive 25) rust_backend/crates/extensions/src/backend/downloads.rs:1025 — Backend::enrich_download_extended has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 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.
  • Backend::edit_file_metadata (cognitive 24) rust_backend/crates/extensions/src/backend/tags.rs:77 — Backend::edit_file_metadata has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 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.
  • Backend::collect_library_files (cognitive 21) rust_backend/crates/extensions/src/backend/library/scan.rs:311 — Backend::collect_library_files has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 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.
  • Backend::reenrich_identifiers (cognitive 21) rust_backend/crates/extensions/src/backend/reenrich.rs:374 — Backend::reenrich_identifiers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 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.
  • Backend::handle_url_json (cognitive 20) rust_backend/crates/extensions/src/backend/provider_metadata.rs:15 — Backend::handle_url_json has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 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.
  • Backend::scan_audio_file (cognitive 19) rust_backend/crates/extensions/src/backend/library.rs:58 — Backend::scan_audio_file has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 3 (4 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.
  • Backend::resolve_cue_audio (cognitive 19) rust_backend/crates/extensions/src/backend/library.rs:156 — Backend::resolve_cue_audio has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Backend::download_verified_retry (cognitive 17) rust_backend/crates/extensions/src/backend/downloads.rs:444 — Backend::download_verified_retry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Backend::scan_cue_sheet (cognitive 17) rust_backend/crates/extensions/src/backend/library.rs:343 — Backend::scan_cue_sheet 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×14
  • Duplicated block (8 lines × 2) lib/providers/download_history_provider.dart:739 — lib/providers/download_history_provider.dart:739-746 | lib/providers/download_history_provider.dart:802-809 — both copies are in the same file, so extract the block into 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) lib/screens/main_shell.dart:623 — lib/screens/main_shell.dart:623-630 | lib/screens/main_shell.dart:640-649 — both copies are in the same file, so extract the 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 `lib/screens/main_shell.dart:623` 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 `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 (8 lines × 2) lib/services/link/features/link_phone_library_sync.dart:358 — lib/services/link/features/link_phone_library_sync.dart:358-365 | lib/services/link/features/link_phone_library_sync.dart:400-407 — both copies are in the same file, so extract the 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 `lib/services/link/features/link_phone_library_sync.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.
  • Duplicated block (8 lines × 2) lib/screens/album_screen.dart:164 — lib/screens/album_screen.dart:164-171 | lib/screens/extension_collection_screens.dart:451-458 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) lib/services/autoplay_ranker.dart:285 — lib/services/autoplay_ranker.dart:285-292 | lib/services/autoplay_taste.dart:637-644 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) lib/widgets/desktop/desktop_inspector.dart:470 — lib/widgets/desktop/desktop_inspector.dart:470-477 | lib/widgets/desktop/desktop_now_playing.dart:84-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) lib/widgets/expressive_seek_track.dart:42 — lib/widgets/expressive_seek_track.dart:42-49 | lib/widgets/now_playing_indicator.dart:59-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) rust_backend/crates/extensions/src/download.rs:231 — rust_backend/crates/extensions/src/download.rs:231-238 | rust_backend/crates/extensions/src/download.rs:363-370 — both copies are in the same file, so extract the 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 `rust_backend/crates/extensions/src/download.rs:231` 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 (8 lines × 2) rust_backend/crates/mobile/src/native_library/path_keys.rs:72 — rust_backend/crates/mobile/src/native_library/path_keys.rs:72-79 | rust_backend/crates/mobile/src/native_listing.rs:170-177 — 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 `rust_backend/crates/mobile/src/native_library/path_keys.rs:72` 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, `rust_backend/crates/mobile/src/native_listing.rs:179` calls `push_str` and `rust_backend/crates/mobile/src/native_library/path_keys.rs:80` 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 (8 lines × 2) rust_backend/crates/providers/src/musicbrainz/http.rs:27 — rust_backend/crates/providers/src/musicbrainz/http.rs:27-34 | rust_backend/crates/providers/src/resolver/http.rs:30-37 — 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 `rust_backend/crates/providers/src/musicbrainz/http.rs:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (8 lines × 2) rust_backend/crates/core/src/metadata/deezer.rs:142 — rust_backend/crates/core/src/metadata/deezer.rs:142-149 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:144-151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) rust_backend/crates/mobile/src/lyrics.rs:27 — rust_backend/crates/mobile/src/lyrics.rs:27-34 | rust_backend/crates/mobile/src/metadata.rs:5-12 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:53 — rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:53-60 | rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:117-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:50` calls `spotify_id`, `is_empty` and `rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:115` 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) rust_backend/crates/mobile/src/data_jobs.rs:184 — rust_backend/crates/mobile/src/data_jobs.rs:184-191 | rust_backend/crates/mobile/src/network_tags.rs:315-322 — 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.
D1 · Cyclomatic Complexity · mornye_mobile · ×13
  • mornye_mobile::native_autoplay_taste::execute (cyclomatic 42) rust_backend/crates/mobile/src/native_autoplay_taste.rs:99 — mornye_mobile::native_autoplay_taste::execute 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.
  • mornye_mobile::usb_audio::descriptors::parse (cyclomatic 40) rust_backend/crates/mobile/src/usb_audio/descriptors.rs:49 — mornye_mobile::usb_audio::descriptors::parse 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.
  • mornye_mobile::usb_audio::volume::feature (cyclomatic 27) rust_backend/crates/mobile/src/usb_audio/volume.rs:26 — mornye_mobile::usb_audio::volume::feature 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.
  • mornye_mobile::native_library::import (cyclomatic 24) rust_backend/crates/mobile/src/native_library.rs:371 — mornye_mobile::native_library::import 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.
  • mornye_mobile::native_library::path_keys::build (cyclomatic 24) rust_backend/crates/mobile/src/native_library/path_keys.rs:233 — mornye_mobile::native_library::path_keys::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.
  • mornye_mobile::native_lyrics::lrc::parse_lrc (cyclomatic 24) rust_backend/crates/mobile/src/native_lyrics/lrc.rs:18 — mornye_mobile::native_lyrics::lrc::parse_lrc 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.
  • mornye_mobile::native_listing::execute (cyclomatic 23) rust_backend/crates/mobile/src/native_listing.rs:8 — mornye_mobile::native_listing::execute 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.
  • mornye_mobile::native_backup::archive::read (cyclomatic 21) rust_backend/crates/mobile/src/native_backup/archive.rs:203 — mornye_mobile::native_backup::archive::read 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.
  • mornye_mobile::native_lyrics::ttml::parse_ttml (cyclomatic 21) rust_backend/crates/mobile/src/native_lyrics/ttml.rs:185 — mornye_mobile::native_lyrics::ttml::parse_ttml 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.
  • mornye_mobile::native_directory_stats::scan (cyclomatic 20) rust_backend/crates/mobile/src/native_directory_stats.rs:37 — mornye_mobile::native_directory_stats::scan 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.
  • mornye_mobile::native_lyrics::credits::with_credits (cyclomatic 19) rust_backend/crates/mobile/src/native_lyrics/credits.rs:25 — mornye_mobile::native_lyrics::credits::with_credits 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.
  • mornye_mobile::native_cache::unix::collect (cyclomatic 18) rust_backend/crates/mobile/src/native_cache/unix.rs:168 — mornye_mobile::native_cache::unix::collect 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.
  • mornye_mobile::usb_audio::descriptors::formats (cyclomatic 17) rust_backend/crates/mobile/src/usb_audio/descriptors.rs:177 — mornye_mobile::usb_audio::descriptors::formats 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×13
  • Duplicated block (9 lines × 2) lib/screens/home_tab_search_wide.dart:844 — lib/screens/home_tab_search_wide.dart:844-852 | lib/screens/home_tab_widgets.dart:469-477 — 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 `lib/screens/home_tab_search_wide.dart:844` 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) lib/screens/library_mix_screen.dart:216 — lib/screens/library_mix_screen.dart:216-224 | lib/screens/local_album_screen.dart:785-793 — before extracting anything, compare `lib/screens/library_mix_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 `lib/screens/library_mix_screen.dart:216` 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) lib/screens/settings/link_settings_page.dart:224 — lib/screens/settings/link_settings_page.dart:224-232 | lib/screens/settings/link_settings_page.dart:238-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 `lib/screens/settings/link_settings_page.dart: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 (9 lines × 2) lib/screens/tutorial_screen.dart:416 — lib/screens/tutorial_screen.dart:416-424 | lib/screens/tutorial_screen.dart:562-570 — both copies are in the same file, so extract the 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 `lib/screens/tutorial_screen.dart:416` 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) lib/services/history_schema.dart:82 — lib/services/history_schema.dart:82-90 | lib/services/library_schema.dart:104-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/history_schema.dart: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 (9 lines × 2) lib/services/library_row_mapper.dart:59 — lib/services/library_row_mapper.dart:59-67 | lib/services/library_schema.dart:364-372 — 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 `lib/services/library_row_mapper.dart:59` 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) lib/services/link/desktop/link_player.dart:352 — lib/services/link/desktop/link_player.dart:352-360 | lib/services/link/features/link_phone_player.dart:205-213 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) lib/widgets/library_directory_view.dart:145 — lib/widgets/library_directory_view.dart:145-153 | lib/widgets/library_search_results.dart:175-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 `lib/widgets/library_directory_view.dart:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) ios/Runner/AppDelegate.swift:111 — ios/Runner/AppDelegate.swift:111-119 | macos/Runner/AppDelegate.swift:11-19 — 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 (9 lines × 2) rust_backend/crates/extensions/src/download_host.rs:13 — rust_backend/crates/extensions/src/download_host.rs:13-21 | rust_backend/crates/extensions/src/download_host.rs:155-163 — both copies are in the same file, so extract the 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 `rust_backend/crates/extensions/src/download_host.rs:13` 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, `rust_backend/crates/extensions/src/download_host.rs:12` calls `register_segments`, `clone` and `rust_backend/crates/extensions/src/download_host.rs:154` 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 × 2) rust_backend/crates/providers/src/resolver/availability/cache.rs:215 — rust_backend/crates/providers/src/resolver/availability/cache.rs:215-223 | rust_backend/crates/providers/src/resolver/service.rs:136-144 — 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 `rust_backend/crates/providers/src/resolver/availability/cache.rs:215` 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) rust_backend/crates/core/src/native_palette.rs:246 — rust_backend/crates/core/src/native_palette.rs:246-254 | rust_backend/crates/core/src/native_palette.rs:257-265 — both copies are in the same file, so extract the 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 `v` to `&[i64]` in one and `&[f64]` 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) rust_backend/crates/extensions/src/manifest.rs:108 — rust_backend/crates/extensions/src/manifest.rs:108-116 | rust_backend/crates/extensions/src/manifest.rs:126-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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • Duplicated block (6 lines × 2) lib/models/extension.dart:123 — lib/models/extension.dart:123-128 | lib/providers/repo_provider.dart:70-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) lib/services/link/client/link_client_library.dart:110 — lib/services/link/client/link_client_library.dart:110-115 | lib/services/link/desktop/link_phone_library.dart:55-60 — before extracting anything, compare `lib/services/link/client/link_client_library.dart` and `lib/services/link/desktop/link_phone_library.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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. 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, `lib/services/link/client/link_client_library.dart:107` calls `_scan` and `lib/services/link/desktop/link_phone_library.dart:52` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) lib/services/link/features/link_phone_receiver.dart:120 — lib/services/link/features/link_phone_receiver.dart:120-125 | lib/services/link/features/link_phone_sender.dart:130-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) lib/services/media_kit_playback_deck.dart:723 — lib/services/media_kit_playback_deck.dart:723-729 | lib/services/music_playback_deck.dart:220-225 — 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) lib/services/media_session_mpris.dart:117 — lib/services/media_session_mpris.dart:117-122 | lib/services/media_session_smtc.dart:140-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) lib/widgets/library_directory_view.dart:126 — lib/widgets/library_directory_view.dart:126-131 | lib/widgets/library_search_results.dart:154-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 (6 lines × 2) lib/widgets/lyric_blur.dart:182 — lib/widgets/lyric_blur.dart:182-187 | lib/widgets/settled_blur.dart:205-211 — 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) rust_backend/crates/core/src/lyrics/payloads.rs:400 — rust_backend/crates/core/src/lyrics/payloads.rs:400-405 | rust_backend/crates/core/src/lyrics/payloads/ttml.rs:35-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_backend/crates/core/src/lyrics/payloads.rs:400` 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 × 2) rust_backend/crates/extensions/src/binary.rs:41 — rust_backend/crates/extensions/src/binary.rs:41-46 | rust_backend/crates/extensions/src/download/chunked.rs:344-349 — 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 `rust_backend/crates/extensions/src/binary.rs:41` 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) rust_backend/crates/extensions/src/download/segment_store.rs:212 — rust_backend/crates/extensions/src/download/segment_store.rs:212-217 | rust_backend/crates/extensions/src/download/store.rs:187-192 — before extracting anything, compare `rust_backend/crates/extensions/src/download/segment_store.rs` and `rust_backend/crates/extensions/src/download/store.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust_backend/crates/mobile/src/native_library/path_keys.rs:29 — rust_backend/crates/mobile/src/native_library/path_keys.rs:29-34 | rust_backend/crates/mobile/src/native_listing.rs:152-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.
  • Duplicated block (6 lines × 2) rust_backend/crates/extensions/src/download/segment_store.rs:43 — rust_backend/crates/extensions/src/download/segment_store.rs:43-48 | rust_backend/crates/extensions/src/download/store.rs:37-42 — before extracting anything, compare `rust_backend/crates/extensions/src/download/segment_store.rs` and `rust_backend/crates/extensions/src/download/store.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 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 `rust_backend/crates/extensions/src/download/segment_store.rs:43` 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) rust_backend/crates/extensions/src/backend/provider_metadata.rs:281 — rust_backend/crates/extensions/src/backend/provider_metadata.rs:281-286 | rust_backend/crates/extensions/src/lyrics.rs:104-109 — before extracting anything, compare `rust_backend/crates/extensions/src/backend/provider_metadata.rs` and `rust_backend/crates/extensions/src/lyrics.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 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 `rust_backend/crates/extensions/src/backend/provider_metadata.rs:281` 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.
D1 · Cyclomatic Complexity · mornye_extensions · ×12
  • mornye_extensions::download::chunked::download (cyclomatic 51) rust_backend/crates/extensions/src/download/chunked.rs:14 — mornye_extensions::download::chunked::download 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.
  • mornye_extensions::download::download (cyclomatic 47) rust_backend/crates/extensions/src/download.rs:129 — mornye_extensions::download::download 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.
  • mornye_extensions::file_transform::transform (cyclomatic 30) rust_backend/crates/extensions/src/file_transform.rs:10 — mornye_extensions::file_transform::transform 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.
  • mornye_extensions::download::segments::download (cyclomatic 28) rust_backend/crates/extensions/src/download/segments.rs:29 — mornye_extensions::download::segments::download 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.
  • mornye_extensions::file_host::call (cyclomatic 26) rust_backend/crates/extensions/src/file_host.rs:55 — mornye_extensions::file_host::call 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.
  • mornye_extensions::backend::health::classify_body (cyclomatic 23) rust_backend/crates/extensions/src/backend/health.rs:464 — mornye_extensions::backend::health::classify_body 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.
  • mornye_extensions::download::segments::fetch (cyclomatic 22) rust_backend/crates/extensions/src/download/segments.rs:256 — mornye_extensions::download::segments::fetch 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.
  • mornye_extensions::manager::metadata::track_input (cyclomatic 17) rust_backend/crates/extensions/src/manager/metadata.rs:314 — mornye_extensions::manager::metadata::track_input 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.
  • mornye_extensions::runtime::vm::run_worker (cyclomatic 17) rust_backend/crates/extensions/src/runtime/vm.rs:13 — mornye_extensions::runtime::vm::run_worker 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.
  • mornye_extensions::backend::downloads::metadata::download_metadata_fields (cyclomatic 16) rust_backend/crates/extensions/src/backend/downloads/metadata.rs:45 — mornye_extensions::backend::downloads::metadata::download_metadata_fields 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.
  • mornye_extensions::backend::downloads::result::success (cyclomatic 16) rust_backend/crates/extensions/src/backend/downloads/result.rs:10 — mornye_extensions::backend::downloads::result::success 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.
  • mornye_extensions::crypto_host::segments (cyclomatic 16) rust_backend/crates/extensions/src/crypto_host.rs:177 — mornye_extensions::crypto_host::segments 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 (12 corresponding lines) · ×11
  • Edited copy of a member (12 corresponding lines) lib/services/link/link_protocol.dart:863 — lib/services/link/link_protocol.dart:863-876 | lib/services/link/link_protocol.dart:903-914 — 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) rust_backend/crates/providers/src/resolver/availability/cache.rs:81 — rust_backend/crates/providers/src/resolver/availability/cache.rs:81-92 | rust_backend/crates/providers/src/resolver/service.rs:69-80 — 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) lib/services/history_schema.dart:231 — lib/services/history_schema.dart:231-251 | lib/services/library_schema.dart:337-348 — 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) rust_backend/crates/network/src/url.rs:351 — rust_backend/crates/network/src/url.rs:351-362 | rust_backend/crates/network/src/url.rs:409-423 — 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) lib/models/library_database_models.dart:358 — lib/models/library_database_models.dart:358-369 | lib/services/history_database.dart:66-77 — 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) lib/services/app_orientation.dart:86 — lib/services/app_orientation.dart:86-99 | lib/services/shell_navigation_service.dart:348-359 — 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) lib/models/extension.dart:489 — lib/models/extension.dart:489-500 | lib/models/extension.dart:540-554 — 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) lib/services/platform_bridge.dart:2124 — lib/services/platform_bridge.dart:2124-2137 | lib/services/platform_bridge.dart:2139-2150 — 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) lib/services/library_collections_database.dart:739 — lib/services/library_collections_database.dart:739-752 | lib/services/app_state_database.dart:643-654 — 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) lib/services/history_database.dart:595 — lib/services/history_database.dart:595-607 | lib/services/library_database.dart:1047-1058 — 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) lib/services/network_offline_saver.dart:99 — lib/services/network_offline_saver.dart:99-110 | lib/services/network_playback_cache.dart:41-52 — 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.
D35 · Change Coupling · Change coupling · ×9
  • Change coupling: album_screen.dart ↔ playlist_screen.dart lib/screens/album_screen.dart:1 — `lib/screens/album_screen.dart` and `lib/screens/playlist_screen.dart` change together 77% of the time (66 of the 86 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 66 shared commits counted here, the most recent 3 are `b336075b` perf(library): match collection history keys once per page data; `d58565d2` feat(library): suggest songs under albums, singles and playlists; `da528689` chore(link): drop imports the Link actions now export — run `git show` on any of them.
  • Change coupling: downloaded_album_screen.dart ↔ local_album_screen.dart lib/screens/downloaded_album_screen.dart:1 — `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` change together 71% of the time (59 of the 83 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 59 shared commits counted here, the most recent 3 are `90e662b3` feat(library): upload local songs to network storage; `ac93828a` refactor(covers): show screen covers through the shared helper; `d58565d2` feat(library): suggest songs under albums, singles and playlists — run `git show` on any of them.
  • Change coupling: download_settings_page.dart ↔ metadata_settings_page.dart lib/screens/settings/download_settings_page.dart:1 — `lib/screens/settings/download_settings_page.dart` and `lib/screens/settings/metadata_settings_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 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 `78f60e75` refactor: push plain material pages through pushPage; `101740d8` refactor(settings): move download, metadata and files pages to shared…; `37466432` fix(settings): keep final controls clear of floating playback bars — run `git show` on any of them.
  • Change coupling: files_settings_page.dart ↔ metadata_settings_page.dart lib/screens/settings/files_settings_page.dart:1 — `lib/screens/settings/files_settings_page.dart` and `lib/screens/settings/metadata_settings_page.dart` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `78f60e75` refactor: push plain material pages through pushPage; `101740d8` refactor(settings): move download, metadata and files pages to shared…; `37466432` fix(settings): keep final controls clear of floating playback bars — run `git show` on any of them.
  • Change coupling: app_settings_page.dart ↔ appearance_settings_page.dart lib/screens/settings/app_settings_page.dart:1 — `lib/screens/settings/app_settings_page.dart` and `lib/screens/settings/appearance_settings_page.dart` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 `3687e183` refactor(settings): use the shared section slivers and confirm dialog; `37466432` fix(settings): keep final controls clear of floating playback bars; `736cfcd0` feat(settings): connect custom Material settings rows — run `git show` on any of them.
  • Change coupling: desktop_navigation.dart ↔ desktop_shortcuts.dart lib/widgets/desktop/desktop_navigation.dart:1 — `lib/widgets/desktop/desktop_navigation.dart` and `lib/widgets/desktop/desktop_shortcuts.dart` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 8 shared commits counted here, the most recent 3 are `708efa4e` feat(mornye): Music's glass inspector, player actions and Home text; `d4cba0aa` fix(player): hide internal playback UI in external mode; `a985ea0e` feat(desktop): expand the Material rail and list playlists in it — run `git show` on any of them.
  • Change coupling: MainActivitySafIo.kt ↔ REDACTED android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafIo.kt:1 — `android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafIo.kt` and `REDACTED` 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `0895e9ae` perf(android): stream unchanged CUE scans and retain metadata objects; `a19a5287` refactor(android): put the SAF IO helpers on Context receivers (at that commit the files were still `android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafIo.kt` and `android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt`); `ca747f8c` fix(android): release temporary media on failed SAF operations (at that commit the files were still `android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafIo.kt` and `android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt`) — run `git show` on any of them.
  • Change coupling: music_player_gapless.dart ↔ music_player_runtime.dart lib/services/music_player_gapless.dart:1 — `lib/services/music_player_gapless.dart` and `lib/services/music_player_runtime.dart` 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 `4cec4086` fix(playback): remove missing files from the active queue; `5f3d6fa2` fix(ios): play formats AVPlayer cannot open and skip unplayable songs; `e90f5e89` feat(network): prefetch upcoming NAS songs to a local cache — run `git show` on any of them.
  • Change coupling: link_phone_features.dart ↔ link_protocol.dart lib/services/link/features/link_phone_features.dart:1 — `lib/services/link/features/link_phone_features.dart` and `lib/services/link/link_protocol.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 `363f5063` fix(link): delete shared phone songs from desktop; `74d52728` fix(link): sync AI lyrics translations across devices; `faab457b` feat(link): add desktop device picker and file activity — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×9
  • Edited copy of a member (16 corresponding lines) rust_backend/crates/extensions/src/manager.rs:281 — rust_backend/crates/extensions/src/manager.rs:281-304 | rust_backend/crates/extensions/src/manager.rs:313-328 — 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) lib/services/link/link_protocol.dart:544 — lib/services/link/link_protocol.dart:544-562 | lib/services/link/sync/link_sync_protocol.dart:333-348 — 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) lib/providers/music_recognition_provider.dart:130 — lib/providers/music_recognition_provider.dart:130-145 | lib/providers/music_recognition_provider.dart:147-165 — 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) lib/screens/settings/log_screen.dart:123 — lib/screens/settings/log_screen.dart:123-138 | lib/screens/settings/log_screen.dart:200-216 — 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) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:970 — android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:970-990 | android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerHistory.kt:7-22 — 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) rust_backend/crates/core/src/fs.rs:98 — rust_backend/crates/core/src/fs.rs:98-113 | rust_backend/crates/extensions/src/download/store.rs:213-231 — 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) lib/screens/now_playing_screen.dart:846 — lib/screens/now_playing_screen.dart:846-861 | lib/screens/now_playing_screen.dart:867-883 — 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) lib/services/media_session_art_cache.dart:80 — lib/services/media_session_art_cache.dart:80-95 | lib/services/media_session_art_cache.dart:97-112 — 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) lib/services/autoplay_taste.dart:646 — lib/services/autoplay_taste.dart:646-671 | lib/services/listening_statistics.dart:302-317 — 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 (15 corresponding lines) · ×8
  • Edited copy of a member (15 corresponding lines) rust_backend/crates/desktop/src/paths.rs:68 — rust_backend/crates/desktop/src/paths.rs:68-82 | rust_backend/crates/providers/src/recognition.rs:420-441 — 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) lib/services/ffmpeg_support.dart:26 — lib/services/ffmpeg_support.dart:26-45 | lib/services/ffmpeg_support.dart:69-83 — 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) lib/services/lyrics_translation.dart:692 — lib/services/lyrics_translation.dart:692-706 | lib/services/lyrics_translation_sharing.dart:28-44 — 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) rust_backend/crates/core/src/isrc/native_files.rs:79 — rust_backend/crates/core/src/isrc/native_files.rs:79-93 | rust_backend/crates/extensions/src/files/index.rs:77-91 — 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) rust_backend/crates/network/src/client.rs:180 — rust_backend/crates/network/src/client.rs:180-195 | rust_backend/crates/network/src/client.rs:199-213 — 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) rust_backend/crates/extensions/src/download/segment_store.rs:168 — rust_backend/crates/extensions/src/download/segment_store.rs:168-182 | rust_backend/crates/extensions/src/download/store.rs:141-156 — 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) lib/services/link/desktop/link_desktop_transfers.dart:390 — lib/services/link/desktop/link_desktop_transfers.dart:390-404 | lib/services/link/features/link_phone_receiver.dart:346-363 — 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) lib/services/notification_service.dart:370 — lib/services/notification_service.dart:370-388 | lib/services/notification_service.dart:390-404 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×8
  • Edited copy of a member (7 corresponding lines) lib/services/link/client/link_client_library.dart:161 — lib/services/link/client/link_client_library.dart:161-169 | lib/services/link/desktop/link_phone_library.dart:110-116 — 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) lib/screens/library_tracks_folder_screen.dart:574 — lib/screens/library_tracks_folder_screen.dart:574-582 | lib/screens/main_shell.dart:371-377 — 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) lib/services/link/client/link_client_library.dart:39 — lib/services/link/client/link_client_library.dart:39-49 | lib/services/link/desktop/link_phone_library.dart: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) rust_backend/crates/link/src/files.rs:212 — rust_backend/crates/link/src/files.rs:212-218 | rust_backend/crates/link/src/subsonic/browse.rs:356-363 — 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) rust_backend/crates/mobile/src/native_backup.rs:131 — rust_backend/crates/mobile/src/native_backup.rs:131-137 | rust_backend/crates/mobile/src/native_library.rs:168-174 — 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) rust_backend/crates/link/src/catalog/parse.rs:110 — rust_backend/crates/link/src/catalog/parse.rs:110-116 | rust_backend/crates/link/src/subsonic/forward.rs:454-460 — 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) lib/services/media_session_mpris.dart:246 — lib/services/media_session_mpris.dart:246-253 | lib/services/media_session_smtc.dart:263-269 — 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) lib/services/link/link_client_api.dart:27 — lib/services/link/link_client_api.dart:27-33 | lib/services/link/link_protocol.dart:854-861 — 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 (5 lines × 2) · ×8
  • Duplicated block (5 lines × 2) lib/services/ffmpeg_conversion.dart:425 — lib/services/ffmpeg_conversion.dart:425-429 | lib/services/ffmpeg_conversion.dart:505-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/ffmpeg_conversion.dart:425` 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) android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt:125 — android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt:125-129 | android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt:135-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt:125` 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) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:233 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:233-237 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:260-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.
  • Duplicated block (5 lines × 2) rust_backend/crates/core/src/tags/write/mp4.rs:140 — rust_backend/crates/core/src/tags/write/mp4.rs:140-144 | rust_backend/crates/core/src/tags/write/mp4/ac4.rs:230-234 — 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 `rust_backend/crates/core/src/tags/write/mp4.rs:140` 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) rust_backend/crates/extensions/src/download/segment_store.rs:64 — rust_backend/crates/extensions/src/download/segment_store.rs:64-68 | rust_backend/crates/extensions/src/download/store.rs:59-65 — before extracting anything, compare `rust_backend/crates/extensions/src/download/segment_store.rs` and `rust_backend/crates/extensions/src/download/store.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 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 `rust_backend/crates/extensions/src/download/segment_store.rs:64` 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) rust_backend/crates/mobile/src/cancellation.rs:52 — rust_backend/crates/mobile/src/cancellation.rs:52-56 | rust_backend/crates/mobile/src/progress.rs:39-43 — 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) rust_backend/crates/mobile/src/native_backup.rs:138 — rust_backend/crates/mobile/src/native_backup.rs:138-142 | rust_backend/crates/mobile/src/native_library.rs:204-208 — 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) rust_backend/crates/link/src/subsonic/objects.rs:36 — rust_backend/crates/link/src/subsonic/objects.rs:36-40 | rust_backend/crates/link/src/subsonic/objects.rs:95-99 — both copies are in the same file, so extract the 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 · Backend · ×7
  • Backend::plan_download (cyclomatic 50) rust_backend/crates/extensions/src/backend/downloads.rs:168 — Backend::plan_download 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.
  • Backend::download_attempt (cyclomatic 50) rust_backend/crates/extensions/src/backend/downloads.rs:661 — Backend::download_attempt has cyclomatic complexity 50 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Backend::scan_library (cyclomatic 39) rust_backend/crates/extensions/src/backend/library/scan.rs:366 — Backend::scan_library 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.
  • Backend::cache_cover (cyclomatic 32) rust_backend/crates/extensions/src/backend/cover.rs:331 — Backend::cache_cover 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.
  • Backend::reenrich_file (cyclomatic 26) rust_backend/crates/extensions/src/backend/reenrich.rs:21 — Backend::reenrich_file 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.
  • Backend::resolve_reenrich_request (cyclomatic 26) rust_backend/crates/extensions/src/backend/reenrich.rs:215 — Backend::resolve_reenrich_request 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.
  • Backend::edit_file_metadata (cyclomatic 18) rust_backend/crates/extensions/src/backend/tags.rs:77 — Backend::edit_file_metadata 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×7
  • Edited copy of a member (11 corresponding lines) lib/screens/settings/library_settings_page_widgets.dart:48 — lib/screens/settings/library_settings_page_widgets.dart:48-58 | lib/screens/settings/library_settings_page_widgets.dart:318-329 — 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) rust_backend/crates/core/src/filename/template.rs:135 — rust_backend/crates/core/src/filename/template.rs:135-146 | rust_backend/crates/core/src/filename/template.rs:148-158 — 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) rust_backend/crates/providers/src/lyrics/service.rs:115 — rust_backend/crates/providers/src/lyrics/service.rs:115-126 | rust_backend/crates/providers/src/lyrics/service.rs:137-147 — 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) lib/services/platform_bridge.dart:2775 — lib/services/platform_bridge.dart:2775-2785 | lib/services/platform_bridge.dart:2809-2820 — 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) lib/widgets/duplicate_review_sheet.dart:35 — lib/widgets/duplicate_review_sheet.dart:35-45 | lib/widgets/open_on_platform_sheet.dart:19-33 — 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) lib/widgets/animation_utils.dart:732 — lib/widgets/animation_utils.dart:732-742 | lib/widgets/animation_utils.dart:802-812 — 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) lib/screens/queue_tab_helpers.dart:141 — lib/screens/queue_tab_helpers.dart:141-151 | lib/screens/queue_tab_helpers.dart:153-167 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×7
  • Edited copy of a member (10 corresponding lines) lib/services/apk_downloader.dart:202 — lib/services/apk_downloader.dart:202-216 | lib/services/backup_service.dart:484-493 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:261 — android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:261-270 | android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:339-349 — 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) rust_backend/crates/core/src/media/mp4.rs:115 — rust_backend/crates/core/src/media/mp4.rs:115-124 | rust_backend/crates/core/src/tags/mp4.rs:141-150 — 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) lib/services/cast_playback_deck.dart:155 — lib/services/cast_playback_deck.dart:155-164 | lib/services/media_kit_playback_deck.dart:629-638 — 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) lib/screens/settings/library_settings_page.dart:350 — lib/screens/settings/library_settings_page.dart:350-361 | lib/screens/settings/lyrics_settings_page.dart:193-202 — 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) rust_backend/crates/mobile/src/manager.rs:274 — rust_backend/crates/mobile/src/manager.rs:274-284 | rust_backend/crates/mobile/src/metadata.rs:30-39 — 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) rust_backend/crates/mobile/src/manager.rs:293 — rust_backend/crates/mobile/src/manager.rs:293-303 | rust_backend/crates/mobile/src/metadata.rs:47-56 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×7
  • Edited copy of a member (5 corresponding lines) rust_backend/crates/extensions/src/backend.rs:61 — rust_backend/crates/extensions/src/backend.rs:61-65 | rust_backend/crates/extensions/src/manager.rs:94-98 — 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) lib/services/history_database.dart:609 — lib/services/history_database.dart:609-613 | lib/services/library_database.dart:1060-1066 — 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) lib/services/music_player_service.dart:2456 — lib/services/music_player_service.dart:2456-2460 | lib/services/remote_media_session.dart:143-147 — 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) lib/widgets/expressive_seek_track.dart:51 — lib/widgets/expressive_seek_track.dart:51-55 | lib/widgets/now_playing_indicator.dart:68-72 — 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) lib/theme/player_artwork_theme.dart:82 — lib/theme/player_artwork_theme.dart:82-86 | lib/widgets/material_player_backdrop.dart:261-265 — 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) rust_backend/crates/mobile/src/lyrics.rs:45 — rust_backend/crates/mobile/src/lyrics.rs:45-49 | rust_backend/crates/mobile/src/metadata.rs:96-100 — 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) rust_backend/crates/mobile/src/lyrics.rs:94 — rust_backend/crates/mobile/src/lyrics.rs:94-98 | rust_backend/crates/mobile/src/metadata.rs:149-153 — 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 (12 lines × 2) · ×7
  • Duplicated block (12 lines × 2) lib/screens/home_tab_intro.dart:1217 — lib/screens/home_tab_intro.dart:1217-1228 | lib/screens/home_tab_intro.dart:1264-1275 — both copies are in the same file, so extract the 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 `lib/screens/home_tab_intro.dart:1217` 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 (12 lines × 2) lib/screens/settings/library_settings_page.dart:272 — lib/screens/settings/library_settings_page.dart:272-283 | lib/screens/settings/library_settings_page.dart:314-325 — both copies are in the same file, so extract the 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 `lib/screens/settings/library_settings_page.dart:272` 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) lib/services/link/desktop/link_catalog_exporter.dart:373 — lib/services/link/desktop/link_catalog_exporter.dart:373-384 | lib/services/link/features/link_phone_library.dart:406-418 — 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 `lib/services/link/desktop/link_catalog_exporter.dart:373` 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) lib/widgets/animation_utils.dart:926 — lib/widgets/animation_utils.dart:926-937 | lib/widgets/animation_utils.dart:1004-1015 — both copies are in the same file, so extract the 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 `lib/widgets/animation_utils.dart:926` 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) lib/widgets/lyrics_size_setting.dart:27 — lib/widgets/lyrics_size_setting.dart:27-38 | lib/widgets/lyrics_size_setting.dart:101-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/lyrics_size_setting.dart:27` 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 (12 lines × 2) rust_backend/crates/extensions/src/backend/provider_metadata.rs:140 — rust_backend/crates/extensions/src/backend/provider_metadata.rs:140-151 | rust_backend/crates/extensions/src/backend/provider_metadata.rs:183-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 `rust_backend/crates/extensions/src/backend/provider_metadata.rs:140` 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) rust_backend/crates/desktop/src/paths.rs:71 — rust_backend/crates/desktop/src/paths.rs:71-82 | rust_backend/crates/providers/src/recognition.rs:430-441 — 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 `rust_backend/crates/desktop/src/paths.rs:71` 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 · Edited copy of a member (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) lib/providers/explore_provider.dart:65 — lib/providers/explore_provider.dart:65-83 | lib/providers/repo_provider.dart:68-84 — 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) rust_backend/crates/mobile/src/native_library/path_keys.rs:69 — rust_backend/crates/mobile/src/native_library/path_keys.rs:69-85 | rust_backend/crates/mobile/src/native_listing.rs:167-185 — 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) lib/services/history_database.dart:290 — lib/services/history_database.dart:290-306 | lib/services/history_database.dart:308-327 — 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) lib/providers/local_library_provider.dart:767 — lib/providers/local_library_provider.dart:767-785 | lib/services/library_database.dart:682-698 — 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) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:357 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:357-373 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:375-391 — 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) lib/services/lastfm/lastfm_service.dart:262 — lib/services/lastfm/lastfm_service.dart:262-278 | lib/services/lastfm/lastfm_service.dart:430-447 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×6
  • Edited copy of a member (9 corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt:121 — android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt:121-129 | android/app/src/main/kotlin/com/zarz/mornye/AppCrashReporter.kt:131-140 — 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) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:156 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:156-164 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:196-205 — 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) lib/screens/downloaded_album_screen.dart:843 — lib/screens/downloaded_album_screen.dart:843-851 | lib/screens/local_album_screen.dart:796-804 — 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) lib/widgets/desktop/desktop_mini_player.dart:115 — lib/widgets/desktop/desktop_mini_player.dart:115-123 | lib/widgets/desktop/desktop_now_playing.dart:96-106 — 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) lib/screens/album_screen.dart:115 — lib/screens/album_screen.dart:115-123 | lib/screens/artist_screen.dart:205-213 — 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) scripts/check_backend_apk.py:172 — scripts/check_backend_apk.py:172-180 | scripts/check_backend_ios.py:233-241 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×6
  • Edited copy of a member (6 corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/DsdSource.kt:50 — android/app/src/main/kotlin/com/zarz/mornye/DsdSource.kt:50-55 | android/app/src/main/kotlin/com/zarz/mornye/DsdFile.kt:127-132 — 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) rust_backend/crates/desktop/src/call.rs:112 — rust_backend/crates/desktop/src/call.rs:112-117 | rust_backend/crates/link/src/types.rs:144-150 — 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) rust_backend/crates/extensions/src/backend.rs:290 — rust_backend/crates/extensions/src/backend.rs:290-295 | rust_backend/crates/extensions/src/repository.rs:171-176 — 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) rust_backend/crates/extensions/src/backend/metadata.rs:33 — rust_backend/crates/extensions/src/backend/metadata.rs:33-38 | rust_backend/crates/providers/src/deezer.rs:232-237 — 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) rust_backend/crates/link/src/types.rs:154 — rust_backend/crates/link/src/types.rs:154-159 | rust_backend/crates/mobile/src/native_lyrics_translation.rs:27-32 — 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) lib/widgets/desktop/desktop_mini_player.dart:316 — lib/widgets/desktop/desktop_mini_player.dart:316-321 | lib/widgets/player_lyrics_word_sweep.dart:132-138 — 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 · Edited copy of a member (4 corresponding lines) · ×6
  • Edited copy of a member (4 corresponding lines) rust_backend/crates/mobile/src/network_tags.rs:270 — rust_backend/crates/mobile/src/network_tags.rs:270-275 | rust_backend/crates/providers/src/lyrics/builtin/ttml.rs:29-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) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:528 — android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:528-531 | android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:454-457 — 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) lib/screens/equalizer_widgets.dart:807 — lib/screens/equalizer_widgets.dart:807-810 | lib/widgets/desktop/link_text_input_dialog.dart:63-66 — 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) rust_backend/crates/link/src/subsonic/forward.rs:363 — rust_backend/crates/link/src/subsonic/forward.rs:363-366 | rust_backend/crates/link/src/subsonic/objects.rs:157-160 — 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) lib/screens/library_mix_screen.dart:112 — lib/screens/library_mix_screen.dart:112-115 | lib/widgets/library_directory_view.dart:109-112 — 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) lib/services/media_kit_playback_deck.dart:498 — lib/services/media_kit_playback_deck.dart:498-501 | lib/services/network_playback_cache.dart:312-315 — 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) · ×6
  • Duplicated block (16 lines × 2) lib/screens/home_tab_search_wide.dart:507 — lib/screens/home_tab_search_wide.dart:507-522 | lib/screens/home_tab_search_wide.dart:648-663 — both copies are in the same file, so extract the 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, `lib/screens/home_tab_search_wide.dart:666` calls `circular` and `lib/screens/home_tab_search_wide.dart:523` 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 (16 lines × 2) lib/screens/settings/about_page.dart:445 — lib/screens/settings/about_page.dart:445-460 | lib/screens/settings/about_page.dart:682-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 `lib/screens/settings/about_page.dart:445` 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 after the matched lines, `lib/screens/settings/about_page.dart:698` calls `SettingsSearchTarget` and `lib/screens/settings/about_page.dart:461` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) lib/services/link/link_protocol.dart:253 — lib/services/link/link_protocol.dart:253-268 | lib/services/link/link_protocol.dart:662-677 — both copies are in the same file, so extract the block into 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) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:270 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:270-285 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:304-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:270` 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) rust_backend/crates/cast/src/media.rs:400 — rust_backend/crates/cast/src/media.rs:400-415 | rust_backend/crates/link/src/subsonic/media.rs:181-196 — 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 `rust_backend/crates/cast/src/media.rs:400` 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) rust_backend/crates/extensions/src/backend/provider_metadata.rs:290 — rust_backend/crates/extensions/src/backend/provider_metadata.rs:290-305 | rust_backend/crates/extensions/src/lyrics.rs:119-134 — before extracting anything, compare `rust_backend/crates/extensions/src/backend/provider_metadata.rs` and `rust_backend/crates/extensions/src/lyrics.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×6
  • Duplicated block (14 lines × 2) lib/screens/album_screen.dart:550 — lib/screens/album_screen.dart:550-563 | lib/screens/downloaded_album_screen.dart:387-400 — 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 `lib/screens/album_screen.dart:550` 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, `lib/screens/album_screen.dart:566` calls `MotionHeaderBanner`, `headerBgImage` and `lib/screens/downloaded_album_screen.dart:402` 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) lib/screens/network_storage_screen.dart:96 — lib/screens/network_storage_screen.dart:96-109 | lib/screens/network_storage_screen.dart:119-132 — both copies are in the same file, so extract the 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 `lib/screens/network_storage_screen.dart:96` 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) lib/screens/playlist_reorder_page.dart:120 — lib/screens/playlist_reorder_page.dart:120-133 | lib/widgets/collection_reorder_sliver.dart:92-105 — 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 `lib/screens/playlist_reorder_page.dart:120` 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) lib/services/autoplay_ranker.dart:357 — lib/services/autoplay_ranker.dart:357-370 | lib/services/autoplay_taste.dart:708-721 — 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 `lib/services/autoplay_ranker.dart: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. 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) lib/services/link/sync/link_sync_handlers.dart:218 — lib/services/link/sync/link_sync_handlers.dart:218-231 | lib/services/link/sync/link_sync_handlers.dart:245-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/link/sync/link_sync_handlers.dart:218` 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) lib/widgets/selection_action_button.dart:24 — lib/widgets/selection_action_button.dart:24-37 | lib/widgets/settings_group.dart:959-972 — 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 `lib/widgets/selection_action_button.dart:24` 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 · Edited copy of a member (1 corresponding lines) · ×5
  • Edited copy of a member (1 corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:169 — rust_backend/crates/core/src/lyrics/models.rs:169-169 | rust_backend/crates/core/src/lyrics/models.rs:177-177 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust_backend/crates/core/src/lyrics.rs:53 — rust_backend/crates/core/src/lyrics.rs:53-53 | rust_backend/crates/core/src/lyrics.rs:73-73 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:138 — rust_backend/crates/core/src/lyrics/models.rs:138-138 | rust_backend/crates/core/src/lyrics/models.rs:161-161 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust_backend/crates/core/src/metadata/musicbrainz.rs:42 — rust_backend/crates/core/src/metadata/musicbrainz.rs:42-42 | rust_backend/crates/core/src/resolver.rs:81-81 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) rust_backend/crates/core/src/resolver.rs:39 — rust_backend/crates/core/src/resolver.rs:39-39 | rust_backend/crates/core/src/resolver.rs:93-93 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×5
  • Edited copy of a member (21 corresponding lines) rust_backend/crates/link/src/subsonic/objects.rs:77 — rust_backend/crates/link/src/subsonic/objects.rs:77-107 | rust_backend/crates/link/src/subsonic/objects.rs:123-143 — 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) lib/providers/library_collections_provider.dart:729 — lib/providers/library_collections_provider.dart:729-753 | lib/providers/library_collections_provider.dart:755-775 — 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) rust_backend/crates/mobile/src/native_backup.rs:150 — rust_backend/crates/mobile/src/native_backup.rs:150-170 | rust_backend/crates/mobile/src/native_library.rs:180-202 — 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) android/app/src/main/kotlin/com/zarz/mornye/BackgroundWorkService.kt:47 — android/app/src/main/kotlin/com/zarz/mornye/BackgroundWorkService.kt:47-70 | android/app/src/main/kotlin/com/zarz/mornye/LinkConnectionService.kt:24-44 — 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) lib/models/unified_library_item.dart:42 — lib/models/unified_library_item.dart:42-62 | lib/models/unified_library_item.dart:64-85 — 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 (14 corresponding lines) · ×5
  • Edited copy of a member (14 corresponding lines) rust_backend/crates/mobile/src/native_backup.rs:117 — rust_backend/crates/mobile/src/native_backup.rs:117-130 | rust_backend/crates/mobile/src/native_library.rs:356-369 — 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) lib/screens/settings/metadata_provider_priority_page.dart:9 — lib/screens/settings/metadata_provider_priority_page.dart:9-24 | lib/screens/settings/provider_priority_page.dart:9-22 — 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) rust_backend/crates/core/src/native_palette.rs:426 — rust_backend/crates/core/src/native_palette.rs:426-442 | rust_backend/crates/mobile/src/native_autoplay_taste.rs:15-28 — 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) lib/services/metadata_autofill_service.dart:379 — lib/services/metadata_autofill_service.dart:379-392 | lib/services/metadata_autofill_service.dart:394-411 — 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) rust_backend/crates/core/src/tags/file.rs:17 — rust_backend/crates/core/src/tags/file.rs:17-32 | rust_backend/crates/core/src/tags/library.rs:121-134 — 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 · Duplicated block (9–10 lines × 2) · ×5
  • Duplicated block (9–10 lines × 2) lib/services/app_orientation.dart:86 — lib/services/app_orientation.dart:86-94 | lib/services/shell_navigation_service.dart:348-357 — 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 `lib/services/app_orientation.dart:86` 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) lib/services/library_collections_database.dart:304 — lib/services/library_collections_database.dart:304-312 | lib/services/library_collections_database.dart:317-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/library_collections_database.dart:304` 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 (9–10 lines × 2) lib/services/library_queue_store.dart:1225 — lib/services/library_queue_store.dart:1225-1234 | lib/services/library_queue_store.dart:1243-1251 — both copies are in the same file, so extract the block into 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) lib/services/music_player_service.dart:2015 — lib/services/music_player_service.dart:2015-2023 | lib/services/music_player_service.dart:2064-2073 — both copies are in the same file, so extract the 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 `lib/services/music_player_service.dart:2015` 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–10 lines × 2) rust_backend/crates/mobile/src/network_tags.rs:104 — rust_backend/crates/mobile/src/network_tags.rs:104-113 | rust_backend/crates/mobile/src/network_tags.rs:417-425 — both copies are in the same file, so extract the 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 `rust_backend/crates/mobile/src/network_tags.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.
D1 · Cyclomatic Complexity · (anonymous) · ×4
  • (anonymous)::filenameMetadata::visit (cyclomatic 36) rust_backend/crates/extensions/src/prelude.js:566 — (anonymous)::filenameMetadata::visit 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.
  • (anonymous)::downloadSegments (cyclomatic 18) rust_backend/crates/extensions/src/prelude.js:468 — (anonymous)::downloadSegments 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.
  • (anonymous)::dispatch (cyclomatic 16) rust_backend/crates/extensions/src/prelude.js:277 — (anonymous)::dispatch 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.
  • (anonymous)::fileCall (cyclomatic 16) rust_backend/crates/extensions/src/prelude.js:440 — (anonymous)::fileCall has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · ExtensionManager · ×4
  • ExtensionManager::provider_operation_value (cognitive 77) rust_backend/crates/extensions/src/manager/providers.rs:206 — ExtensionManager::provider_operation_value has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (51 pts), loops 4 (12 pts), boolean chains 7, match/switch 5 (7 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.
  • ExtensionManager::run_post_processing (cognitive 37) rust_backend/crates/extensions/src/manager/postprocess.rs:128 — ExtensionManager::run_post_processing has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 3, loops 2 (3 pts), 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.
  • ExtensionManager::search_metadata_providers_value_with_lease (cognitive 34) rust_backend/crates/extensions/src/manager/metadata.rs:186 — ExtensionManager::search_metadata_providers_value_with_lease has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 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.
  • ExtensionManager::download_with_lease (cognitive 16) rust_backend/crates/extensions/src/manager/downloads.rs:271 — ExtensionManager::download_with_lease has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 2, 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 · SignedSessionClient · ×4
  • SignedSessionClient::signed_fetch (cognitive 55) rust_backend/crates/extensions/src/signed_session/fetch.rs:7 — SignedSessionClient::signed_fetch has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (43 pts), boolean chains 8, match/switch 2 (3 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.
  • SignedSessionClient::refresh (cognitive 22) rust_backend/crates/extensions/src/signed_session/exchange.rs:393 — SignedSessionClient::refresh 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.
  • SignedSessionClient::bootstrap (cognitive 20) rust_backend/crates/extensions/src/signed_session/exchange.rs:65 — SignedSessionClient::bootstrap has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SignedSessionClient::exchange_owned (cognitive 18) rust_backend/crates/extensions/src/signed_session/exchange.rs:321 — SignedSessionClient::exchange_owned has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, 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 · (anonymous) · ×4
  • (anonymous)::filenameMetadata::visit (cognitive 53) rust_backend/crates/extensions/src/prelude.js:566 — (anonymous)::filenameMetadata::visit has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 7 (17 pts), boolean chains 8, loops 3 (5 pts), error handling 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.
  • (anonymous)::downloadSegments (cognitive 21) rust_backend/crates/extensions/src/prelude.js:468 — (anonymous)::downloadSegments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::fileCall (cognitive 19) rust_backend/crates/extensions/src/prelude.js:440 — (anonymous)::fileCall has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4, if/else 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::dispatch (cognitive 18) rust_backend/crates/extensions/src/prelude.js:277 — (anonymous)::dispatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, error handling 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.
D4 · Code Duplication · Edited copies of one member (3 members, 1+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:28 — rust_backend/crates/core/src/lyrics/models.rs:28-28 | rust_backend/crates/core/src/resolver.rs:73-73 | rust_backend/crates/core/src/resolver.rs:107-107 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:50 — rust_backend/crates/core/src/lyrics/models.rs:50-50 | rust_backend/crates/core/src/lyrics/models.rs:63-63 | rust_backend/crates/core/src/lyrics/models.rs:151-151 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:128 — rust_backend/crates/core/src/lyrics/models.rs:128-128 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:16-16 | rust_backend/crates/core/src/metadata/musicbrainz.rs:15-15 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:42 — rust_backend/crates/core/src/lyrics/models.rs:42-42 | rust_backend/crates/core/src/lyrics/models.rs:79-79 | rust_backend/crates/core/src/lyrics/models.rs:97-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 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 (26 corresponding lines) · ×4
  • Edited copy of a member (26 corresponding lines) rust_backend/crates/extensions/src/backend/provider_metadata.rs:126 — rust_backend/crates/extensions/src/backend/provider_metadata.rs:126-151 | rust_backend/crates/extensions/src/backend/provider_metadata.rs:162-194 — 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) rust_backend/crates/extensions/src/download/segment_store.rs:184 — rust_backend/crates/extensions/src/download/segment_store.rs:184-209 | rust_backend/crates/extensions/src/download/store.rs:158-184 — 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) lib/services/history_database.dart:119 — lib/services/history_database.dart:119-144 | lib/services/library_database.dart:74-99 — 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) lib/screens/home_tab.dart:1197 — lib/screens/home_tab.dart:1197-1222 | lib/screens/home_tab.dart:1329-1354 — 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 (18 corresponding lines) · ×4
  • Edited copy of a member (18 corresponding lines) rust_backend/crates/cast/src/media.rs:151 — rust_backend/crates/cast/src/media.rs:151-168 | rust_backend/crates/desktop/src/callback_url.rs:8-29 — 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) lib/screens/downloaded_album_screen.dart:537 — lib/screens/downloaded_album_screen.dart:537-558 | lib/screens/local_album_screen.dart:496-513 — 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) lib/services/ffmpeg_metadata.dart:453 — lib/services/ffmpeg_metadata.dart:453-474 | lib/services/ffmpeg_metadata.dart:501-518 — 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) lib/services/link/desktop/link_player.dart:377 — lib/services/link/desktop/link_player.dart:377-396 | lib/services/link/features/link_phone_player.dart:165-182 — 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 copies of one member (3 members, 8+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 8+ corresponding lines) rust_backend/crates/providers/src/lyrics/service.rs:325 — rust_backend/crates/providers/src/lyrics/service.rs:325-333 | rust_backend/crates/providers/src/resolver/availability/cache.rs:264-273 | rust_backend/crates/providers/src/resolver/service.rs:191-198 — 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) lib/providers/download_history_provider.dart:439 — lib/providers/download_history_provider.dart:439-446 | lib/providers/recent_access_provider.dart:129-140 | lib/services/desktop_library_watcher.dart:95-102 — 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) lib/providers/download_history_provider.dart:590 — lib/providers/download_history_provider.dart:590-597 | lib/providers/download_history_provider.dart:599-606 | lib/providers/download_history_provider.dart:623-633 — 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) rust_backend/crates/core/src/lyrics/lrc.rs:112 — rust_backend/crates/core/src/lyrics/lrc.rs:112-119 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:25-33 | rust_backend/crates/providers/src/lyrics/builtin.rs:180-187 — 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 (13–14 lines × 2) · ×4
  • Duplicated block (13–14 lines × 2) lib/providers/download_queue_provider_single_item.dart:1216 — lib/providers/download_queue_provider_single_item.dart:1216-1228 | lib/providers/download_queue_provider_single_item.dart:1357-1370 — both copies are in the same file, so extract the 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 `lib/providers/download_queue_provider_single_item.dart:1216` 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–14 lines × 2) lib/screens/repo_tab.dart:226 — lib/screens/repo_tab.dart:226-239 | lib/screens/repo_tab.dart:246-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/repo_tab.dart:226` 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) lib/screens/settings/about_page.dart:267 — lib/screens/settings/about_page.dart:267-280 | lib/screens/settings/about_page.dart:533-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/about_page.dart:267` 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–14 lines × 2) lib/widgets/library_directory_view.dart:172 — lib/widgets/library_directory_view.dart:172-184 | lib/widgets/library_search_results.dart:207-220 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/library_directory_view.dart: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/widgets/library_directory_view.dart:171` calls `_reEnrich`, `showBatchConvertSheet` and `lib/widgets/library_search_results.dart:207` 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.
D1 · Cyclomatic Complexity · ExtensionManager · ×3
  • ExtensionManager::provider_operation_value (cyclomatic 68) rust_backend/crates/extensions/src/manager/providers.rs:206 — ExtensionManager::provider_operation_value has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ExtensionManager::search_metadata_providers_value_with_lease (cyclomatic 18) rust_backend/crates/extensions/src/manager/metadata.rs:186 — ExtensionManager::search_metadata_providers_value_with_lease 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.
  • ExtensionManager::run_post_processing (cyclomatic 18) rust_backend/crates/extensions/src/manager/postprocess.rs:128 — ExtensionManager::run_post_processing 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.
D2 · Cognitive Complexity · FilePath · ×3
  • FilePath::open_native_read (cognitive 43) rust_backend/crates/extensions/src/files.rs:493 — FilePath::open_native_read has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FilePath::open_native_read (cognitive 24) rust_backend/crates/extensions/src/files.rs:419 — FilePath::open_native_read has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 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.
  • FilePath::stage_with_parent (cognitive 19) rust_backend/crates/extensions/src/files.rs:620 — FilePath::stage_with_parent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · UrlParts · ×3
  • UrlParts::parse (cognitive 37) rust_backend/crates/network/src/url.rs:25 — UrlParts::parse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 8, match/switch 1 (3 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.
  • UrlParts::reference_string (cognitive 31) rust_backend/crates/network/src/url.rs:139 — UrlParts::reference_string has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 7 (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.
  • UrlParts::resolve_reference (cognitive 20) rust_backend/crates/network/src/url.rs:195 — UrlParts::resolve_reference has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 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 · mornye_desktop · ×3
  • mornye_desktop::events::download_loop (cognitive 32) rust_backend/crates/desktop/src/events.rs:136 — mornye_desktop::events::download_loop has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_desktop::discord::run (cognitive 18) rust_backend/crates/desktop/src/discord.rs:107 — mornye_desktop::discord::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_desktop::ffmpeg::pump_commands (cognitive 16) rust_backend/crates/desktop/src/ffmpeg.rs:78 — mornye_desktop::ffmpeg::pump_commands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mornye_link · ×3
  • mornye_link::ws::session (cognitive 30) rust_backend/crates/link/src/ws.rs:244 — mornye_link::ws::session has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 6 (14 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.
  • mornye_link::files::prune (cognitive 21) rust_backend/crates/link/src/files.rs:146 — mornye_link::files::prune has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mornye_link::subsonic::forward::call (cognitive 21) rust_backend/crates/link/src/subsonic/forward.rs:35 — mornye_link::subsonic::forward::call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (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 · mornye_providers · ×3
  • mornye_providers::lyrics::builtin::direct::genius_text (cognitive 21) rust_backend/crates/providers/src/lyrics/builtin/direct.rs:323 — mornye_providers::lyrics::builtin::direct::genius_text has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), match/switch 1 (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.
  • mornye_providers::resolver::client::resolve_chain (cognitive 20) rust_backend/crates/providers/src/resolver/client.rs:334 — mornye_providers::resolver::client::resolve_chain has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (4 pts), match/switch 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.
  • mornye_providers::resolver::urls::direct (cognitive 16) rust_backend/crates/providers/src/resolver/urls.rs:43 — mornye_providers::resolver::urls::direct has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×3
  • Edited copy of a member (28 corresponding lines) rust_backend/crates/extensions/src/manifest.rs:64 — rust_backend/crates/extensions/src/manifest.rs:64-285 | rust_backend/crates/extensions/src/repository/model.rs:66-124 — 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) rust_backend/crates/extensions/src/manifest.rs:64 — rust_backend/crates/extensions/src/manifest.rs:64-183 | rust_backend/crates/extensions/src/repository/model.rs:66-101 — 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) lib/screens/setup_steps.dart:495 — lib/screens/setup_steps.dart:495-522 | lib/screens/tutorial_screen.dart:362-392 — 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 (4 members, 1+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/payloads.rs:21 — rust_backend/crates/core/src/lyrics/payloads.rs:21-21 | rust_backend/crates/core/src/lyrics/payloads.rs:39-39 | rust_backend/crates/core/src/lyrics/payloads.rs:590-590 | rust_backend/crates/core/src/lyrics/payloads.rs:601-601 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:186 — rust_backend/crates/core/src/lyrics/models.rs:186-186 | rust_backend/crates/core/src/metadata/musicbrainz.rs:29-29 | rust_backend/crates/core/src/resolver.rs:46-46 | rust_backend/crates/core/src/resolver.rs:115-115 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:192 — rust_backend/crates/core/src/lyrics/models.rs:192-192 | rust_backend/crates/core/src/lyrics/payloads.rs:51-51 | rust_backend/crates/core/src/lyrics/payloads.rs:174-174 | rust_backend/crates/core/src/lyrics/payloads.rs:611-611 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 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 (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:49 — rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:49-83 | rust_backend/crates/providers/src/lyrics/builtin/proxy.rs:115-143 — 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) lib/services/metadata_autofill_service.dart:318 — lib/services/metadata_autofill_service.dart:318-347 | lib/services/metadata_autofill_service.dart:349-377 — 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) lib/screens/extension_collection_screens.dart:574 — lib/screens/extension_collection_screens.dart:574-604 | lib/screens/extension_collection_screens.dart:709-737 — 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 (22 corresponding lines) · ×3
  • Edited copy of a member (22 corresponding lines) lib/services/music_player_service.dart:1500 — lib/services/music_player_service.dart:1500-1521 | lib/services/music_player_service.dart:1523-1551 — 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) lib/screens/network_storage_screen.dart:82 — lib/screens/network_storage_screen.dart:82-109 | lib/screens/network_storage_screen.dart:111-132 — 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) lib/screens/now_playing_screen.dart:1083 — lib/screens/now_playing_screen.dart:1083-1107 | lib/widgets/mornye_player_favorite_button.dart:35-56 — 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 copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) lib/services/link/link_protocol.dart:251 — lib/services/link/link_protocol.dart:251-269 | lib/services/link/link_protocol.dart:660-681 — 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) lib/screens/equalizer_screen.dart:72 — lib/screens/equalizer_screen.dart:72-90 | lib/widgets/custom_font_setting.dart:21-46 — 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) lib/widgets/selection_action_button.dart:14 — lib/widgets/selection_action_button.dart:14-37 | lib/widgets/settings_group.dart:954-972 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×3
  • Edited copy of a member (20 corresponding lines) lib/services/link/client/link_client_library.dart:117 — lib/services/link/client/link_client_library.dart:117-136 | lib/services/link/desktop/link_phone_library.dart:62-85 — 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) lib/screens/settings/library_settings_page.dart:406 — lib/screens/settings/library_settings_page.dart:406-425 | lib/screens/settings/library_settings_page.dart:445-467 — 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) lib/services/media_kit_playback_deck.dart:809 — lib/services/media_kit_playback_deck.dart:809-831 | lib/services/music_playback_deck.dart:718-737 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 12+ corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:99 — android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:99-111 | android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:133-144 | android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:146-157 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) lib/services/library_database.dart:565 — lib/services/library_database.dart:565-579 | lib/services/library_database.dart:581-593 | lib/services/library_database.dart:653-664 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) lib/services/platform_bridge.dart:2735 — lib/services/platform_bridge.dart:2735-2746 | lib/services/platform_bridge.dart:2748-2760 | lib/services/platform_bridge.dart:2762-2773 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) lib/screens/home_tab.dart:641 — lib/screens/home_tab.dart:641-662 | lib/screens/main_shell.dart:409-430 — 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 `lib/screens/home_tab.dart:641` 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 (22 lines × 2) lib/screens/network_storage_screen.dart:1146 — lib/screens/network_storage_screen.dart:1146-1167 | lib/screens/settings/link_settings_page.dart:434-455 — 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 (22 lines × 2) lib/services/link/client/link_client_library.dart:138 — lib/services/link/client/link_client_library.dart:138-159 | lib/services/link/desktop/link_phone_library.dart:87-108 — before extracting anything, compare `lib/services/link/client/link_client_library.dart` and `lib/services/link/desktop/link_phone_library.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) lib/screens/artist_screen_discography.dart:478 — lib/screens/artist_screen_discography.dart:478-495 | lib/widgets/batch_progress_dialog.dart:122-139 — 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 `lib/screens/artist_screen_discography.dart:478` 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 (18 lines × 2) lib/screens/downloaded_album_screen.dart:855 — lib/screens/downloaded_album_screen.dart:855-872 | lib/screens/local_album_screen.dart:808-825 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 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 `lib/screens/downloaded_album_screen.dart:855` 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 first that the copies are not typed on the same thing: the declarations holding them bind `tracks` to `List<DownloadHistoryItem>` in one and `List<LocalLibraryItem>` 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, `lib/screens/local_album_screen.dart:826` calls `_selectedFlacEligibleItems`, `_queueSelectedAsFlac` and `lib/screens/downloaded_album_screen.dart:873` 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 (18 lines × 2) lib/widgets/settings_group.dart:553 — lib/widgets/settings_group.dart:553-570 | lib/widgets/settings_group.dart:676-693 — both copies are in the same file, so extract the 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 `lib/widgets/settings_group.dart:553` 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 (11 lines × 2) · ×3
  • Duplicated block (11 lines × 2) lib/services/ffmpeg_support.dart:35 — lib/services/ffmpeg_support.dart:35-45 | lib/services/ffmpeg_support.dart:73-83 — both copies are in the same file, so extract the 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 `lib/services/ffmpeg_support.dart:35` 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) REDACTED:234 — REDACTED:234-244 | REDACTED:671-681 — both copies are in the same file, so extract the 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:234` 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) rust_backend/crates/core/src/tags/write/riff.rs:130 — rust_backend/crates/core/src/tags/write/riff.rs:130-140 | rust_backend/crates/core/src/tags/write/riff.rs:204-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.
D1 · Cyclomatic Complexity · ExtensionManifest · ×2
  • ExtensionManifest::deserialize (cyclomatic 48) rust_backend/crates/extensions/src/manifest.rs:64 — ExtensionManifest::deserialize 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.
  • ExtensionManifest::validate (cyclomatic 40) rust_backend/crates/extensions/src/manifest.rs:360 — ExtensionManifest::validate 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 · UrlParts · ×2
  • UrlParts::parse (cyclomatic 23) rust_backend/crates/network/src/url.rs:25 — UrlParts::parse 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.
  • UrlParts::reference_string (cyclomatic 19) rust_backend/crates/network/src/url.rs:139 — UrlParts::reference_string 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 · Session · ×2
  • Session::configure (cyclomatic 22) rust_backend/crates/mobile/src/usb_audio/transport.rs:422 — Session::configure 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.
  • Session::run (cyclomatic 22) rust_backend/crates/mobile/src/usb_audio/transport.rs:536 — Session::run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtensionAuth · ×2
  • ExtensionAuth::call (cyclomatic 21) rust_backend/crates/extensions/src/auth/client.rs:33 — ExtensionAuth::call 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.
  • ExtensionAuth::exchange (cyclomatic 16) rust_backend/crates/extensions/src/auth/client.rs:199 — ExtensionAuth::exchange 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 · mornye_link · ×2
  • mornye_link::subsonic::forward::call (cyclomatic 20) rust_backend/crates/link/src/subsonic/forward.rs:35 — mornye_link::subsonic::forward::call 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.
  • mornye_link::ws::session (cyclomatic 19) rust_backend/crates/link/src/ws.rs:244 — mornye_link::ws::session 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.
D2 · Cognitive Complexity · ExtensionManifest · ×2
  • ExtensionManifest::deserialize (cognitive 96) rust_backend/crates/extensions/src/manifest.rs:64 — ExtensionManifest::deserialize has cognitive complexity 96 (threshold 15). Drivers by points: match/switch 23 (49 pts), if/else 23 (46 pts), loops 1 (nesting depth added 49). 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.
  • ExtensionManifest::validate (cognitive 53) rust_backend/crates/extensions/src/manifest.rs:360 — ExtensionManifest::validate has cognitive complexity 53 (threshold 15). Drivers by points: if/else 29 (41 pts), boolean chains 8, loops 4 (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 · Session · ×2
  • Session::run (cognitive 57) rust_backend/crates/mobile/src/usb_audio/transport.rs:536 — Session::run has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (47 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Session::configure (cognitive 26) rust_backend/crates/mobile/src/usb_audio/transport.rs:422 — Session::configure has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 8, 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 · Inner · ×2
  • Inner::search (cognitive 55) rust_backend/crates/providers/src/lyrics/service.rs:465 — Inner::search has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (41 pts), match/switch 2 (7 pts), loops 3 (4 pts), boolean chains 3 (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.
  • Inner::fetch_uncached (cognitive 17) rust_backend/crates/providers/src/lyrics/service.rs:369 — Inner::fetch_uncached has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts), 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 · Request · ×2
  • Request::select (cognitive 32) rust_backend/crates/core/src/metadata/reenrich.rs:382 — Request::select has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 15, 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.
  • Request::apply (cognitive 17) rust_backend/crates/core/src/metadata/reenrich.rs:174 — Request::apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 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 · WavSource · ×2
  • WavSource::open (cognitive 27) rust_backend/crates/core/src/media/hires.rs:581 — WavSource::open has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 5, match/switch 2 (3 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.
  • WavSource::analyze_window (cognitive 20) rust_backend/crates/core/src/media/hires.rs:663 — WavSource::analyze_window has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (4 pts), 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 · Wu · ×2
  • Wu::quantize (cognitive 25) rust_backend/crates/core/src/native_palette.rs:129 — Wu::quantize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (4 pts) (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
  • Wu::prefix (cognitive 18) rust_backend/crates/core/src/native_palette.rs:97 — Wu::prefix has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (18 pts) (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · DeezerClient · ×2
  • DeezerClient::get_json (cognitive 23) rust_backend/crates/providers/src/deezer.rs:66 — DeezerClient::get_json has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 3, 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.
  • DeezerClient::coalesced (cognitive 22) rust_backend/crates/providers/src/deezer/cache.rs:118 — DeezerClient::coalesced has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionPackage · ×2
  • ExtensionPackage::open (cognitive 21) rust_backend/crates/extensions/src/package.rs:52 — ExtensionPackage::open has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 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.
  • ExtensionPackage::extract (cognitive 16) rust_backend/crates/extensions/src/package.rs:141 — ExtensionPackage::extract 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.
D3 · God Classes · TooManyFields · ×2
  • TooManyFields: DownloadRequest rust_backend/crates/core/src/downloads.rs:12 — TooManyFields — 53 stored fields beside 2 methods. The bar is 30 stored fields; this is 23 over it, 1.77× 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: Song rust_backend/crates/link/src/catalog.rs:61 — TooManyFields — 31 stored fields beside 4 methods. The bar is 30 stored fields; this is 1 over it, 1.03× 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 advisory (unmaintained) · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copies of one member (5 members, 1+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 1+ corresponding lines) rust_backend/crates/core/src/metadata/deezer.rs:26 — rust_backend/crates/core/src/metadata/deezer.rs:26-26 | rust_backend/crates/core/src/metadata/deezer.rs:60-60 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:54-54 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:96-96 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:114-114 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/lrclib.rs:18 — rust_backend/crates/core/src/lyrics/lrclib.rs:18-18 | rust_backend/crates/core/src/lyrics/models.rs:19-19 | rust_backend/crates/core/src/lyrics/models.rs:113-113 | rust_backend/crates/core/src/metadata/deezer.rs:44-44 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:73-73 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 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 copy of a member (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) lib/widgets/network_offline_actions.dart:241 — lib/widgets/network_offline_actions.dart:241-274 | lib/widgets/network_upload_actions.dart:166-199 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1647 — android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1647-1681 | android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1683-1716 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) rust_backend/crates/providers/src/resolver/availability/cache.rs:359 — rust_backend/crates/providers/src/resolver/availability/cache.rs:359-401 | rust_backend/crates/providers/src/resolver/service.rs:240-275 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) lib/screens/downloaded_album_screen.dart:853 — lib/screens/downloaded_album_screen.dart:853-888 | lib/screens/local_album_screen.dart:806-843 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) lib/services/link/sync/link_sync_handlers.dart:214 — lib/services/link/sync/link_sync_handlers.dart:214-238 | lib/services/link/sync/link_sync_handlers.dart:240-265 — 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) lib/services/history_database.dart:747 — lib/services/history_database.dart:747-771 | lib/services/library_database.dart:1126-1155 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×2
  • Edited copy of a member (32 corresponding lines) lib/services/autoplay_ranker.dart:357 — lib/services/autoplay_ranker.dart:357-388 | lib/services/autoplay_taste.dart:708-743 — 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) lib/screens/settings/app_settings_page.dart:140 — lib/screens/settings/app_settings_page.dart:140-172 | lib/screens/settings/app_settings_page.dart:174-205 — 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 copies of one member (3 members, 26+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 26+ corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:232 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:232-257 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:259-285 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:287-319 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 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, 26+ corresponding lines) lib/screens/settings/download_settings_page.dart:474 — lib/screens/settings/download_settings_page.dart:474-499 | lib/screens/settings/lyrics_settings_page.dart:218-249 | lib/screens/settings/metadata_settings_page.dart:188-219 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 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 (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) lib/screens/settings/library_settings_page.dart:252 — lib/screens/settings/library_settings_page.dart:252-286 | lib/screens/settings/library_settings_page.dart:298-328 — 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) lib/models/download_history.dart:104 — lib/models/download_history.dart:104-142 | lib/models/library_database_models.dart:85-115 — 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) · ×2
  • Edited copy of a member (27 corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:401 — android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:401-427 | android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:438-468 — 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) lib/services/download_metadata_embedding.dart:424 — lib/services/download_metadata_embedding.dart:424-455 | lib/services/metadata_persistence_service.dart:263-289 — 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, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) rust_backend/crates/extensions/src/download/segment_store.rs:211 — rust_backend/crates/extensions/src/download/segment_store.rs:211-224 | rust_backend/crates/extensions/src/download/store.rs:186-199 | rust_backend/crates/extensions/src/files.rs:761-775 — 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) lib/widgets/desktop/desktop_inspector.dart:454 — lib/widgets/desktop/desktop_inspector.dart:454-468 | lib/widgets/desktop/desktop_mini_player.dart:93-106 | lib/widgets/desktop/desktop_now_playing.dart:67-82 — 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 (3 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 17+ corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:53 — android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:53-69 | android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:71-88 | android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:210-227 — 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) lib/providers/recent_access_provider.dart:189 — lib/providers/recent_access_provider.dart:189-205 | lib/providers/recent_access_provider.dart:207-225 | lib/providers/recent_access_provider.dart:227-245 — 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 copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) lib/services/library_database.dart:629 — lib/services/library_database.dart:629-639 | lib/services/library_database.dart:641-651 | lib/services/library_database.dart:666-680 — 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) lib/screens/album_screen.dart:431 — lib/screens/album_screen.dart:431-442 | lib/screens/library_mix_screen.dart:127-137 | lib/screens/playlist_screen.dart:249-259 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 6+ corresponding lines) rust_backend/crates/providers/src/lyrics/service.rs:163 — rust_backend/crates/providers/src/lyrics/service.rs:163-168 | rust_backend/crates/providers/src/lyrics/service.rs:170-177 | rust_backend/crates/providers/src/resolver/availability/cache.rs:99-106 | rust_backend/crates/providers/src/resolver/service.rs:82-89 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 6+ corresponding lines) rust_backend/crates/mobile/src/native_backup.rs:59 — rust_backend/crates/mobile/src/native_backup.rs:59-64 | rust_backend/crates/mobile/src/native_cache/unix.rs:81-86 | rust_backend/crates/mobile/src/native_collections.rs:39-44 | rust_backend/crates/mobile/src/native_library.rs:56-61 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) lib/services/link/features/link_desktop_remote.dart:347 — lib/services/link/features/link_desktop_remote.dart:347-349 | lib/services/link/link_mirrored_playback.dart:616-619 — 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) lib/services/cover_store.dart:42 — lib/services/cover_store.dart:42-44 | lib/services/link/sync/link_history_artwork.dart:49-51 — 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 (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) lib/screens/track_metadata_screen.dart:613 — lib/screens/track_metadata_screen.dart:613-633 | lib/screens/track_metadata_screen.dart:637-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 `lib/screens/track_metadata_screen.dart:613` 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) REDACTED:189 — REDACTED:189-209 | REDACTED:599-619 — both copies are in the same file, so extract the 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:189` 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 (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) lib/screens/artist_screen_discography.dart:514 — lib/screens/artist_screen_discography.dart:514-532 | lib/widgets/batch_progress_dialog.dart:169-187 — 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 `lib/screens/artist_screen_discography.dart:514` 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) lib/screens/home_tab_search_wide.dart:586 — lib/screens/home_tab_search_wide.dart:586-604 | lib/screens/home_tab_search_wide.dart:863-881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) lib/screens/home_tab_intro.dart:1235 — lib/screens/home_tab_intro.dart:1235-1251 | lib/screens/home_tab_intro.dart:1283-1299 — both copies are in the same file, so extract the 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 `lib/screens/home_tab_intro.dart:1235` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/theme/app_theme.dart:68 — lib/theme/app_theme.dart:68-84 | lib/theme/app_theme.dart:119-135 — both copies are in the same file, so extract the 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 `lib/theme/app_theme.dart:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) lib/widgets/desktop/desktop_mini_player.dart:126 — lib/widgets/desktop/desktop_mini_player.dart:126-140 | lib/widgets/desktop/desktop_now_playing.dart:109-122 — 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 `lib/widgets/desktop/desktop_mini_player.dart:126` 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 (14–15 lines × 2) lib/widgets/settings_group.dart:490 — lib/widgets/settings_group.dart:490-503 | lib/widgets/settings_group.dart: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 `lib/widgets/settings_group.dart:490` 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–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) lib/services/lyrics_translation.dart:695 — lib/services/lyrics_translation.dart:695-704 | lib/services/lyrics_translation_sharing.dart:32-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10–11 lines × 2) rust_backend/crates/extensions/src/download/segment_store.rs:193 — rust_backend/crates/extensions/src/download/segment_store.rs:193-202 | rust_backend/crates/extensions/src/download/store.rs:167-177 — before extracting anything, compare `rust_backend/crates/extensions/src/download/segment_store.rs` and `rust_backend/crates/extensions/src/download/store.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 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 `rust_backend/crates/extensions/src/download/segment_store.rs:193` 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–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) lib/providers/extension_provider.dart:436 — lib/providers/extension_provider.dart:436-444 | lib/providers/extension_provider.dart:519-528 | lib/providers/extension_provider.dart:536-544 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/extension_provider.dart:436` 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–10 lines × 3) rust_backend/crates/core/src/text.rs:5 — rust_backend/crates/core/src/text.rs:5-13 | rust_backend/crates/extensions/src/host.rs:263-272 | rust_backend/crates/extensions/src/redact.rs:71-79 — 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 `rust_backend/crates/core/src/text.rs:5` 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–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) lib/services/apk_downloader.dart:205 — lib/services/apk_downloader.dart:205-212 | lib/services/backup_service.dart:485-493 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) lib/services/history_row_mapper.dart:124 — lib/services/history_row_mapper.dart:124-132 | lib/services/history_schema.dart:244-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/history_row_mapper.dart:124` 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 (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) rust_backend/crates/extensions/src/download.rs:458 — rust_backend/crates/extensions/src/download.rs:458-463 | rust_backend/crates/extensions/src/signed_session/protocol.rs:541-547 — 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 `rust_backend/crates/extensions/src/download.rs:458` 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–7 lines × 2) rust_backend/crates/providers/src/lyrics/http.rs:68 — rust_backend/crates/providers/src/lyrics/http.rs:68-74 | rust_backend/crates/providers/src/lyrics/lrclib.rs:30-35 — 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 `rust_backend/crates/providers/src/lyrics/http.rs:68` 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.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: mornye-core — mornye-core: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: mornye-network — mornye-network: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×2
  • Recursive walk over a caller-supplied document has no depth cap lib/services/metadata_autofill_service.dart:539 — `coverUrl` is public, takes a document from its caller (line 531) and hands it to `fromValue`, which calls itself at line 539 (`fromValue`) with a piece of `value` (and at line 545) — and nowhere in `fromValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `fromValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap lib/services/platform_bridge.dart:740 — `customSearchWithExtension` is public, takes a document from its caller (line 2226) and hands it to `_canonicalizeJsonLike`, which calls itself at line 740 (`_canonicalizeJsonLike`) with a piece of `value` (and at line 744) — and nowhere in `_canonicalizeJsonLike` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_canonicalizeJsonLike` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D1 · Cyclomatic Complexity · _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cyclomatic 154) · ×1
  • _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cyclomatic 154) lib/screens/track_metadata_screen.dart:358 — _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile has cyclomatic complexity 154 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HomeTabState.build (cyclomatic 100) · ×1
  • _HomeTabState.build (cyclomatic 100) lib/screens/home_tab.dart:769 — _HomeTabState.build has cyclomatic complexity 100 (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 · _NowPlayingScreenState._buildPlayer (cyclomatic 97) · ×1
  • _NowPlayingScreenState._buildPlayer (cyclomatic 97) lib/screens/now_playing_screen.dart:311 — _NowPlayingScreenState._buildPlayer has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RustCoreBackendApplicationKt.dispatchApplication (cyclomatic 94) · ×1
  • RustCoreBackendApplicationKt.dispatchApplication (cyclomatic 94) android/app/src/rust/kotlin/com/zarz/mornye/RustCoreBackendApplication.kt:9 — RustCoreBackendApplicationKt.dispatchApplication has cyclomatic complexity 94 (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 · RustCoreBackend.invokeApplication (cyclomatic 92) · ×1
  • RustCoreBackend.invokeApplication (cyclomatic 92) ios/Runner/CoreBackend.swift:643 — RustCoreBackend.invokeApplication has cyclomatic complexity 92 (threshold 15). Of this number, 91 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · _SyncedLyricsViewState._buildLyrics (cyclomatic 82) · ×1
  • _SyncedLyricsViewState._buildLyrics (cyclomatic 82) lib/widgets/player_lyrics.dart:888 — _SyncedLyricsViewState._buildLyrics has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _QueueTabState.build (cyclomatic 80) · ×1
  • _QueueTabState.build (cyclomatic 80) lib/screens/queue_tab.dart:524 — _QueueTabState.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 · _DownloadRun._handleDownloadSuccess (cyclomatic 76) · ×1
  • _DownloadRun._handleDownloadSuccess (cyclomatic 76) lib/providers/download_queue_provider_single_item.dart:607 — _DownloadRun._handleDownloadSuccess has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DownloadMetadataEmbedding.embed (cyclomatic 75) · ×1
  • DownloadMetadataEmbedding.embed (cyclomatic 75) lib/services/download_metadata_embedding.dart:86 — DownloadMetadataEmbedding.embed has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DownloadQueueNotifier._processQueueSingleFlight (cyclomatic 74) · ×1
  • DownloadQueueNotifier._processQueueSingleFlight (cyclomatic 74) lib/providers/download_queue_provider.dart:1646 — DownloadQueueNotifier._processQueueSingleFlight 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.
D1 · Cyclomatic Complexity · _NetworkStorageScreenState.build (cyclomatic 69) · ×1
  • _NetworkStorageScreenState.build (cyclomatic 69) lib/screens/network_storage_screen.dart:318 — _NetworkStorageScreenState.build has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _MusicAutoMix._start (cyclomatic 69) · ×1
  • _MusicAutoMix._start (cyclomatic 69) lib/services/music_player_automix.dart:288 — _MusicAutoMix._start has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NetworkLibraryScanner._scan (cyclomatic 69) · ×1
  • NetworkLibraryScanner._scan (cyclomatic 69) lib/services/network_library_scanner.dart:122 — NetworkLibraryScanner._scan has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MusicPlayerHandler._loadIndex (cyclomatic 64) · ×1
  • MusicPlayerHandler._loadIndex (cyclomatic 64) lib/services/music_player_service.dart:1733 — MusicPlayerHandler._loadIndex has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MainActivitySafScanKt.scanSafTree (cyclomatic 64) · ×1
  • MainActivitySafScanKt.scanSafTree (cyclomatic 64) REDACTED:120 — MainActivitySafScanKt.scanSafTree has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _PlaybackSettingsPageState.build (cyclomatic 58) · ×1
  • _PlaybackSettingsPageState.build (cyclomatic 58) lib/screens/settings/playback_settings_page.dart:148 — _PlaybackSettingsPageState.build has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _LibrarySearchResultsState._buildSlivers (cyclomatic 54) · ×1
  • _LibrarySearchResultsState._buildSlivers (cyclomatic 54) lib/widgets/library_search_results.dart:753 — _LibrarySearchResultsState._buildSlivers 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 · SafFileInspectionKt.inspectSafFiles (cyclomatic 54) · ×1
  • SafFileInspectionKt.inspectSafFiles (cyclomatic 54) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:90 — SafFileInspectionKt.inspectSafFiles 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 · MetadataAutofillService.enrich (cyclomatic 52) · ×1
  • MetadataAutofillService.enrich (cyclomatic 52) lib/services/metadata_autofill_service.dart:116 — MetadataAutofillService.enrich 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 · NativeFinalizerMediaKt.embedBasicMetadata (cyclomatic 52) · ×1
  • NativeFinalizerMediaKt.embedBasicMetadata (cyclomatic 52) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt:239 — NativeFinalizerMediaKt.embedBasicMetadata 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 · MainActivitySafScanKt.scanSafTreeIncremental (cyclomatic 51) · ×1
  • MainActivitySafScanKt.scanSafTreeIncremental (cyclomatic 51) REDACTED:542 — MainActivitySafScanKt.scanSafTreeIncremental 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 · _LibrarySettingsPageState.build (cyclomatic 50) · ×1
  • _LibrarySettingsPageState.build (cyclomatic 50) lib/screens/settings/library_settings_page.dart:469 — _LibrarySettingsPageState.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 · LinkLibraryExecutor.call (cyclomatic 49) · ×1
  • LinkLibraryExecutor.call (cyclomatic 49) lib/services/link/desktop/link_library_executor.dart:76 — LinkLibraryExecutor.call 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 · NetworkStorageService.parseListing (cyclomatic 49) · ×1
  • NetworkStorageService.parseListing (cyclomatic 49) lib/services/network_storage_service.dart:1135 — NetworkStorageService.parseListing 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 · MornyePlayerLayout.build (cyclomatic 49) · ×1
  • MornyePlayerLayout.build (cyclomatic 49) lib/widgets/mornye_player_layout.dart:87 — MornyePlayerLayout.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 · _LibraryTracksFolderScreenState._buildAppBar (cyclomatic 48) · ×1
  • _LibraryTracksFolderScreenState._buildAppBar (cyclomatic 48) lib/screens/library_tracks_folder_screen.dart:902 — _LibraryTracksFolderScreenState._buildAppBar 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.
D1 · Cyclomatic Complexity · MornyeGlass.build (cyclomatic 47) · ×1
  • MornyeGlass.build (cyclomatic 47) lib/widgets/mornye_chrome.dart:214 — MornyeGlass.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 · LyricsTranslator.translate (cyclomatic 46) · ×1
  • LyricsTranslator.translate (cyclomatic 46) lib/services/lyrics_translation.dart:367 — LyricsTranslator.translate 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 · PlayerPlaybackControls.build (cyclomatic 46) · ×1
  • PlayerPlaybackControls.build (cyclomatic 46) lib/widgets/player_playback_controls.dart:63 — PlayerPlaybackControls.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 · _DownloadRun._applyFormatHandling (cyclomatic 45) · ×1
  • _DownloadRun._applyFormatHandling (cyclomatic 45) lib/providers/download_queue_provider_single_item.dart:942 — _DownloadRun._applyFormatHandling has cyclomatic complexity 45 (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 · AudioMetadataMapper.vorbisToNativeChunkFields (cyclomatic 45) · ×1
  • AudioMetadataMapper.vorbisToNativeChunkFields (cyclomatic 45) lib/services/audio_metadata_mapper.dart:28 — AudioMetadataMapper.vorbisToNativeChunkFields has cyclomatic complexity 45 (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 · DownloadFileRecovery._recover (cyclomatic 44) · ×1
  • DownloadFileRecovery._recover (cyclomatic 44) lib/services/download_file_recovery.dart:83 — DownloadFileRecovery._recover 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 · LinkDesktopRemote._applyLocally (cyclomatic 44) · ×1
  • LinkDesktopRemote._applyLocally (cyclomatic 44) lib/services/link/features/link_desktop_remote.dart:211 — LinkDesktopRemote._applyLocally 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 · _MusicGapless._prepare (cyclomatic 43) · ×1
  • _MusicGapless._prepare (cyclomatic 43) lib/services/music_player_gapless.dart:97 — _MusicGapless._prepare 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 · _AudioFacts._output (cyclomatic 42) · ×1
  • _AudioFacts._output (cyclomatic 42) lib/widgets/audio_info_sheet.dart:689 — _AudioFacts._output 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.
D1 · Cyclomatic Complexity · RepoExtension · ×1
  • RepoExtension::deserialize (cyclomatic 42) rust_backend/crates/extensions/src/repository/model.rs:66 — RepoExtension::deserialize 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.
D1 · Cyclomatic Complexity · _MornyeArtworkContrastState._sample (cyclomatic 41) · ×1
  • _MornyeArtworkContrastState._sample (cyclomatic 41) lib/widgets/mornye_artwork_contrast.dart:134 — _MornyeArtworkContrastState._sample 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.
D1 · Cyclomatic Complexity · AudioMetadataMapper.normalizeToVorbisComments (cyclomatic 40) · ×1
  • AudioMetadataMapper.normalizeToVorbisComments (cyclomatic 40) lib/services/audio_metadata_mapper.dart:117 — AudioMetadataMapper.normalizeToVorbisComments has cyclomatic complexity 40 (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 · _MiniPlayerBodyState.build (cyclomatic 40) · ×1
  • _MiniPlayerBodyState.build (cyclomatic 40) lib/widgets/mini_player.dart:206 — _MiniPlayerBodyState.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 · AppDelegate.invokeOsMethod (cyclomatic 39) · ×1
  • AppDelegate.invokeOsMethod (cyclomatic 39) ios/Runner/AppDelegate.swift:532 — AppDelegate.invokeOsMethod has cyclomatic complexity 39 (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 · DownloadHistoryNotifier._inspectOrphanedEntries (cyclomatic 38) · ×1
  • DownloadHistoryNotifier._inspectOrphanedEntries (cyclomatic 38) lib/providers/download_history_provider.dart:854 — DownloadHistoryNotifier._inspectOrphanedEntries 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.
D1 · Cyclomatic Complexity · TrackNotifier.fetchFromUrl (cyclomatic 38) · ×1
  • TrackNotifier.fetchFromUrl (cyclomatic 38) lib/providers/track_provider.dart:167 — TrackNotifier.fetchFromUrl 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.
D1 · Cyclomatic Complexity · _ArtistScreenState._buildPage (cyclomatic 38) · ×1
  • _ArtistScreenState._buildPage (cyclomatic 38) lib/screens/artist_screen.dart:634 — _ArtistScreenState._buildPage 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.
D1 · Cyclomatic Complexity · _LibraryTracksFolderScreenState.build (cyclomatic 36) · ×1
  • _LibraryTracksFolderScreenState.build (cyclomatic 36) lib/screens/library_tracks_folder_screen.dart:337 — _LibraryTracksFolderScreenState.build has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LyricsParser._parseTtml (cyclomatic 36) · ×1
  • LyricsParser._parseTtml (cyclomatic 36) lib/utils/lyrics_parser.dart:645 — LyricsParser._parseTtml 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.
D1 · Cyclomatic Complexity · _TrackTableRowViewState.build (cyclomatic 36) · ×1
  • _TrackTableRowViewState.build (cyclomatic 36) lib/widgets/desktop/track_table.dart:619 — _TrackTableRowViewState.build has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _RewindSlide._content (cyclomatic 35) · ×1
  • _RewindSlide._content (cyclomatic 35) lib/screens/listening_rewind_slides.dart:81 — _RewindSlide._content 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 · _ExtensionDetailPageState.build (cyclomatic 35) · ×1
  • _ExtensionDetailPageState.build (cyclomatic 35) lib/screens/settings/extension_detail_page.dart:85 — _ExtensionDetailPageState.build has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BackupService._parseArchive (cyclomatic 35) · ×1
  • BackupService._parseArchive (cyclomatic 35) lib/services/backup_service.dart:614 — BackupService._parseArchive 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 · _MusicAutoMix._prepare (cyclomatic 35) · ×1
  • _MusicAutoMix._prepare (cyclomatic 35) lib/services/music_player_automix.dart:156 — _MusicAutoMix._prepare 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 · _DownloadRun._run (cyclomatic 34) · ×1
  • _DownloadRun._run (cyclomatic 34) lib/providers/download_queue_provider_single_item.dart:137 — _DownloadRun._run 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 · NetworkStorageService._request (cyclomatic 34) · ×1
  • NetworkStorageService._request (cyclomatic 34) lib/services/network_storage_service.dart:809 — NetworkStorageService._request 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 · _SyncedLyricsViewState._maybeAutoScroll (cyclomatic 34) · ×1
  • _SyncedLyricsViewState._maybeAutoScroll (cyclomatic 34) lib/widgets/player_lyrics.dart:767 — _SyncedLyricsViewState._maybeAutoScroll 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 · ApkDownloader.downloadApk (cyclomatic 33) · ×1
  • ApkDownloader.downloadApk (cyclomatic 33) lib/services/apk_downloader.dart:18 — ApkDownloader.downloadApk 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 · LinkLibraryJobsHost.handle (cyclomatic 33) · ×1
  • LinkLibraryJobsHost.handle (cyclomatic 33) lib/services/link/desktop/link_library_jobs_host.dart:76 — LinkLibraryJobsHost.handle 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 · NativeDownloadFinalizer.finalize (cyclomatic 33) · ×1
  • NativeDownloadFinalizer.finalize (cyclomatic 33) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:88 — NativeDownloadFinalizer.finalize 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 · SignedSessionClient · ×1
  • SignedSessionClient::signed_fetch (cyclomatic 33) rust_backend/crates/extensions/src/signed_session/fetch.rs:7 — SignedSessionClient::signed_fetch 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 · (anonymous).exportValue (cyclomatic 33) · ×1
  • (anonymous).exportValue (cyclomatic 33) rust_backend/crates/extensions/src/prelude.js:117 — (anonymous).exportValue 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 · BackupService.writeBackupArchive (cyclomatic 32) · ×1
  • BackupService.writeBackupArchive (cyclomatic 32) lib/services/backup_service.dart:174 — BackupService.writeBackupArchive 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 · DownloadFileFinalizer.autoConvert (cyclomatic 32) · ×1
  • DownloadFileFinalizer.autoConvert (cyclomatic 32) lib/services/download_file_finalizer.dart:194 — DownloadFileFinalizer.autoConvert 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 · LinkPlaysOnDesktop.build (cyclomatic 32) · ×1
  • LinkPlaysOnDesktop.build (cyclomatic 32) lib/services/link/features/link_remote_playback.dart:35 — LinkPlaysOnDesktop.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 · PlatformBridge._ensureBackendEventHandler (cyclomatic 32) · ×1
  • PlatformBridge._ensureBackendEventHandler (cyclomatic 32) lib/services/platform_bridge.dart:454 — PlatformBridge._ensureBackendEventHandler 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 · DownloadService.processConcurrentNativeRequest (cyclomatic 32) · ×1
  • DownloadService.processConcurrentNativeRequest (cyclomatic 32) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1067 — DownloadService.processConcurrentNativeRequest 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 · _AccountForm.parse (cyclomatic 31) · ×1
  • _AccountForm.parse (cyclomatic 31) lib/controllers/extension_action_forms.dart:80 — _AccountForm.parse has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AudioMetadataMapper.convertToId3Tags (cyclomatic 31) · ×1
  • AudioMetadataMapper.convertToId3Tags (cyclomatic 31) lib/services/audio_metadata_mapper.dart:336 — AudioMetadataMapper.convertToId3Tags has cyclomatic complexity 31 (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 · AutoplayPreferenceModel.decode (cyclomatic 31) · ×1
  • AutoplayPreferenceModel.decode (cyclomatic 31) lib/services/autoplay_personalization.dart:281 — AutoplayPreferenceModel.decode 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 · LyricsDraft.parse (cyclomatic 31) · ×1
  • LyricsDraft.parse (cyclomatic 31) lib/utils/lyrics_draft.dart:113 — LyricsDraft.parse 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 · LyricsTranslationController.translate (cyclomatic 30) · ×1
  • LyricsTranslationController.translate (cyclomatic 30) lib/providers/lyrics_translation_provider.dart:351 — LyricsTranslationController.translate 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 · _NowPlayingScreenState._showMoreActions (cyclomatic 30) · ×1
  • _NowPlayingScreenState._showMoreActions (cyclomatic 30) lib/screens/now_playing_screen.dart:1109 — _NowPlayingScreenState._showMoreActions has cyclomatic complexity 30 (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 · LinkLibraryJobRow.build (cyclomatic 30) · ×1
  • LinkLibraryJobRow.build (cyclomatic 30) lib/widgets/link/link_library_actions.dart:654 — LinkLibraryJobRow.build has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _MornyeBottomBarState.build (cyclomatic 30) · ×1
  • _MornyeBottomBarState.build (cyclomatic 30) lib/widgets/mornye_bottom_bar.dart:158 — _MornyeBottomBarState.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 · SafDownloadHandler.handleSafLocked (cyclomatic 30) · ×1
  • SafDownloadHandler.handleSafLocked (cyclomatic 30) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:94 — SafDownloadHandler.handleSafLocked 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 · PlayerMetadataController.load (cyclomatic 29) · ×1
  • PlayerMetadataController.load (cyclomatic 29) lib/controllers/player_metadata_controller.dart:193 — PlayerMetadataController.load 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 · _MornyeLibraryScreenState.build (cyclomatic 29) · ×1
  • _MornyeLibraryScreenState.build (cyclomatic 29) lib/screens/mornye_library_screen.dart:309 — _MornyeLibraryScreenState.build has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _NetworkConnectionFormState.build (cyclomatic 29) · ×1
  • _NetworkConnectionFormState.build (cyclomatic 29) lib/screens/network_storage_screen.dart:873 — _NetworkConnectionFormState.build has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _MixBuilder.build (cyclomatic 29) · ×1
  • _MixBuilder.build (cyclomatic 29) lib/services/library_mixes.dart:698 — _MixBuilder.build has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryQueueStore._queueAlbumUnionSql (cyclomatic 29) · ×1
  • LibraryQueueStore._queueAlbumUnionSql (cyclomatic 29) lib/services/library_queue_store.dart:588 — LibraryQueueStore._queueAlbumUnionSql 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 · LinkHistorySyncStore.apply (cyclomatic 29) · ×1
  • LinkHistorySyncStore.apply (cyclomatic 29) lib/services/link/sync/link_history_sync_store.dart:106 — LinkHistorySyncStore.apply 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 · LyricsParser._parseLrcOrPlain (cyclomatic 29) · ×1
  • LyricsParser._parseLrcOrPlain (cyclomatic 29) lib/utils/lyrics_parser.dart:358 — LyricsParser._parseLrcOrPlain 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 · _LibraryDirectoryViewState.build (cyclomatic 29) · ×1
  • _LibraryDirectoryViewState.build (cyclomatic 29) lib/widgets/library_directory_view.dart:396 — _LibraryDirectoryViewState.build has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NetworkOfflineNotifier.save (cyclomatic 28) · ×1
  • NetworkOfflineNotifier.save (cyclomatic 28) lib/providers/network_offline_provider.dart:39 — NetworkOfflineNotifier.save 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 · TrackCard._buildCard (cyclomatic 28) · ×1
  • TrackCard._buildCard (cyclomatic 28) lib/widgets/track_card.dart:174 — TrackCard._buildCard 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 · LibraryQueueStore._appendQueueCommonFilters (cyclomatic 27) · ×1
  • LibraryQueueStore._appendQueueCommonFilters (cyclomatic 27) lib/services/library_queue_store.dart:940 — LibraryQueueStore._appendQueueCommonFilters has cyclomatic complexity 27 (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 · LibrarySearchStore.search (cyclomatic 27) · ×1
  • LibrarySearchStore.search (cyclomatic 27) lib/services/library_search.dart:126 — LibrarySearchStore.search 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 · LinkPhoneSession.apply (cyclomatic 27) · ×1
  • LinkPhoneSession.apply (cyclomatic 27) lib/services/link/features/link_phone_session.dart:226 — LinkPhoneSession.apply 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 · LinkCollectionSyncStore._withData (cyclomatic 27) · ×1
  • LinkCollectionSyncStore._withData (cyclomatic 27) lib/services/link/sync/link_collection_sync_store.dart:192 — LinkCollectionSyncStore._withData 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 · LinkHistoryArtwork.sync (cyclomatic 27) · ×1
  • LinkHistoryArtwork.sync (cyclomatic 27) lib/services/link/sync/link_history_artwork.dart:316 — LinkHistoryArtwork.sync 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 · LocalTrackRedownloadService._scoreMatch (cyclomatic 27) · ×1
  • LocalTrackRedownloadService._scoreMatch (cyclomatic 27) lib/services/local_track_redownload_service.dart:108 — LocalTrackRedownloadService._scoreMatch has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AudioplayersPlaybackDeck.resume (cyclomatic 27) · ×1
  • AudioplayersPlaybackDeck.resume (cyclomatic 27) lib/services/music_playback_deck.dart:570 — AudioplayersPlaybackDeck.resume 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 · _LastfmSettingsState.build (cyclomatic 27) · ×1
  • _LastfmSettingsState.build (cyclomatic 27) lib/widgets/lastfm_settings.dart:32 — _LastfmSettingsState.build has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MornyeLevelSlider.build (cyclomatic 27) · ×1
  • MornyeLevelSlider.build (cyclomatic 27) lib/widgets/mornye_level_slider.dart:60 — MornyeLevelSlider.build has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _HomeContinueListeningCardState.build (cyclomatic 26) · ×1
  • _HomeContinueListeningCardState.build (cyclomatic 26) lib/screens/home_tab_intro.dart:672 — _HomeContinueListeningCardState.build has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AudioMetadataMapper.convertToM4aTags (cyclomatic 26) · ×1
  • AudioMetadataMapper.convertToM4aTags (cyclomatic 26) lib/services/audio_metadata_mapper.dart:256 — AudioMetadataMapper.convertToM4aTags 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 · DownloadedEmbeddedCoverResolver._runPersistentCacheMaintenance (cyclomatic 26) · ×1
  • DownloadedEmbeddedCoverResolver._runPersistentCacheMaintenance (cyclomatic 26) lib/services/downloaded_embedded_cover_resolver.dart:894 — DownloadedEmbeddedCoverResolver._runPersistentCacheMaintenance 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 · FFmpegConversion.convertAudioFormat (cyclomatic 26) · ×1
  • FFmpegConversion.convertAudioFormat (cyclomatic 26) lib/services/ffmpeg_conversion.dart:213 — FFmpegConversion.convertAudioFormat 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 · LinkClientSession._connect (cyclomatic 26) · ×1
  • LinkClientSession._connect (cyclomatic 26) lib/services/link/client/link_client_session.dart:257 — LinkClientSession._connect 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 · _ExpressivePlaybackTransportState.build (cyclomatic 26) · ×1
  • _ExpressivePlaybackTransportState.build (cyclomatic 26) lib/widgets/expressive_playback_transport.dart:72 — _ExpressivePlaybackTransportState.build has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _MornyeArtistSurfaceState.build (cyclomatic 26) · ×1
  • _MornyeArtistSurfaceState.build (cyclomatic 26) lib/widgets/mornye_artist_header.dart:65 — _MornyeArtistSurfaceState.build has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _TimedLyricSweepPainter.paint (cyclomatic 26) · ×1
  • _TimedLyricSweepPainter.paint (cyclomatic 26) lib/widgets/player_lyrics_word_sweep.dart:616 — _TimedLyricSweepPainter.paint 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 · _PlaylistPickerSheetContentState.build (cyclomatic 26) · ×1
  • _PlaylistPickerSheetContentState.build (cyclomatic 26) lib/widgets/playlist_picker_sheet.dart:144 — _PlaylistPickerSheetContentState.build has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _TrackOptionsSheet.build (cyclomatic 26) · ×1
  • _TrackOptionsSheet.build (cyclomatic 26) lib/widgets/track_collection_quick_actions.dart:264 — _TrackOptionsSheet.build has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UsbDirectPlayback.command (cyclomatic 26) · ×1
  • UsbDirectPlayback.command (cyclomatic 26) android/app/src/main/kotlin/com/zarz/mornye/UsbDirectPlayback.kt:81 — UsbDirectPlayback.command 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 · Inner · ×1
  • Inner::search (cyclomatic 26) rust_backend/crates/providers/src/lyrics/service.rs:465 — Inner::search 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 · (anonymous).exported (cyclomatic 26) · ×1
  • (anonymous).exported (cyclomatic 26) rust_backend/crates/extensions/src/provider.js:25 — (anonymous).exported 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 · ExploreNotifier._restoreFromCache (cyclomatic 25) · ×1
  • ExploreNotifier._restoreFromCache (cyclomatic 25) lib/providers/explore_provider.dart:339 — ExploreNotifier._restoreFromCache 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 · _HomeTabState._performSearch (cyclomatic 25) · ×1
  • _HomeTabState._performSearch (cyclomatic 25) lib/screens/home_tab.dart:518 — _HomeTabState._performSearch 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 · _MainShellState._handleBackPress (cyclomatic 25) · ×1
  • _MainShellState._handleBackPress (cyclomatic 25) lib/screens/main_shell.dart:596 — _MainShellState._handleBackPress 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 · _FilesSettingsPageState.build (cyclomatic 25) · ×1
  • _FilesSettingsPageState.build (cyclomatic 25) lib/screens/settings/files_settings_page.dart:125 — _FilesSettingsPageState.build has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _LibraryHeroCard.build (cyclomatic 25) · ×1
  • _LibraryHeroCard.build (cyclomatic 25) lib/screens/settings/library_settings_page_widgets.dart:331 — _LibraryHeroCard.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 · AutoplayPreferenceModel._features (cyclomatic 25) · ×1
  • AutoplayPreferenceModel._features (cyclomatic 25) lib/services/autoplay_personalization.dart:147 — AutoplayPreferenceModel._features 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 · DownloadContainerFinalizer.finalize (cyclomatic 25) · ×1
  • DownloadContainerFinalizer.finalize (cyclomatic 25) lib/services/download_container_finalizer.dart:27 — DownloadContainerFinalizer.finalize 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 · DownloadedEmbeddedCoverResolver._extractCover (cyclomatic 25) · ×1
  • DownloadedEmbeddedCoverResolver._extractCover (cyclomatic 25) lib/services/downloaded_embedded_cover_resolver.dart:602 — DownloadedEmbeddedCoverResolver._extractCover 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 · ExclusiveOutputDeck._switchTo (cyclomatic 25) · ×1
  • ExclusiveOutputDeck._switchTo (cyclomatic 25) lib/services/exclusive_output_deck.dart:94 — ExclusiveOutputDeck._switchTo 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 · LibrarySchema.rebaseContainerPaths (cyclomatic 25) · ×1
  • LibrarySchema.rebaseContainerPaths (cyclomatic 25) lib/services/library_schema.dart:487 — LibrarySchema.rebaseContainerPaths 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 · LinkDesktopOps.runCommand (cyclomatic 25) · ×1
  • LinkDesktopOps.runCommand (cyclomatic 25) lib/services/link/desktop/link_desktop_ops.dart:291 — LinkDesktopOps.runCommand 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 · LinkWebCovers._run (cyclomatic 25) · ×1
  • LinkWebCovers._run (cyclomatic 25) lib/services/link/desktop/link_web_covers.dart:431 — LinkWebCovers._run 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 · _LinkSyncHandlers.star (cyclomatic 25) · ×1
  • _LinkSyncHandlers.star (cyclomatic 25) lib/services/link/sync/link_sync_handlers.dart:434 — _LinkSyncHandlers.star 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 · MotionArtworkProxy._handle (cyclomatic 25) · ×1
  • MotionArtworkProxy._handle (cyclomatic 25) lib/services/motion_artwork_proxy.dart:136 — MotionArtworkProxy._handle 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 · MusicPlayerHandler.applySettings (cyclomatic 25) · ×1
  • MusicPlayerHandler.applySettings (cyclomatic 25) lib/services/music_player_service.dart:227 — MusicPlayerHandler.applySettings 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 · MusicPlayerHandler._playInternal (cyclomatic 25) · ×1
  • MusicPlayerHandler._playInternal (cyclomatic 25) lib/services/music_player_service.dart:2179 — MusicPlayerHandler._playInternal 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 · MusicPlayerHandler.onSourceMetadataChanged (cyclomatic 25) · ×1
  • MusicPlayerHandler.onSourceMetadataChanged (cyclomatic 25) lib/services/music_player_service.dart:2554 — MusicPlayerHandler.onSourceMetadataChanged 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 · SubsonicClient.cachedCover (cyclomatic 25) · ×1
  • SubsonicClient.cachedCover (cyclomatic 25) lib/services/network_storage_subsonic.dart:553 — SubsonicClient.cachedCover 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 · _AudioFacts._processing (cyclomatic 25) · ×1
  • _AudioFacts._processing (cyclomatic 25) lib/widgets/audio_info_sheet.dart:600 — _AudioFacts._processing 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 · _DesktopShortcutsState._run (cyclomatic 25) · ×1
  • _DesktopShortcutsState._run (cyclomatic 25) lib/widgets/desktop/desktop_shortcuts.dart:119 — _DesktopShortcutsState._run has cyclomatic complexity 25 (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 · _MornyeSelectionPillState.build (cyclomatic 25) · ×1
  • _MornyeSelectionPillState.build (cyclomatic 25) lib/widgets/mornye_selection_pill.dart:157 — _MornyeSelectionPillState.build has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Request · ×1
  • Request::select (cyclomatic 25) rust_backend/crates/core/src/metadata/reenrich.rs:382 — Request::select 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. This is NOT this file's highest cyclomatic complexity: Request::update (cyclomatic 56) 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.
D1 · Cyclomatic Complexity · CookieJar · ×1
  • CookieJar::store (cyclomatic 25) rust_backend/crates/network/src/cookies.rs:22 — CookieJar::store 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 · _AlbumScreenState._buildAppBar (cyclomatic 24) · ×1
  • _AlbumScreenState._buildAppBar (cyclomatic 24) lib/screens/album_screen.dart:522 — _AlbumScreenState._buildAppBar 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 · _DownloadSettingsPageState.build (cyclomatic 24) · ×1
  • _DownloadSettingsPageState.build (cyclomatic 24) lib/screens/settings/download_settings_page.dart:32 — _DownloadSettingsPageState.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 · LinkMirroredPlayback._resolve (cyclomatic 24) · ×1
  • LinkMirroredPlayback._resolve (cyclomatic 24) lib/services/link/link_mirrored_playback.dart:435 — LinkMirroredPlayback._resolve 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 · _MusicAutoplay._fill (cyclomatic 24) · ×1
  • _MusicAutoplay._fill (cyclomatic 24) lib/services/music_player_autoplay.dart:506 — _MusicAutoplay._fill has cyclomatic complexity 24 (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 · MusicPlayerHandler._listenToPlayer (cyclomatic 24) · ×1
  • MusicPlayerHandler._listenToPlayer (cyclomatic 24) lib/services/music_player_service.dart:534 — MusicPlayerHandler._listenToPlayer 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 · NetworkStorageService.list (cyclomatic 24) · ×1
  • NetworkStorageService.list (cyclomatic 24) lib/services/network_storage_service.dart:974 — NetworkStorageService.list 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 · _LibraryDirectoryViewState._buildFolder (cyclomatic 24) · ×1
  • _LibraryDirectoryViewState._buildFolder (cyclomatic 24) lib/widgets/library_directory_view.dart:566 — _LibraryDirectoryViewState._buildFolder 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 · _LyricsOptionsButtonState._showMenu (cyclomatic 24) · ×1
  • _LyricsOptionsButtonState._showMenu (cyclomatic 24) lib/widgets/lyrics_options_button.dart:217 — _LyricsOptionsButtonState._showMenu 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 · _RenderPinnedSectionList.performLayout (cyclomatic 24) · ×1
  • _RenderPinnedSectionList.performLayout (cyclomatic 24) lib/widgets/pinned_section_sliver_list.dart:64 — _RenderPinnedSectionList.performLayout 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 · _TvNavigationState._handleKey (cyclomatic 24) · ×1
  • _TvNavigationState._handleKey (cyclomatic 24) lib/widgets/tv_navigation.dart:183 — _TvNavigationState._handleKey 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 · _UpdateDialogState.build (cyclomatic 24) · ×1
  • _UpdateDialogState.build (cyclomatic 24) lib/widgets/update_dialog.dart:246 — _UpdateDialogState.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 · ResolverHttp · ×1
  • ResolverHttp::execute (cyclomatic 24) rust_backend/crates/providers/src/resolver/http.rs:69 — ResolverHttp::execute 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 · _HomeSections.build (cyclomatic 23) · ×1
  • _HomeSections.build (cyclomatic 23) lib/screens/home_tab_intro.dart:358 — _HomeSections.build has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CollectionTrackTile.build (cyclomatic 23) · ×1
  • _CollectionTrackTile.build (cyclomatic 23) lib/screens/library_tracks_folder_screen.dart:1358 — _CollectionTrackTile.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 · AutoMixPlan.create (cyclomatic 23) · ×1
  • AutoMixPlan.create (cyclomatic 23) lib/services/automix_analysis.dart:240 — AutoMixPlan.create 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 · AutoplayPersonalization.finish (cyclomatic 23) · ×1
  • AutoplayPersonalization.finish (cyclomatic 23) lib/services/autoplay_personalization.dart:547 — AutoplayPersonalization.finish 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 · CsvImportService._bestCandidate (cyclomatic 23) · ×1
  • CsvImportService._bestCandidate (cyclomatic 23) lib/services/csv_import_service.dart:185 — CsvImportService._bestCandidate 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 · CueSplitLibraryService.publish (cyclomatic 23) · ×1
  • CueSplitLibraryService.publish (cyclomatic 23) lib/services/cue_split_library_service.dart:27 — CueSplitLibraryService.publish has cyclomatic complexity 23 (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 · LibraryDatabase.updateAudioMetadata (cyclomatic 23) · ×1
  • LibraryDatabase.updateAudioMetadata (cyclomatic 23) lib/services/library_database.dart:957 — LibraryDatabase.updateAudioMetadata 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 · MetadataPersistenceService._saveLocal (cyclomatic 23) · ×1
  • MetadataPersistenceService._saveLocal (cyclomatic 23) lib/services/metadata_persistence_service.dart:111 — MetadataPersistenceService._saveLocal 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 · PlayableMedia.toMediaItem (cyclomatic 23) · ×1
  • PlayableMedia.toMediaItem (cyclomatic 23) lib/services/playable_media.dart:130 — PlayableMedia.toMediaItem 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 · SongAnalysis._sweepLibrary (cyclomatic 23) · ×1
  • SongAnalysis._sweepLibrary (cyclomatic 23) lib/services/song_analysis.dart:256 — SongAnalysis._sweepLibrary 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 · SongFeatureAnalyzer.analyze (cyclomatic 23) · ×1
  • SongFeatureAnalyzer.analyze (cyclomatic 23) lib/services/song_feature_analyzer.dart:113 — SongFeatureAnalyzer.analyze 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 · _HiResCheckCardState._buildResult (cyclomatic 23) · ×1
  • _HiResCheckCardState._buildResult (cyclomatic 23) lib/widgets/hires_check_card.dart:205 — _HiResCheckCardState._buildResult 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 · _LibrarySearchResultsState._row (cyclomatic 23) · ×1
  • _LibrarySearchResultsState._row (cyclomatic 23) lib/widgets/library_search_results.dart:403 — _LibrarySearchResultsState._row 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 · NativeHistoryStore.buildPathMatchKeys (cyclomatic 23) · ×1
  • NativeHistoryStore.buildPathMatchKeys (cyclomatic 23) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:473 — NativeHistoryStore.buildPathMatchKeys 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 · CastService · ×1
  • CastService::call (cyclomatic 23) rust_backend/crates/cast/src/service.rs:64 — CastService::call has cyclomatic complexity 23 (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 · DownloadQueueNotifier._buildDownloadRequestPayload (cyclomatic 22) · ×1
  • DownloadQueueNotifier._buildDownloadRequestPayload (cyclomatic 22) lib/providers/download_queue_provider.dart:529 — DownloadQueueNotifier._buildDownloadRequestPayload 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 · _LibraryTracksFolderScreenState._buildSelectionBottomBar (cyclomatic 22) · ×1
  • _LibraryTracksFolderScreenState._buildSelectionBottomBar (cyclomatic 22) lib/screens/library_tracks_folder_screen.dart:744 — _LibraryTracksFolderScreenState._buildSelectionBottomBar 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 · _MainShellState.build (cyclomatic 22) · ×1
  • _MainShellState.build (cyclomatic 22) lib/screens/main_shell.dart:910 — _MainShellState.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 · _ExtensionItem.build (cyclomatic 22) · ×1
  • _ExtensionItem.build (cyclomatic 22) lib/screens/repo_tab.dart:941 — _ExtensionItem.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 · CoverDownloadService.saveRemoteCover (cyclomatic 22) · ×1
  • CoverDownloadService.saveRemoteCover (cyclomatic 22) lib/services/cover_download_service.dart:18 — CoverDownloadService.saveRemoteCover 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 · DiscordPresenceService._authenticate (cyclomatic 22) · ×1
  • DiscordPresenceService._authenticate (cyclomatic 22) lib/services/discord_presence_service.dart:251 — DiscordPresenceService._authenticate 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 · LinkClientController._updateDiscovery (cyclomatic 22) · ×1
  • LinkClientController._updateDiscovery (cyclomatic 22) lib/services/link/client/link_client_controller.dart:530 — LinkClientController._updateDiscovery 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 · MprisPlayerObject.handleMethodCall (cyclomatic 22) · ×1
  • MprisPlayerObject.handleMethodCall (cyclomatic 22) lib/services/media_session_mpris.dart:264 — MprisPlayerObject.handleMethodCall 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.
D1 · Cyclomatic Complexity · MusicHapticsAnalyzer.analyze (cyclomatic 22) · ×1
  • MusicHapticsAnalyzer.analyze (cyclomatic 22) lib/services/music_haptics.dart:274 — MusicHapticsAnalyzer.analyze 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 · AlbumDetailHeader._buildAppBar (cyclomatic 22) · ×1
  • AlbumDetailHeader._buildAppBar (cyclomatic 22) lib/widgets/album_detail_header.dart:334 — AlbumDetailHeader._buildAppBar 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 · _TransferSongRow.build (cyclomatic 22) · ×1
  • _TransferSongRow.build (cyclomatic 22) lib/widgets/link/link_transfer_tile.dart:650 — _TransferSongRow.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 · PlayerWidgetProvider.render (cyclomatic 22) · ×1
  • PlayerWidgetProvider.render (cyclomatic 22) android/app/src/main/kotlin/com/zarz/mornye/PlayerWidgetProvider.kt:133 — PlayerWidgetProvider.render 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 · LinkNowPlayingController.handle (cyclomatic 22) · ×1
  • LinkNowPlayingController.handle (cyclomatic 22) ios/Runner/LinkNowPlayingBridge.swift:53 — LinkNowPlayingController.handle 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 · ExtensionSetting · ×1
  • ExtensionSetting::deserialize (cyclomatic 22) rust_backend/crates/extensions/src/manifest.rs:64 — ExtensionSetting::deserialize 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 · PlayerMetadataController.searchOnline (cyclomatic 21) · ×1
  • PlayerMetadataController.searchOnline (cyclomatic 21) lib/controllers/player_metadata_controller.dart:103 — PlayerMetadataController.searchOnline 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 · DownloadQueueNotifier._startQueueRestore (cyclomatic 21) · ×1
  • DownloadQueueNotifier._startQueueRestore (cyclomatic 21) lib/providers/download_queue_provider.dart:274 — DownloadQueueNotifier._startQueueRestore 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 · _LibrarySourceSettingsItem.build (cyclomatic 21) · ×1
  • _LibrarySourceSettingsItem.build (cyclomatic 21) lib/screens/settings/library_settings_page_widgets.dart:167 — _LibrarySourceSettingsItem.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 · _LogScreenState.build (cyclomatic 21) · ×1
  • _LogScreenState.build (cyclomatic 21) lib/screens/settings/log_screen.dart:292 — _LogScreenState.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 · _CategoryRow.build (cyclomatic 21) · ×1
  • _CategoryRow.build (cyclomatic 21) lib/screens/settings/settings_tab.dart:1000 — _CategoryRow.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 · _SetupScreenState._selectDirectory (cyclomatic 21) · ×1
  • _SetupScreenState._selectDirectory (cyclomatic 21) lib/screens/setup_screen.dart:411 — _SetupScreenState._selectDirectory 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 · ContentUriPlaybackCache.resolve (cyclomatic 21) · ×1
  • ContentUriPlaybackCache.resolve (cyclomatic 21) lib/services/content_uri_playback_cache.dart:42 — ContentUriPlaybackCache.resolve 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 · LastfmService.finishConnection (cyclomatic 21) · ×1
  • LastfmService.finishConnection (cyclomatic 21) lib/services/lastfm/lastfm_service.dart:206 — LastfmService.finishConnection 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 · LibrarySchema.upgrade (cyclomatic 21) · ×1
  • LibrarySchema.upgrade (cyclomatic 21) lib/services/library_schema.dart:104 — LibrarySchema.upgrade 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 · LinkPairingClient.pair (cyclomatic 21) · ×1
  • LinkPairingClient.pair (cyclomatic 21) lib/services/link/client/link_client_pairing.dart:170 — LinkPairingClient.pair 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 · LinkPhoneCatalogs._page (cyclomatic 21) · ×1
  • LinkPhoneCatalogs._page (cyclomatic 21) lib/services/link/desktop/link_phone_catalogs.dart:181 — LinkPhoneCatalogs._page 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 · SharedLyricsTranslation.fromJson (cyclomatic 21) · ×1
  • SharedLyricsTranslation.fromJson (cyclomatic 21) lib/services/lyrics_translation_sharing.dart:46 — SharedLyricsTranslation.fromJson 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 · AudioplayersPlaybackDeck.setFileSource (cyclomatic 21) · ×1
  • AudioplayersPlaybackDeck.setFileSource (cyclomatic 21) lib/services/music_playback_deck.dart:383 — AudioplayersPlaybackDeck.setFileSource 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 · NetworkStorageService._openRead (cyclomatic 21) · ×1
  • NetworkStorageService._openRead (cyclomatic 21) lib/services/network_storage_service.dart:1335 — NetworkStorageService._openRead 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 · NetworkStorageService._serve (cyclomatic 21) · ×1
  • NetworkStorageService._serve (cyclomatic 21) lib/services/network_storage_service.dart:1440 — NetworkStorageService._serve 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.
D1 · Cyclomatic Complexity · ReplayGainService._writeLocalTags (cyclomatic 21) · ×1
  • ReplayGainService._writeLocalTags (cyclomatic 21) lib/services/replaygain_service.dart:135 — ReplayGainService._writeLocalTags 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 · DesktopInspector.build (cyclomatic 21) · ×1
  • DesktopInspector.build (cyclomatic 21) lib/widgets/desktop/desktop_inspector.dart:145 — DesktopInspector.build has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DesktopListScopeState._handleKey (cyclomatic 21) · ×1
  • _DesktopListScopeState._handleKey (cyclomatic 21) lib/widgets/desktop/desktop_selection.dart:191 — _DesktopListScopeState._handleKey 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 · _MornyeLandscapePlayerState.build (cyclomatic 21) · ×1
  • _MornyeLandscapePlayerState.build (cyclomatic 21) lib/widgets/mornye_landscape_player.dart:112 — _MornyeLandscapePlayerState.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 · MornyePlayerQueue.build (cyclomatic 21) · ×1
  • MornyePlayerQueue.build (cyclomatic 21) lib/widgets/mornye_player_queue.dart:18 — MornyePlayerQueue.build has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _PlaybackTimeBuilderState._sync (cyclomatic 21) · ×1
  • _PlaybackTimeBuilderState._sync (cyclomatic 21) lib/widgets/playback_time_builder.dart:70 — _PlaybackTimeBuilderState._sync 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 · _SyncedLyricsViewState._scheduleNextLine (cyclomatic 21) · ×1
  • _SyncedLyricsViewState._scheduleNextLine (cyclomatic 21) lib/widgets/player_lyrics.dart:505 — _SyncedLyricsViewState._scheduleNextLine 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 · CastOutputPlugin.handle (cyclomatic 21) · ×1
  • CastOutputPlugin.handle (cyclomatic 21) android/app/src/main/kotlin/com/zarz/mornye/CastOutputPlugin.kt:94 — CastOutputPlugin.handle 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 · DownloadQueueWidgetProvider.render (cyclomatic 21) · ×1
  • DownloadQueueWidgetProvider.render (cyclomatic 21) android/app/src/main/kotlin/com/zarz/mornye/DownloadQueueWidgetProvider.kt:103 — DownloadQueueWidgetProvider.render 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 · NativeFinalizerContainerKt.finalizeAutoConversion (cyclomatic 21) · ×1
  • NativeFinalizerContainerKt.finalizeAutoConversion (cyclomatic 21) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerContainer.kt:10 — NativeFinalizerContainerKt.finalizeAutoConversion 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 · Health · ×1
  • Health::run_check (cyclomatic 21) rust_backend/crates/extensions/src/backend/health.rs:232 — Health::run_check 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 · (anonymous).invokeManaged (cyclomatic 21) · ×1
  • (anonymous).invokeManaged (cyclomatic 21) rust_backend/crates/extensions/src/prelude.js:740 — (anonymous).invokeManaged 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.
D1 · Cyclomatic Complexity · DownloadQueueLookup.withoutIndex (cyclomatic 20) · ×1
  • DownloadQueueLookup.withoutIndex (cyclomatic 20) lib/providers/download_queue_state.dart:437 — DownloadQueueLookup.withoutIndex 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 · PlaybackController.playTrackList (cyclomatic 20) · ×1
  • PlaybackController.playTrackList (cyclomatic 20) lib/providers/playback_provider.dart:160 — PlaybackController.playTrackList 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 · TrackNotifier.search (cyclomatic 20) · ×1
  • TrackNotifier.search (cyclomatic 20) lib/providers/track_provider.dart:350 — TrackNotifier.search 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 · _DownloadedAlbumScreenState._buildAppBar (cyclomatic 20) · ×1
  • _DownloadedAlbumScreenState._buildAppBar (cyclomatic 20) lib/screens/downloaded_album_screen.dart:355 — _DownloadedAlbumScreenState._buildAppBar 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 · _LogSummaryCard._analyzeLogs (cyclomatic 20) · ×1
  • _LogSummaryCard._analyzeLogs (cyclomatic 20) lib/screens/settings/log_screen_widgets.dart:282 — _LogSummaryCard._analyzeLogs 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 · _SettingsTabState._buildCategoryList (cyclomatic 20) · ×1
  • _SettingsTabState._buildCategoryList (cyclomatic 20) lib/screens/settings/settings_tab.dart:638 — _SettingsTabState._buildCategoryList 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 · _SetupScreenState._requestStoragePermission (cyclomatic 20) · ×1
  • _SetupScreenState._requestStoragePermission (cyclomatic 20) lib/screens/setup_screen.dart:260 — _SetupScreenState._requestStoragePermission 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 · FFmpegDecryption._decryptMovKeyFile (cyclomatic 20) · ×1
  • FFmpegDecryption._decryptMovKeyFile (cyclomatic 20) lib/services/ffmpeg_decryption.dart:76 — FFmpegDecryption._decryptMovKeyFile 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 · LinkDesktopHost.exportCatalog (cyclomatic 20) · ×1
  • LinkDesktopHost.exportCatalog (cyclomatic 20) lib/services/link/desktop/link_desktop_host.dart:1024 — LinkDesktopHost.exportCatalog 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 · RuntimeLinkPlayerPort.snapshot (cyclomatic 20) · ×1
  • RuntimeLinkPlayerPort.snapshot (cyclomatic 20) lib/services/link/desktop/link_player.dart:247 — RuntimeLinkPlayerPort.snapshot 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 · LinkSyncRunner._syncOnce (cyclomatic 20) · ×1
  • LinkSyncRunner._syncOnce (cyclomatic 20) lib/services/link/sync/link_sync_runner.dart:256 — LinkSyncRunner._syncOnce 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 · SubsonicClient.list (cyclomatic 20) · ×1
  • SubsonicClient.list (cyclomatic 20) lib/services/network_storage_subsonic.dart:319 — SubsonicClient.list 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 · LyricPronunciationLayout.measure (cyclomatic 20) · ×1
  • LyricPronunciationLayout.measure (cyclomatic 20) lib/widgets/aligned_lyric_pronunciation.dart:31 — LyricPronunciationLayout.measure 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 · _AudioOutputButtonState._showPicker (cyclomatic 20) · ×1
  • _AudioOutputButtonState._showPicker (cyclomatic 20) lib/widgets/audio_output_button.dart:52 — _AudioOutputButtonState._showPicker 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 · _BatchConvertSheetState.build (cyclomatic 20) · ×1
  • _BatchConvertSheetState.build (cyclomatic 20) lib/widgets/batch_convert_sheet.dart:83 — _BatchConvertSheetState.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 · MaterialPlayerLayout.build (cyclomatic 20) · ×1
  • MaterialPlayerLayout.build (cyclomatic 20) lib/widgets/material_player_layout.dart:65 — MaterialPlayerLayout.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 · _MornyePlaybackButtonState.build (cyclomatic 20) · ×1
  • _MornyePlaybackButtonState.build (cyclomatic 20) lib/widgets/mornye_playback_button.dart:117 — _MornyePlaybackButtonState.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 · _PlaybackSeekSliderState.build (cyclomatic 20) · ×1
  • _PlaybackSeekSliderState.build (cyclomatic 20) lib/widgets/playback_seek_slider.dart:88 — _PlaybackSeekSliderState.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 · DownloadServiceSnapshotKt.writeNativeWorkerSnapshot (cyclomatic 20) · ×1
  • DownloadServiceSnapshotKt.writeNativeWorkerSnapshot (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/DownloadServiceSnapshot.kt:26 — DownloadServiceSnapshotKt.writeNativeWorkerSnapshot 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 · SafTreeListingKt.querySafChildrenOrThrow (cyclomatic 20) · ×1
  • SafTreeListingKt.querySafChildrenOrThrow (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:155 — SafTreeListingKt.querySafChildrenOrThrow 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 · UsbBitPerfectPlugin.onMethodCall (cyclomatic 20) · ×1
  • UsbBitPerfectPlugin.onMethodCall (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/UsbBitPerfectPlugin.kt:58 — UsbBitPerfectPlugin.onMethodCall 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 · DownloadProgressSubscription.poll (cyclomatic 20) · ×1
  • DownloadProgressSubscription.poll (cyclomatic 20) ios/Runner/DownloadProgressSubscription.swift:104 — DownloadProgressSubscription.poll 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 · FilePath · ×1
  • FilePath::open_native_read (cyclomatic 20) rust_backend/crates/extensions/src/files.rs:493 — FilePath::open_native_read 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 · SignedSession · ×1
  • SignedSession::deserialize (cyclomatic 20) rust_backend/crates/extensions/src/manifest.rs:64 — SignedSession::deserialize 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 · ArtistConcert.parseList (cyclomatic 19) · ×1
  • ArtistConcert.parseList (cyclomatic 19) lib/models/artist_concert.dart:28 — ArtistConcert.parseList 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 · DownloadHistoryNotifier.updateAudioMetadataForItem (cyclomatic 19) · ×1
  • DownloadHistoryNotifier.updateAudioMetadataForItem (cyclomatic 19) lib/providers/download_history_provider.dart:671 — DownloadHistoryNotifier.updateAudioMetadataForItem 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 · DownloadProgressSample.applyTo (cyclomatic 19) · ×1
  • DownloadProgressSample.applyTo (cyclomatic 19) lib/providers/download_progress.dart:32 — DownloadProgressSample.applyTo 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 · _SearchProviderDropdown.build (cyclomatic 19) · ×1
  • _SearchProviderDropdown.build (cyclomatic 19) lib/screens/home_tab_widgets.dart:8 — _SearchProviderDropdown.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 · _MonthlyDonationGoalCard.build (cyclomatic 19) · ×1
  • _MonthlyDonationGoalCard.build (cyclomatic 19) lib/screens/settings/donate_page.dart:123 — _MonthlyDonationGoalCard.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 · LinkDesktopSettingsPage.build (cyclomatic 19) · ×1
  • LinkDesktopSettingsPage.build (cyclomatic 19) lib/screens/settings/link_desktop_settings_page.dart:35 — LinkDesktopSettingsPage.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 · AppStateDatabase.migrateRecentAccessFromSharedPreferences (cyclomatic 19) · ×1
  • AppStateDatabase.migrateRecentAccessFromSharedPreferences (cyclomatic 19) lib/services/app_state_database.dart:261 — AppStateDatabase.migrateRecentAccessFromSharedPreferences 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 · SoundAutoplaySignal.prepare (cyclomatic 19) · ×1
  • SoundAutoplaySignal.prepare (cyclomatic 19) lib/services/autoplay_sound_signal.dart:93 — SoundAutoplaySignal.prepare has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · ExtensionStorageService.setUnsecuredStorage (cyclomatic 19) · ×1
  • ExtensionStorageService.setUnsecuredStorage (cyclomatic 19) lib/services/extension_storage_service.dart:72 — ExtensionStorageService.setUnsecuredStorage 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 · FFmpegConversion._convertToLossless (cyclomatic 19) · ×1
  • FFmpegConversion._convertToLossless (cyclomatic 19) lib/services/ffmpeg_conversion.dart:360 — FFmpegConversion._convertToLossless 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 · LibraryCollectionsDatabase.replaceDatabaseFromBackup (cyclomatic 19) · ×1
  • LibraryCollectionsDatabase.replaceDatabaseFromBackup (cyclomatic 19) lib/services/library_collections_database.dart:1167 — LibraryCollectionsDatabase.replaceDatabaseFromBackup has cyclomatic complexity 19 (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 · LinkDownloadUpdates._drain (cyclomatic 19) · ×1
  • LinkDownloadUpdates._drain (cyclomatic 19) lib/services/link/desktop/link_downloads.dart:104 — LinkDownloadUpdates._drain 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 · LinkPhoneSources.onMessage (cyclomatic 19) · ×1
  • LinkPhoneSources.onMessage (cyclomatic 19) lib/services/link/desktop/link_phone_sources.dart:424 — LinkPhoneSources.onMessage 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 · _MusicCast._changed (cyclomatic 19) · ×1
  • _MusicCast._changed (cyclomatic 19) lib/services/music_player_cast.dart:26 — _MusicCast._changed 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 · _MusicGapless.handoff (cyclomatic 19) · ×1
  • _MusicGapless.handoff (cyclomatic 19) lib/services/music_player_gapless.dart:231 — _MusicGapless.handoff 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 · NetworkMetadataService._load (cyclomatic 19) · ×1
  • NetworkMetadataService._load (cyclomatic 19) lib/services/network_metadata_service.dart:196 — NetworkMetadataService._load 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 · PlatformBridge._scanToNDJSONFile (cyclomatic 19) · ×1
  • PlatformBridge._scanToNDJSONFile (cyclomatic 19) lib/services/platform_bridge.dart:2587 — PlatformBridge._scanToNDJSONFile 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 · PlayableMedia.toJson (cyclomatic 19) · ×1
  • PlayableMedia.toJson (cyclomatic 19) lib/services/playable_media.dart:62 — PlayableMedia.toJson 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 · HeaderCircleButton.build (cyclomatic 19) · ×1
  • HeaderCircleButton.build (cyclomatic 19) lib/widgets/album_detail_header.dart:920 — HeaderCircleButton.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 · AppContentCard.build (cyclomatic 19) · ×1
  • AppContentCard.build (cyclomatic 19) lib/widgets/app_content_card.dart:40 — AppContentCard.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 · MornyeContextMenu._action (cyclomatic 19) · ×1
  • MornyeContextMenu._action (cyclomatic 19) lib/widgets/mornye_context_menu.dart:678 — MornyeContextMenu._action 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 · NativeFinalizerDecryptKt.finalizeDecryption (cyclomatic 19) · ×1
  • NativeFinalizerDecryptKt.finalizeDecryption (cyclomatic 19) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerDecrypt.kt:12 — NativeFinalizerDecryptKt.finalizeDecryption 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 · NativeFinalizerMetadataKt.refreshFinalAudioQualityMetadata (cyclomatic 19) · ×1
  • NativeFinalizerMetadataKt.refreshFinalAudioQualityMetadata (cyclomatic 19) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMetadata.kt:141 — NativeFinalizerMetadataKt.refreshFinalAudioQualityMetadata 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 · IndexCache · ×1
  • IndexCache::index (cyclomatic 19) rust_backend/crates/core/src/isrc/cache.rs:177 — IndexCache::index 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 · Vm · ×1
  • Vm::call (cyclomatic 19) rust_backend/crates/extensions/src/runtime/vm.rs:334 — Vm::call 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 · NetworkPermissions · ×1
  • NetworkPermissions::validate_with_grants (cyclomatic 19) rust_backend/crates/network/src/policy.rs:62 — NetworkPermissions::validate_with_grants 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 · _DownloadRun._embedSafNonM4a (cyclomatic 18) · ×1
  • _DownloadRun._embedSafNonM4a (cyclomatic 18) lib/providers/download_queue_provider_single_item.dart:1413 — _DownloadRun._embedSafNonM4a 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 · ExploreNotifier.fetchHomeFeed (cyclomatic 18) · ×1
  • ExploreNotifier.fetchHomeFeed (cyclomatic 18) lib/providers/explore_provider.dart:477 — ExploreNotifier.fetchHomeFeed 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 · ExtensionNotifier.restoreFromBackup (cyclomatic 18) · ×1
  • ExtensionNotifier.restoreFromBackup (cyclomatic 18) lib/providers/extension_provider.dart:698 — ExtensionNotifier.restoreFromBackup 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 · SettingsNotifier._runMigrations (cyclomatic 18) · ×1
  • SettingsNotifier._runMigrations (cyclomatic 18) lib/providers/settings_provider.dart:300 — SettingsNotifier._runMigrations 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 · _BackupRestorePageState._restoreBackup (cyclomatic 18) · ×1
  • _BackupRestorePageState._restoreBackup (cyclomatic 18) lib/screens/settings/backup_restore_page.dart:96 — _BackupRestorePageState._restoreBackup 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 · _SetupScreenState.build (cyclomatic 18) · ×1
  • _SetupScreenState.build (cyclomatic 18) lib/screens/setup_screen.dart:750 — _SetupScreenState.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 · _EditMetadataSheetState._save (cyclomatic 18) · ×1
  • _EditMetadataSheetState._save (cyclomatic 18) lib/screens/track_metadata_edit_sheet.dart:291 — _EditMetadataSheetState._save has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _EditMetadataSheetState._fieldLabel (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DownloadFileFinalizer.decrypt (cyclomatic 18) · ×1
  • DownloadFileFinalizer.decrypt (cyclomatic 18) lib/services/download_file_finalizer.dart:114 — DownloadFileFinalizer.decrypt 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 · FolderPathTemplate.segments (cyclomatic 18) · ×1
  • FolderPathTemplate.segments (cyclomatic 18) lib/services/folder_path_template.dart:41 — FolderPathTemplate.segments 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 · HistorySchema.upgrade (cyclomatic 18) · ×1
  • HistorySchema.upgrade (cyclomatic 18) lib/services/history_schema.dart:82 — HistorySchema.upgrade 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 · LastfmService._flush (cyclomatic 18) · ×1
  • LastfmService._flush (cyclomatic 18) lib/services/lastfm/lastfm_service.dart:379 — LastfmService._flush 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 · LibraryCollectionsDatabase.migrateFromSharedPreferences (cyclomatic 18) · ×1
  • LibraryCollectionsDatabase.migrateFromSharedPreferences (cyclomatic 18) lib/services/library_collections_database.dart:270 — LibraryCollectionsDatabase.migrateFromSharedPreferences 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 · LinkClientController._onDiscoveryChanged (cyclomatic 18) · ×1
  • LinkClientController._onDiscoveryChanged (cyclomatic 18) lib/services/link/client/link_client_controller.dart:575 — LinkClientController._onDiscoveryChanged 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 · LinkCollectionSyncStore._write (cyclomatic 18) · ×1
  • LinkCollectionSyncStore._write (cyclomatic 18) lib/services/link/sync/link_collection_sync_store.dart:439 — LinkCollectionSyncStore._write 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 · LinkHistoryArtwork._apply (cyclomatic 18) · ×1
  • LinkHistoryArtwork._apply (cyclomatic 18) lib/services/link/sync/link_history_artwork.dart:215 — LinkHistoryArtwork._apply 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 · ListeningRewind.compute (cyclomatic 18) · ×1
  • ListeningRewind.compute (cyclomatic 18) lib/services/listening_rewind.dart:161 — ListeningRewind.compute 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 · AudioplayersPlaybackDeck._syncEqualizer (cyclomatic 18) · ×1
  • AudioplayersPlaybackDeck._syncEqualizer (cyclomatic 18) lib/services/music_playback_deck.dart:227 — AudioplayersPlaybackDeck._syncEqualizer 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 · AudioplayersPlaybackDeck.refreshNativeStatus (cyclomatic 18) · ×1
  • AudioplayersPlaybackDeck.refreshNativeStatus (cyclomatic 18) lib/services/music_playback_deck.dart:504 — AudioplayersPlaybackDeck.refreshNativeStatus 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 · MusicPlayerHandler._refreshPlaybackAutomation (cyclomatic 18) · ×1
  • MusicPlayerHandler._refreshPlaybackAutomation (cyclomatic 18) lib/services/music_player_service.dart:731 — MusicPlayerHandler._refreshPlaybackAutomation 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 · MusicPlayerHandler.reapplyNormalization (cyclomatic 18) · ×1
  • MusicPlayerHandler.reapplyNormalization (cyclomatic 18) lib/services/music_player_service.dart:1136 — MusicPlayerHandler.reapplyNormalization has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MusicPlayerHandler._resolveSource (cyclomatic 18) · ×1
  • MusicPlayerHandler._resolveSource (cyclomatic 18) lib/services/music_player_service.dart:1187 — MusicPlayerHandler._resolveSource 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 · UpdateChecker.checkForUpdate (cyclomatic 18) · ×1
  • UpdateChecker.checkForUpdate (cyclomatic 18) lib/services/update_checker.dart:335 — UpdateChecker.checkForUpdate 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 · AppAlertDialog.build (cyclomatic 18) · ×1
  • AppAlertDialog.build (cyclomatic 18) lib/widgets/app_alert_dialog.dart:240 — AppAlertDialog.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 · AppSheetOption.build (cyclomatic 18) · ×1
  • AppSheetOption.build (cyclomatic 18) lib/widgets/app_bottom_sheet.dart:607 — AppSheetOption.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 · AppChoiceChip.build (cyclomatic 18) · ×1
  • AppChoiceChip.build (cyclomatic 18) lib/widgets/app_choice_chip.dart:27 — AppChoiceChip.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 · _MornyeSwitchState.build (cyclomatic 18) · ×1
  • _MornyeSwitchState.build (cyclomatic 18) lib/widgets/app_switch.dart:69 — _MornyeSwitchState.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 · _AudioFacts._source (cyclomatic 18) · ×1
  • _AudioFacts._source (cyclomatic 18) lib/widgets/audio_info_sheet.dart:487 — _AudioFacts._source 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 · _LibrarySearchResultsState._tile (cyclomatic 18) · ×1
  • _LibrarySearchResultsState._tile (cyclomatic 18) lib/widgets/library_search_results.dart:561 — _LibrarySearchResultsState._tile 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 · _LyricsOptionsButtonState._buildButton (cyclomatic 18) · ×1
  • _LyricsOptionsButtonState._buildButton (cyclomatic 18) lib/widgets/lyrics_options_button.dart:121 — _LyricsOptionsButtonState._buildButton 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 · _MotionHeaderBannerState._initialize (cyclomatic 18) · ×1
  • _MotionHeaderBannerState._initialize (cyclomatic 18) lib/widgets/motion_header_banner.dart:119 — _MotionHeaderBannerState._initialize 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 · _PlaybackFeedbackState.initState (cyclomatic 18) · ×1
  • _PlaybackFeedbackState.initState (cyclomatic 18) lib/widgets/playback_feedback.dart:31 — _PlaybackFeedbackState.initState 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 · DownloadService.buildNotification (cyclomatic 18) · ×1
  • DownloadService.buildNotification (cyclomatic 18) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1591 — DownloadService.buildNotification 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 · WavSource · ×1
  • WavSource::open (cyclomatic 18) rust_backend/crates/core/src/media/hires.rs:581 — WavSource::open 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 · QualitySpecificSetting · ×1
  • QualitySpecificSetting::deserialize (cyclomatic 18) rust_backend/crates/extensions/src/manifest.rs:64 — QualitySpecificSetting::deserialize 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 · SearchBehavior · ×1
  • SearchBehavior::deserialize (cyclomatic 18) rust_backend/crates/extensions/src/manifest.rs:64 — SearchBehavior::deserialize 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 · HealthCheck · ×1
  • HealthCheck::deserialize (cyclomatic 18) rust_backend/crates/extensions/src/manifest.rs:64 — HealthCheck::deserialize 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 · NetworkSession · ×1
  • NetworkSession::execute_stream (cyclomatic 18) rust_backend/crates/network/src/client.rs:519 — NetworkSession::execute_stream 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 · DownloadHistoryNotifier._commitInspectedHistoryChanges (cyclomatic 17) · ×1
  • DownloadHistoryNotifier._commitInspectedHistoryChanges (cyclomatic 17) lib/providers/download_history_provider.dart:1081 — DownloadHistoryNotifier._commitInspectedHistoryChanges 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 · _DownloadRun._resolveTrackIdentifiers (cyclomatic 17) · ×1
  • _DownloadRun._resolveTrackIdentifiers (cyclomatic 17) lib/providers/download_queue_provider_single_item.dart:429 — _DownloadRun._resolveTrackIdentifiers 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 · LocalLibraryNotifier._loadFromDatabase (cyclomatic 17) · ×1
  • LocalLibraryNotifier._loadFromDatabase (cyclomatic 17) lib/providers/local_library_provider.dart:277 — LocalLibraryNotifier._loadFromDatabase 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 · _ConcertDetailScreenState._materialPage (cyclomatic 17) · ×1
  • _ConcertDetailScreenState._materialPage (cyclomatic 17) lib/screens/concert_detail_screen.dart:446 — _ConcertDetailScreenState._materialPage 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 · _SearchCoverCell.build (cyclomatic 17) · ×1
  • _SearchCoverCell.build (cyclomatic 17) lib/screens/home_tab_search_wide.dart:804 — _SearchCoverCell.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 · _LibraryTracksFolderScreenState._showEntryMenu (cyclomatic 17) · ×1
  • _LibraryTracksFolderScreenState._showEntryMenu (cyclomatic 17) lib/screens/library_tracks_folder_screen.dart:646 — _LibraryTracksFolderScreenState._showEntryMenu 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 · _NetworkConnectionFormState._save (cyclomatic 17) · ×1
  • _NetworkConnectionFormState._save (cyclomatic 17) lib/screens/network_storage_screen.dart:690 — _NetworkConnectionFormState._save 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 · _SettingItemState._invokeAction (cyclomatic 17) · ×1
  • _SettingItemState._invokeAction (cyclomatic 17) lib/screens/settings/extension_detail_page_widgets.dart:540 — _SettingItemState._invokeAction 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 · _LibrarySettingsPageState._pickLibraryFolder (cyclomatic 17) · ×1
  • _LibrarySettingsPageState._pickLibraryFolder (cyclomatic 17) lib/screens/settings/library_settings_page.dart:116 — _LibrarySettingsPageState._pickLibraryFolder 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 · _ScanProgressTile.build (cyclomatic 17) · ×1
  • _ScanProgressTile.build (cyclomatic 17) lib/screens/settings/library_settings_page_widgets.dart:604 — _ScanProgressTile.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 · _SettingsTabState._buildList (cyclomatic 17) · ×1
  • _SettingsTabState._buildList (cyclomatic 17) lib/screens/settings/settings_tab.dart:784 — _SettingsTabState._buildList 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 · _WhatsNewScreenState.build (cyclomatic 17) · ×1
  • _WhatsNewScreenState.build (cyclomatic 17) lib/screens/whats_new_screen.dart:133 — _WhatsNewScreenState.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 · AppStateDatabase.getPendingDownloadQueueRows (cyclomatic 17) · ×1
  • AppStateDatabase.getPendingDownloadQueueRows (cyclomatic 17) lib/services/app_state_database.dart:325 — AppStateDatabase.getPendingDownloadQueueRows 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 · AudioAnalysisCache.trim (cyclomatic 17) · ×1
  • AudioAnalysisCache.trim (cyclomatic 17) lib/services/audio_analysis_cache.dart:185 — AudioAnalysisCache.trim 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 · AudioAnalysisRunner._getMediaInfo (cyclomatic 17) · ×1
  • AudioAnalysisRunner._getMediaInfo (cyclomatic 17) lib/services/audio_analysis_runner.dart:415 — AudioAnalysisRunner._getMediaInfo 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 · AutoMixAnalyzer.analyze (cyclomatic 17) · ×1
  • AutoMixAnalyzer.analyze (cyclomatic 17) lib/services/automix_analyzer.dart:119 — AutoMixAnalyzer.analyze 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 · DesktopUpdater.download (cyclomatic 17) · ×1
  • DesktopUpdater.download (cyclomatic 17) lib/services/desktop_updater.dart:83 — DesktopUpdater.download 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 · DownloadMetadataResolver.resolveSpotifyTrackViaDeezer (cyclomatic 17) · ×1
  • DownloadMetadataResolver.resolveSpotifyTrackViaDeezer (cyclomatic 17) lib/services/download_metadata_resolver.dart:238 — DownloadMetadataResolver.resolveSpotifyTrackViaDeezer 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 · DownloadQueuePersistence._enqueue (cyclomatic 17) · ×1
  • DownloadQueuePersistence._enqueue (cyclomatic 17) lib/services/download_queue_persistence.dart:103 — DownloadQueuePersistence._enqueue 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 · DownloadedEmbeddedCoverResolver._drainPreviewValidations (cyclomatic 17) · ×1
  • DownloadedEmbeddedCoverResolver._drainPreviewValidations (cyclomatic 17) lib/services/downloaded_embedded_cover_resolver.dart:394 — DownloadedEmbeddedCoverResolver._drainPreviewValidations 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 · FFmpegConversion._convertToPcm (cyclomatic 17) · ×1
  • FFmpegConversion._convertToPcm (cyclomatic 17) lib/services/ffmpeg_conversion.dart:453 — FFmpegConversion._convertToPcm 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 · FFmpegMetadataInput.prepare (cyclomatic 17) · ×1
  • FFmpegMetadataInput.prepare (cyclomatic 17) lib/services/ffmpeg_metadata_input.dart:24 — FFmpegMetadataInput.prepare 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 · _MixBuilder._index (cyclomatic 17) · ×1
  • _MixBuilder._index (cyclomatic 17) lib/services/library_mixes.dart:763 — _MixBuilder._index 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 · LinkArrivingFiles._serve (cyclomatic 17) · ×1
  • LinkArrivingFiles._serve (cyclomatic 17) lib/services/link/desktop/link_arriving_files.dart:122 — LinkArrivingFiles._serve 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 · LinkPhoneCatalogs._addCovers (cyclomatic 17) · ×1
  • LinkPhoneCatalogs._addCovers (cyclomatic 17) lib/services/link/desktop/link_phone_catalogs.dart:357 — LinkPhoneCatalogs._addCovers 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 · LinkTrackResolver.resolve (cyclomatic 17) · ×1
  • LinkTrackResolver.resolve (cyclomatic 17) lib/services/link/features/link_track_resolver.dart:85 — LinkTrackResolver.resolve 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 · LinkPhoneSong.toJson (cyclomatic 17) · ×1
  • LinkPhoneSong.toJson (cyclomatic 17) lib/services/link/link_protocol.dart:660 — LinkPhoneSong.toJson 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 · LinkCollectionSyncStore.apply (cyclomatic 17) · ×1
  • LinkCollectionSyncStore.apply (cyclomatic 17) lib/services/link/sync/link_collection_sync_store.dart:306 — LinkCollectionSyncStore.apply has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · LocalNetworkAccess._isLocalAddress (cyclomatic 17) · ×1
  • LocalNetworkAccess._isLocalAddress (cyclomatic 17) lib/services/local_network_access.dart:80 — LocalNetworkAccess._isLocalAddress 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 · MediaKitPlaybackDeck.queueNextSource (cyclomatic 17) · ×1
  • MediaKitPlaybackDeck.queueNextSource (cyclomatic 17) lib/services/media_kit_playback_deck.dart:363 — MediaKitPlaybackDeck.queueNextSource 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 · _MusicFailures.skipMissing (cyclomatic 17) · ×1
  • _MusicFailures.skipMissing (cyclomatic 17) lib/services/music_player_failures.dart:67 — _MusicFailures.skipMissing 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 · NetworkPlaybackCache.lookup (cyclomatic 17) · ×1
  • NetworkPlaybackCache.lookup (cyclomatic 17) lib/services/network_playback_cache.dart:191 — NetworkPlaybackCache.lookup 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 · LyricDisplayLayout.LyricDisplayLayout (cyclomatic 17) · ×1
  • LyricDisplayLayout.LyricDisplayLayout (cyclomatic 17) lib/utils/lyrics_timeline.dart:11 — LyricDisplayLayout.LyricDisplayLayout 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 · DesktopNavigationRail.build (cyclomatic 17) · ×1
  • DesktopNavigationRail.build (cyclomatic 17) lib/widgets/desktop/desktop_navigation.dart:600 — DesktopNavigationRail.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 · DesktopSidebar.build (cyclomatic 17) · ×1
  • DesktopSidebar.build (cyclomatic 17) lib/widgets/desktop/desktop_navigation.dart:1082 — DesktopSidebar.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 · _TrailingControls.build (cyclomatic 17) · ×1
  • _TrailingControls.build (cyclomatic 17) lib/widgets/desktop/desktop_player_bar.dart:831 — _TrailingControls.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 · _ServiceChip.build (cyclomatic 17) · ×1
  • _ServiceChip.build (cyclomatic 17) lib/widgets/download_service_picker.dart:416 — _ServiceChip.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 · LinkDevicesSheet.build (cyclomatic 17) · ×1
  • LinkDevicesSheet.build (cyclomatic 17) lib/widgets/link/link_devices_sheet.dart:95 — LinkDevicesSheet.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 · _LyricsEditorSheetState._buildFooter (cyclomatic 17) · ×1
  • _LyricsEditorSheetState._buildFooter (cyclomatic 17) lib/widgets/lyrics_editor_sheet.dart:449 — _LyricsEditorSheetState._buildFooter 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 · _LyricsEditorRow.build (cyclomatic 17) · ×1
  • _LyricsEditorRow.build (cyclomatic 17) lib/widgets/lyrics_editor_sheet.dart:629 — _LyricsEditorRow.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 · DownloadService.onStartCommand (cyclomatic 17) · ×1
  • DownloadService.onStartCommand (cyclomatic 17) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:395 — DownloadService.onStartCommand 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 · AppDelegate.handleMethodCall (cyclomatic 17) · ×1
  • AppDelegate.handleMethodCall (cyclomatic 17) ios/Runner/AppDelegate.swift:317 — AppDelegate.handleMethodCall 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 · (anonymous).album (cyclomatic 17) · ×1
  • (anonymous).album (cyclomatic 17) rust_backend/crates/extensions/src/provider.js:156 — (anonymous).album 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenAudioController.open (cyclomatic 16) · ×1
  • OpenAudioController.open (cyclomatic 16) lib/controllers/open_audio_controller.dart:94 — OpenAudioController.open 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 · ThemeSettings.== (cyclomatic 16) · ×1
  • ThemeSettings.== (cyclomatic 16) lib/models/theme_settings.dart:181 — ThemeSettings.== 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 · DownloadQueueNotifier.updateItemStatus (cyclomatic 16) · ×1
  • DownloadQueueNotifier.updateItemStatus (cyclomatic 16) lib/providers/download_queue_provider.dart:888 — DownloadQueueNotifier.updateItemStatus 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 · _DownloadRun._persistCompletionAndNotify (cyclomatic 16) · ×1
  • _DownloadRun._persistCompletionAndNotify (cyclomatic 16) lib/providers/download_queue_provider_single_item.dart:1579 — _DownloadRun._persistCompletionAndNotify 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 · DownloadQueueLookup.updatedForIndices (cyclomatic 16) · ×1
  • DownloadQueueLookup.updatedForIndices (cyclomatic 16) lib/providers/download_queue_state.dart:608 — DownloadQueueLookup.updatedForIndices 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 · ExtensionNotifier.initialize (cyclomatic 16) · ×1
  • ExtensionNotifier.initialize (cyclomatic 16) lib/providers/extension_provider.dart:147 — ExtensionNotifier.initialize 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 · _HomeShortcuts.build (cyclomatic 16) · ×1
  • _HomeShortcuts.build (cyclomatic 16) lib/screens/home_tab_intro.dart:1515 — _HomeShortcuts.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 · _RepoTabState.build (cyclomatic 16) · ×1
  • _RepoTabState.build (cyclomatic 16) lib/screens/repo_tab.dart:68 — _RepoTabState.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 · _CacheManagementPageState.build (cyclomatic 16) · ×1
  • _CacheManagementPageState.build (cyclomatic 16) lib/screens/settings/cache_management_page.dart:346 — _CacheManagementPageState.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 · _LinkSettingsPageState._notices (cyclomatic 16) · ×1
  • _LinkSettingsPageState._notices (cyclomatic 16) lib/screens/settings/link_settings_page.dart:188 — _LinkSettingsPageState._notices 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 · _LyricsAiTranslationPageState.build (cyclomatic 16) · ×1
  • _LyricsAiTranslationPageState.build (cyclomatic 16) lib/screens/settings/lyrics_ai_translation_page.dart:55 — _LyricsAiTranslationPageState.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 · _TextSheetBodyState.build (cyclomatic 16) · ×1
  • _TextSheetBodyState.build (cyclomatic 16) lib/screens/settings/lyrics_ai_translation_page.dart:462 — _TextSheetBodyState.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 · LyricsSettingsPage.build (cyclomatic 16) · ×1
  • LyricsSettingsPage.build (cyclomatic 16) lib/screens/settings/lyrics_settings_page.dart:26 — LyricsSettingsPage.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 · _SetupScreenState._isStepCompleted (cyclomatic 16) · ×1
  • _SetupScreenState._isStepCompleted (cyclomatic 16) lib/screens/setup_screen.dart:717 — _SetupScreenState._isStepCompleted 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 · OpenAudioFile.parse (cyclomatic 16) · ×1
  • OpenAudioFile.parse (cyclomatic 16) lib/services/audio_file_open_service.dart:26 — OpenAudioFile.parse 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 · AutoMixAnalyzer.analyzeTransition (cyclomatic 16) · ×1
  • AutoMixAnalyzer.analyzeTransition (cyclomatic 16) lib/services/automix_analyzer.dart:65 — AutoMixAnalyzer.analyzeTransition 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 · AutoMixEffectRenderer.render (cyclomatic 16) · ×1
  • AutoMixEffectRenderer.render (cyclomatic 16) lib/services/automix_effect_renderer.dart:103 — AutoMixEffectRenderer.render 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 · CoverStore.file (cyclomatic 16) · ×1
  • CoverStore.file (cyclomatic 16) lib/services/cover_store.dart:153 — CoverStore.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 · CoverStore.trim (cyclomatic 16) · ×1
  • CoverStore.trim (cyclomatic 16) lib/services/cover_store.dart:242 — CoverStore.trim 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 · DownloadScheduler.run (cyclomatic 16) · ×1
  • DownloadScheduler.run (cyclomatic 16) lib/services/download_scheduler.dart:24 — DownloadScheduler.run 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 · LastfmListening.update (cyclomatic 16) · ×1
  • LastfmListening.update (cyclomatic 16) lib/services/lastfm/lastfm_listening.dart:58 — LastfmListening.update 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 · LinkDesktopOps.playHandoff (cyclomatic 16) · ×1
  • LinkDesktopOps.playHandoff (cyclomatic 16) lib/services/link/desktop/link_desktop_ops.dart:362 — LinkDesktopOps.playHandoff 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 · LinkWebCovers._probeNew (cyclomatic 16) · ×1
  • LinkWebCovers._probeNew (cyclomatic 16) lib/services/link/desktop/link_web_covers.dart:517 — LinkWebCovers._probeNew 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 · LinkHandoff._sendQueue (cyclomatic 16) · ×1
  • LinkHandoff._sendQueue (cyclomatic 16) lib/services/link/features/link_handoff.dart:393 — LinkHandoff._sendQueue 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 · LinkPhoneFileRequests._deleteSong (cyclomatic 16) · ×1
  • LinkPhoneFileRequests._deleteSong (cyclomatic 16) lib/services/link/features/link_phone_library_sync.dart:399 — LinkPhoneFileRequests._deleteSong 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 · LinkOfflineSaver.save (cyclomatic 16) · ×1
  • LinkOfflineSaver.save (cyclomatic 16) lib/services/link/features/link_save_offline.dart:354 — LinkOfflineSaver.save 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 · MediaSessionFilter._advancesTo (cyclomatic 16) · ×1
  • MediaSessionFilter._advancesTo (cyclomatic 16) lib/services/media_session_filter.dart:101 — MediaSessionFilter._advancesTo 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 · _MusicAutoMix.onPosition (cyclomatic 16) · ×1
  • _MusicAutoMix.onPosition (cyclomatic 16) lib/services/music_player_automix.dart:118 — _MusicAutoMix.onPosition 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 · MusicPlayerHandler._stopSession (cyclomatic 16) · ×1
  • MusicPlayerHandler._stopSession (cyclomatic 16) lib/services/music_player_service.dart:2368 — MusicPlayerHandler._stopSession 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 · LogBuffer.exportWithDeviceInfo (cyclomatic 16) · ×1
  • LogBuffer.exportWithDeviceInfo (cyclomatic 16) lib/utils/logger.dart:300 — LogBuffer.exportWithDeviceInfo 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 · LyricsDraft.toLrc (cyclomatic 16) · ×1
  • LyricsDraft.toLrc (cyclomatic 16) lib/utils/lyrics_draft.dart:278 — LyricsDraft.toLrc 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 · LyricTimelineIndex.activeIndices (cyclomatic 16) · ×1
  • LyricTimelineIndex.activeIndices (cyclomatic 16) lib/utils/lyrics_timeline.dart:101 — LyricTimelineIndex.activeIndices 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 · AppActionButton.build (cyclomatic 16) · ×1
  • AppActionButton.build (cyclomatic 16) lib/widgets/app_action_button.dart:34 — AppActionButton.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 · _AppCrashBannerState.build (cyclomatic 16) · ×1
  • _AppCrashBannerState.build (cyclomatic 16) lib/widgets/app_crash_banner.dart:30 — _AppCrashBannerState.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 · _AudioAnalysisCardState._analyze (cyclomatic 16) · ×1
  • _AudioAnalysisCardState._analyze (cyclomatic 16) lib/widgets/audio_analysis_widget.dart:234 — _AudioAnalysisCardState._analyze 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 · _AlbumRowViewState.build (cyclomatic 16) · ×1
  • _AlbumRowViewState.build (cyclomatic 16) lib/widgets/desktop/track_table.dart:852 — _AlbumRowViewState.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 · LinkTransferGlyph.build (cyclomatic 16) · ×1
  • LinkTransferGlyph.build (cyclomatic 16) lib/widgets/link/link_transfer_tile.dart:234 — LinkTransferGlyph.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 · _MornyePlayerArtworkState.build (cyclomatic 16) · ×1
  • _MornyePlayerArtworkState.build (cyclomatic 16) lib/widgets/mornye_player_artwork.dart:35 — _MornyePlayerArtworkState.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 · _SyncedLyricsViewState._scrollUntilBuilt (cyclomatic 16) · ×1
  • _SyncedLyricsViewState._scrollUntilBuilt (cyclomatic 16) lib/widgets/player_lyrics.dart:734 — _SyncedLyricsViewState._scrollUntilBuilt 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 · SettingsSwitchItem.build (cyclomatic 16) · ×1
  • SettingsSwitchItem.build (cyclomatic 16) lib/widgets/settings_group.dart:595 — SettingsSwitchItem.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 · ImpellerCompatibilityKt.shouldDisableImpeller (cyclomatic 16) · ×1
  • ImpellerCompatibilityKt.shouldDisableImpeller (cyclomatic 16) android/app/src/main/kotlin/com/zarz/mornye/ImpellerCompatibility.kt:68 — ImpellerCompatibilityKt.shouldDisableImpeller 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 · NativeDownloadFinalizer.writeAlbumReplayGain (cyclomatic 16) · ×1
  • NativeDownloadFinalizer.writeAlbumReplayGain (cyclomatic 16) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:327 — NativeDownloadFinalizer.writeAlbumReplayGain 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 · LinkNowPlayingController.sharedArtwork (cyclomatic 16) · ×1
  • LinkNowPlayingController.sharedArtwork (cyclomatic 16) ios/Runner/LinkNowPlayingBridge.swift:133 — LinkNowPlayingController.sharedArtwork 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 · ExtensionPackage · ×1
  • ExtensionPackage::open (cyclomatic 16) rust_backend/crates/extensions/src/package.rs:52 — ExtensionPackage::open 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 · (anonymous).fields (cyclomatic 16) · ×1
  • (anonymous).fields (cyclomatic 16) rust_backend/crates/extensions/src/provider.js:105 — (anonymous).fields 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 · _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cognitive 278) · ×1
  • _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cognitive 278) lib/screens/track_metadata_screen.dart:358 — _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile has cognitive complexity 278 (threshold 15). Drivers by points: ternaries 33 (109 pts), boolean chains 90, if/else 28 (76 pts), loops 1 (2 pts), error handling 1 (nesting depth added 125). 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 · NetworkLibraryScanner._scan (cognitive 209) · ×1
  • NetworkLibraryScanner._scan (cognitive 209) lib/services/network_library_scanner.dart:122 — NetworkLibraryScanner._scan has cognitive complexity 209 (threshold 15). Drivers by points: if/else 36 (134 pts), boolean chains 19, error handling 6 (19 pts), loops 5 (19 pts), ternaries 5 (18 pts) (nesting depth added 138). 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 · _MusicAutoMix._start (cognitive 168) · ×1
  • _MusicAutoMix._start (cognitive 168) lib/services/music_player_automix.dart:288 — _MusicAutoMix._start has cognitive complexity 168 (threshold 15). Drivers by points: if/else 38 (114 pts), ternaries 12 (33 pts), boolean chains 15, error handling 3 (6 pts) (nesting depth added 100). 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 · DownloadMetadataEmbedding.embed (cognitive 163) · ×1
  • DownloadMetadataEmbedding.embed (cognitive 163) lib/services/download_metadata_embedding.dart:86 — DownloadMetadataEmbedding.embed has cognitive complexity 163 (threshold 15). Drivers by points: if/else 31 (85 pts), boolean chains 30, error handling 9 (27 pts), ternaries 6 (21 pts) (nesting depth added 87). 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 · SafFileInspectionKt.inspectSafFiles (cognitive 137) · ×1
  • SafFileInspectionKt.inspectSafFiles (cognitive 137) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:90 — SafFileInspectionKt.inspectSafFiles has cognitive complexity 137 (threshold 15). Drivers by points: if/else 32 (82 pts), loops 14 (30 pts), error handling 6 (16 pts), boolean chains 9 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _NowPlayingScreenState._buildPlayer (cognitive 122) · ×1
  • _NowPlayingScreenState._buildPlayer (cognitive 122) lib/screens/now_playing_screen.dart:311 — _NowPlayingScreenState._buildPlayer has cognitive complexity 122 (threshold 15). Drivers by points: ternaries 43 (61 pts), boolean chains 35, if/else 20 (26 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 · MainActivitySafScanKt.scanSafTree (cognitive 119) · ×1
  • MainActivitySafScanKt.scanSafTree (cognitive 119) REDACTED:120 — MainActivitySafScanKt.scanSafTree has cognitive complexity 119 (threshold 15). Drivers by points: if/else 50 (80 pts), error handling 11 (23 pts), boolean chains 9, loops 5 (7 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 · MainActivitySafScanKt.scanSafTreeIncremental (cognitive 113) · ×1
  • MainActivitySafScanKt.scanSafTreeIncremental (cognitive 113) REDACTED:542 — MainActivitySafScanKt.scanSafTreeIncremental has cognitive complexity 113 (threshold 15). Drivers by points: if/else 38 (80 pts), loops 8 (15 pts), error handling 6 (12 pts), boolean chains 6 (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 · MusicPlayerHandler._loadIndex (cognitive 112) · ×1
  • MusicPlayerHandler._loadIndex (cognitive 112) lib/services/music_player_service.dart:1733 — MusicPlayerHandler._loadIndex has cognitive complexity 112 (threshold 15). Drivers by points: if/else 43 (85 pts), boolean chains 10, error handling 6 (10 pts), ternaries 4 (7 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LibrarySearchResultsState._buildSlivers (cognitive 112) · ×1
  • _LibrarySearchResultsState._buildSlivers (cognitive 112) lib/widgets/library_search_results.dart:753 — _LibrarySearchResultsState._buildSlivers has cognitive complexity 112 (threshold 15). Drivers by points: if/else 23 (53 pts), ternaries 12 (35 pts), boolean chains 16, loops 3 (5 pts), error handling 1 (3 pts) (nesting depth added 57). 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 · _SyncedLyricsViewState._buildLyrics (cognitive 107) · ×1
  • _SyncedLyricsViewState._buildLyrics (cognitive 107) lib/widgets/player_lyrics.dart:888 — _SyncedLyricsViewState._buildLyrics has cognitive complexity 107 (threshold 15). Drivers by points: ternaries 35 (52 pts), boolean chains 30, if/else 17 (22 pts), loops 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _NetworkStorageScreenState.build (cognitive 103) · ×1
  • _NetworkStorageScreenState.build (cognitive 103) lib/screens/network_storage_screen.dart:318 — _NetworkStorageScreenState.build has cognitive complexity 103 (threshold 15). Drivers by points: ternaries 28 (57 pts), if/else 15 (23 pts), boolean chains 21, 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 · _HomeTabState.build (cognitive 101) · ×1
  • _HomeTabState.build (cognitive 101) lib/screens/home_tab.dart:769 — _HomeTabState.build has cognitive complexity 101 (threshold 15). Drivers by points: boolean chains 77, if/else 20 (21 pts), ternaries 3 (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 · DownloadQueueNotifier._processQueueSingleFlight (cognitive 97) · ×1
  • DownloadQueueNotifier._processQueueSingleFlight (cognitive 97) lib/providers/download_queue_provider.dart:1646 — DownloadQueueNotifier._processQueueSingleFlight has cognitive complexity 97 (threshold 15). Drivers by points: if/else 37 (51 pts), boolean chains 30, error handling 7 (15 pts), ternaries 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 · _DownloadRun._handleDownloadSuccess (cognitive 96) · ×1
  • _DownloadRun._handleDownloadSuccess (cognitive 96) lib/providers/download_queue_provider_single_item.dart:607 — _DownloadRun._handleDownloadSuccess has cognitive complexity 96 (threshold 15). Drivers by points: if/else 27 (41 pts), boolean chains 35, ternaries 9 (16 pts), error handling 1 (2 pts), match/switch 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 · DownloadHistoryNotifier._inspectOrphanedEntries (cognitive 95) · ×1
  • DownloadHistoryNotifier._inspectOrphanedEntries (cognitive 95) lib/providers/download_history_provider.dart:854 — DownloadHistoryNotifier._inspectOrphanedEntries has cognitive complexity 95 (threshold 15). Drivers by points: if/else 17 (57 pts), loops 6 (12 pts), boolean chains 9, error handling 3 (9 pts), ternaries 3 (8 pts) (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 · LyricsParser._parseTtml (cognitive 92) · ×1
  • LyricsParser._parseTtml (cognitive 92) lib/utils/lyrics_parser.dart:645 — LyricsParser._parseTtml has cognitive complexity 92 (threshold 15). Drivers by points: if/else 13 (41 pts), ternaries 6 (24 pts), loops 6 (17 pts), boolean chains 9, error handling 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 · _PlaybackSettingsPageState.build (cognitive 88) · ×1
  • _PlaybackSettingsPageState.build (cognitive 88) lib/screens/settings/playback_settings_page.dart:148 — _PlaybackSettingsPageState.build has cognitive complexity 88 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 20, ternaries 8 (17 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrackNotifier.fetchFromUrl (cognitive 86) · ×1
  • TrackNotifier.fetchFromUrl (cognitive 86) lib/providers/track_provider.dart:167 — TrackNotifier.fetchFromUrl has cognitive complexity 86 (threshold 15). Drivers by points: if/else 19 (49 pts), ternaries 6 (24 pts), boolean chains 10, loops 1 (2 pts), error handling 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeFinalizerMediaKt.embedBasicMetadata (cognitive 84) · ×1
  • NativeFinalizerMediaKt.embedBasicMetadata (cognitive 84) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt:239 — NativeFinalizerMediaKt.embedBasicMetadata has cognitive complexity 84 (threshold 15). Drivers by points: if/else 47 (65 pts), boolean chains 15, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _QueueTabState.build (cognitive 82) · ×1
  • _QueueTabState.build (cognitive 82) lib/screens/queue_tab.dart:524 — _QueueTabState.build has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 31, if/else 25 (31 pts), ternaries 17 (18 pts), match/switch 2 (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 · _MusicGapless._prepare (cognitive 81) · ×1
  • _MusicGapless._prepare (cognitive 81) lib/services/music_player_gapless.dart:97 — _MusicGapless._prepare has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (57 pts), boolean chains 12, ternaries 5 (8 pts), error handling 2 (4 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 · _LibrarySettingsPageState.build (cognitive 79) · ×1
  • _LibrarySettingsPageState.build (cognitive 79) lib/screens/settings/library_settings_page.dart:469 — _LibrarySettingsPageState.build has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 29 (56 pts), boolean chains 15, if/else 5 (7 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetadataAutofillService.enrich (cognitive 76) · ×1
  • MetadataAutofillService.enrich (cognitive 76) lib/services/metadata_autofill_service.dart:116 — MetadataAutofillService.enrich has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 19, error handling 4 (9 pts), ternaries 8, 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 · PlayerPlaybackControls.build (cognitive 75) · ×1
  • PlayerPlaybackControls.build (cognitive 75) lib/widgets/player_playback_controls.dart:63 — PlayerPlaybackControls.build has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 28 (47 pts), if/else 15 (20 pts), boolean chains 8 (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 · NetworkStorageService.parseListing (cognitive 74) · ×1
  • NetworkStorageService.parseListing (cognitive 74) lib/services/network_storage_service.dart:1135 — NetworkStorageService.parseListing has cognitive complexity 74 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 25, loops 4 (7 pts), error handling 1 (4 pts), ternaries 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 · BackupService._parseArchive (cognitive 73) · ×1
  • BackupService._parseArchive (cognitive 73) lib/services/backup_service.dart:614 — BackupService._parseArchive has cognitive complexity 73 (threshold 15). Drivers by points: if/else 19 (54 pts), boolean chains 12, error handling 2 (4 pts), loops 1 (3 pts) (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.
D2 · Cognitive Complexity · BackupService.writeBackupArchive (cognitive 72) · ×1
  • BackupService.writeBackupArchive (cognitive 72) lib/services/backup_service.dart:174 — BackupService.writeBackupArchive has cognitive complexity 72 (threshold 15). Drivers by points: if/else 21 (48 pts), loops 5 (16 pts), boolean chains 6, error handling 1 (2 pts) (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.
D2 · Cognitive Complexity · _DownloadRun._run (cognitive 67) · ×1
  • _DownloadRun._run (cognitive 67) lib/providers/download_queue_provider_single_item.dart:137 — _DownloadRun._run has cognitive complexity 67 (threshold 15). Drivers by points: if/else 23 (46 pts), error handling 3 (7 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (4 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.
D2 · Cognitive Complexity · RepoExtension · ×1
  • RepoExtension::deserialize (cognitive 67) rust_backend/crates/extensions/src/repository/model.rs:66 — RepoExtension::deserialize has cognitive complexity 67 (threshold 15). Drivers by points: if/else 20 (40 pts), match/switch 20 (26 pts), 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 · LyricsTranslator.translate (cognitive 66) · ×1
  • LyricsTranslator.translate (cognitive 66) lib/services/lyrics_translation.dart:367 — LyricsTranslator.translate has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 11, loops 8 (10 pts), ternaries 6 (8 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 · LyricsParser._parseLrcOrPlain (cognitive 65) · ×1
  • LyricsParser._parseLrcOrPlain (cognitive 65) lib/utils/lyrics_parser.dart:358 — LyricsParser._parseLrcOrPlain has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (38 pts), ternaries 6 (15 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _AudioFacts._output (cognitive 65) · ×1
  • _AudioFacts._output (cognitive 65) lib/widgets/audio_info_sheet.dart:689 — _AudioFacts._output has cognitive complexity 65 (threshold 15). Drivers by points: if/else 28 (40 pts), ternaries 7 (15 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadService.processConcurrentNativeRequest (cognitive 65) · ×1
  • DownloadService.processConcurrentNativeRequest (cognitive 65) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1067 — DownloadService.processConcurrentNativeRequest has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (45 pts), error handling 4 (9 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApkDownloader.downloadApk (cognitive 64) · ×1
  • ApkDownloader.downloadApk (cognitive 64) lib/services/apk_downloader.dart:18 — ApkDownloader.downloadApk has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (49 pts), boolean chains 6, ternaries 2 (4 pts), error handling 2 (3 pts), loops 1 (2 pts) (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.
D2 · Cognitive Complexity · LinkLibraryExecutor.call (cognitive 64) · ×1
  • LinkLibraryExecutor.call (cognitive 64) lib/services/link/desktop/link_library_executor.dart:76 — LinkLibraryExecutor.call has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (40 pts), boolean chains 13, loops 4 (8 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · DownloadFileRecovery._recover (cognitive 63) · ×1
  • DownloadFileRecovery._recover (cognitive 63) lib/services/download_file_recovery.dart:83 — DownloadFileRecovery._recover has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 15, ternaries 5 (9 pts), loops 3 (5 pts), error handling 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.
D2 · Cognitive Complexity · _MusicAutoMix._prepare (cognitive 63) · ×1
  • _MusicAutoMix._prepare (cognitive 63) lib/services/music_player_automix.dart:156 — _MusicAutoMix._prepare has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (44 pts), boolean chains 8, ternaries 4 (6 pts), error handling 2 (5 pts) (nesting depth added 29). 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 · MornyePlayerLayout.build (cognitive 62) · ×1
  • MornyePlayerLayout.build (cognitive 62) lib/widgets/mornye_player_layout.dart:87 — MornyePlayerLayout.build has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 29 (42 pts), boolean chains 11, if/else 6 (7 pts), loops 2 (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 · SafDownloadHandler.handleSafLocked (cognitive 62) · ×1
  • SafDownloadHandler.handleSafLocked (cognitive 62) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:94 — SafDownloadHandler.handleSafLocked has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (49 pts), boolean chains 7, error handling 3 (6 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.
D2 · Cognitive Complexity · _LinkSyncHandlers.star (cognitive 61) · ×1
  • _LinkSyncHandlers.star (cognitive 61) lib/services/link/sync/link_sync_handlers.dart:434 — _LinkSyncHandlers.star has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 6 (17 pts), boolean chains 4, ternaries 1 (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.
D2 · Cognitive Complexity · LinkWebCovers._run (cognitive 60) · ×1
  • LinkWebCovers._run (cognitive 60) lib/services/link/desktop/link_web_covers.dart:431 — LinkWebCovers._run has cognitive complexity 60 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 7 (17 pts), error handling 2 (4 pts), boolean chains 2 (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 · LibrarySchema.rebaseContainerPaths (cognitive 58) · ×1
  • LibrarySchema.rebaseContainerPaths (cognitive 58) lib/services/library_schema.dart:487 — LibrarySchema.rebaseContainerPaths has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 7 (13 pts), ternaries 3 (8 pts), boolean chains 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LyricsDraft.parse (cognitive 58) · ×1
  • LyricsDraft.parse (cognitive 58) lib/utils/lyrics_draft.dart:113 — LyricsDraft.parse has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 8 (12 pts), ternaries 6 (12 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MiniPlayerBodyState.build (cognitive 58) · ×1
  • _MiniPlayerBodyState.build (cognitive 58) lib/widgets/mini_player.dart:206 — _MiniPlayerBodyState.build has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 25 (41 pts), if/else 10 (11 pts), boolean chains 6 (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 · _MornyeArtworkContrastState._sample (cognitive 58) · ×1
  • _MornyeArtworkContrastState._sample (cognitive 58) lib/widgets/mornye_artwork_contrast.dart:134 — _MornyeArtworkContrastState._sample has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 19, loops 4 (10 pts), ternaries 2 (6 pts), error handling 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 · _LibraryTracksFolderScreenState._buildAppBar (cognitive 57) · ×1
  • _LibraryTracksFolderScreenState._buildAppBar (cognitive 57) lib/screens/library_tracks_folder_screen.dart:902 — _LibraryTracksFolderScreenState._buildAppBar has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 21, if/else 10 (17 pts), ternaries 14 (15 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.
D2 · Cognitive Complexity · _ArtistScreenState._buildPage (cognitive 56) · ×1
  • _ArtistScreenState._buildPage (cognitive 56) lib/screens/artist_screen.dart:634 — _ArtistScreenState._buildPage has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 15, ternaries 5 (8 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 · _SetupScreenState._selectDirectory (cognitive 56) · ×1
  • _SetupScreenState._selectDirectory (cognitive 56) lib/screens/setup_screen.dart:411 — _SetupScreenState._selectDirectory has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (46 pts), ternaries 1 (5 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _DownloadRun._applyFormatHandling (cognitive 55) · ×1
  • _DownloadRun._applyFormatHandling (cognitive 55) lib/providers/download_queue_provider_single_item.dart:942 — _DownloadRun._applyFormatHandling has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 32, if/else 13 (19 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MotionArtworkProxy._handle (cognitive 55) · ×1
  • MotionArtworkProxy._handle (cognitive 55) lib/services/motion_artwork_proxy.dart:136 — MotionArtworkProxy._handle has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 4 (13 pts), boolean chains 8, error handling 3 (5 pts) (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 · DownloadQueueWidgetProvider.render (cognitive 54) · ×1
  • DownloadQueueWidgetProvider.render (cognitive 54) android/app/src/main/kotlin/com/zarz/mornye/DownloadQueueWidgetProvider.kt:103 — DownloadQueueWidgetProvider.render has cognitive complexity 54 (threshold 15). Drivers by points: if/else 29 (49 pts), boolean chains 4, 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 · MornyeGlass.build (cognitive 53) · ×1
  • MornyeGlass.build (cognitive 53) lib/widgets/mornye_chrome.dart:214 — MornyeGlass.build has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 23 (28 pts), boolean chains 20, if/else 3 (5 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.
D2 · Cognitive Complexity · RustCoreBackend.invokeApplication (cognitive 52) · ×1
  • RustCoreBackend.invokeApplication (cognitive 52) ios/Runner/CoreBackend.swift:643 — RustCoreBackend.invokeApplication has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (35 pts), ternaries 5 (11 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 22). Of this number, 51 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 · NativeDownloadFinalizer.finalize (cognitive 51) · ×1
  • NativeDownloadFinalizer.finalize (cognitive 51) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:88 — NativeDownloadFinalizer.finalize has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (28 pts), error handling 11 (20 pts), boolean chains 3 (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, 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 · ExploreNotifier._restoreFromCache (cognitive 50) · ×1
  • ExploreNotifier._restoreFromCache (cognitive 50) lib/providers/explore_provider.dart:339 — ExploreNotifier._restoreFromCache has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (38 pts), ternaries 3 (6 pts), boolean chains 3, error handling 2 (3 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 · _MornyeLibraryScreenState.build (cognitive 50) · ×1
  • _MornyeLibraryScreenState.build (cognitive 50) lib/screens/mornye_library_screen.dart:309 — _MornyeLibraryScreenState.build has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 6, ternaries 4 (6 pts), loops 1 (3 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 · DownloadFileFinalizer.autoConvert (cognitive 50) · ×1
  • DownloadFileFinalizer.autoConvert (cognitive 50) lib/services/download_file_finalizer.dart:194 — DownloadFileFinalizer.autoConvert has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 10, ternaries 4 (7 pts), error handling 4 (5 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 · LinkDesktopRemote._applyLocally (cognitive 50) · ×1
  • LinkDesktopRemote._applyLocally (cognitive 50) lib/services/link/features/link_desktop_remote.dart:211 — LinkDesktopRemote._applyLocally has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 9 (16 pts), boolean chains 13, match/switch 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 · LinkCollectionSyncStore._withData (cognitive 50) · ×1
  • LinkCollectionSyncStore._withData (cognitive 50) lib/services/link/sync/link_collection_sync_store.dart:192 — LinkCollectionSyncStore._withData has cognitive complexity 50 (threshold 15). Drivers by points: loops 15 (24 pts), if/else 9 (23 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DsdFile.readFrames (cognitive 50) · ×1
  • DsdFile.readFrames (cognitive 50) android/app/src/main/kotlin/com/zarz/mornye/DsdFile.kt:134 — DsdFile.readFrames has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 4 (10 pts) (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.
D2 · Cognitive Complexity · LinkHistorySyncStore.apply (cognitive 49) · ×1
  • LinkHistorySyncStore.apply (cognitive 49) lib/services/link/sync/link_history_sync_store.dart:106 — LinkHistorySyncStore.apply has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 7 (13 pts), loops 7 (10 pts), boolean chains 7 (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 · DownloadedEmbeddedCoverResolver._drainPreviewValidations (cognitive 48) · ×1
  • DownloadedEmbeddedCoverResolver._drainPreviewValidations (cognitive 48) lib/services/downloaded_embedded_cover_resolver.dart:394 — DownloadedEmbeddedCoverResolver._drainPreviewValidations has cognitive complexity 48 (threshold 15). Drivers by points: if/else 7 (27 pts), ternaries 2 (8 pts), error handling 2 (7 pts), boolean chains 4, loops 1 (2 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.
D2 · Cognitive Complexity · DownloadedEmbeddedCoverResolver._extractCover (cognitive 48) · ×1
  • DownloadedEmbeddedCoverResolver._extractCover (cognitive 48) lib/services/downloaded_embedded_cover_resolver.dart:602 — DownloadedEmbeddedCoverResolver._extractCover has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 6, ternaries 2 (4 pts), error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkHistoryArtwork.sync (cognitive 48) · ×1
  • LinkHistoryArtwork.sync (cognitive 48) lib/services/link/sync/link_history_artwork.dart:316 — LinkHistoryArtwork.sync has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 7 (12 pts), boolean chains 8 (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 · MusicPlayerHandler.onSourceMetadataChanged (cognitive 48) · ×1
  • MusicPlayerHandler.onSourceMetadataChanged (cognitive 48) lib/services/music_player_service.dart:2554 — MusicPlayerHandler.onSourceMetadataChanged has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 7, loops 2 (5 pts), ternaries 2 (5 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 · SongFeatureAnalyzer.analyze (cognitive 47) · ×1
  • SongFeatureAnalyzer.analyze (cognitive 47) lib/services/song_feature_analyzer.dart:113 — SongFeatureAnalyzer.analyze has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (35 pts), error handling 4 (5 pts), loops 2 (4 pts), boolean chains 3 (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 · LinkOfflineSaver.save (cognitive 46) · ×1
  • LinkOfflineSaver.save (cognitive 46) lib/services/link/features/link_save_offline.dart:354 — LinkOfflineSaver.save has cognitive complexity 46 (threshold 15). Drivers by points: if/else 7 (24 pts), error handling 5 (18 pts), boolean chains 2, loops 1 (2 pts) (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.
D2 · Cognitive Complexity · RustCoreBackendApplicationKt.dispatchApplication (cognitive 46) · ×1
  • RustCoreBackendApplicationKt.dispatchApplication (cognitive 46) android/app/src/rust/kotlin/com/zarz/mornye/RustCoreBackendApplication.kt:9 — RustCoreBackendApplicationKt.dispatchApplication has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (30 pts), match/switch 5 (8 pts), error handling 3 (6 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · _SetupScreenState._requestStoragePermission (cognitive 45) · ×1
  • _SetupScreenState._requestStoragePermission (cognitive 45) lib/screens/setup_screen.dart:260 — _SetupScreenState._requestStoragePermission has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 3, error handling 1 (nesting depth added 25). 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 · LinkClientSession._connect (cognitive 45) · ×1
  • LinkClientSession._connect (cognitive 45) lib/services/link/client/link_client_session.dart:257 — LinkClientSession._connect has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 7, ternaries 2 (5 pts), error handling 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 · NetworkOfflineNotifier.save (cognitive 44) · ×1
  • NetworkOfflineNotifier.save (cognitive 44) lib/providers/network_offline_provider.dart:39 — NetworkOfflineNotifier.save has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 11, ternaries 3 (7 pts), loops 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LibraryTracksFolderScreenState.build (cognitive 44) · ×1
  • _LibraryTracksFolderScreenState.build (cognitive 44) lib/screens/library_tracks_folder_screen.dart:337 — _LibraryTracksFolderScreenState.build has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 9 (16 pts), match/switch 4, 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 · AudioAnalysisCache.trim (cognitive 44) · ×1
  • AudioAnalysisCache.trim (cognitive 44) lib/services/audio_analysis_cache.dart:185 — AudioAnalysisCache.trim has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 3 (7 pts), error handling 2 (5 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadedEmbeddedCoverResolver._runPersistentCacheMaintenance (cognitive 44) · ×1
  • DownloadedEmbeddedCoverResolver._runPersistentCacheMaintenance (cognitive 44) lib/services/downloaded_embedded_cover_resolver.dart:894 — DownloadedEmbeddedCoverResolver._runPersistentCacheMaintenance has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 8, error handling 2 (4 pts), loops 2, ternaries 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 · MetadataPersistenceService._saveLocal (cognitive 44) · ×1
  • MetadataPersistenceService._saveLocal (cognitive 44) lib/services/metadata_persistence_service.dart:111 — MetadataPersistenceService._saveLocal has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 4 (9 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkStorageService._request (cognitive 44) · ×1
  • NetworkStorageService._request (cognitive 44) lib/services/network_storage_service.dart:809 — NetworkStorageService._request has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 14, ternaries 3 (6 pts), error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoplayPreferenceModel.decode (cognitive 43) · ×1
  • AutoplayPreferenceModel.decode (cognitive 43) lib/services/autoplay_personalization.dart:281 — AutoplayPreferenceModel.decode has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 17, loops 2 (4 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadScheduler.run (cognitive 43) · ×1
  • DownloadScheduler.run (cognitive 43) lib/services/download_scheduler.dart:24 — DownloadScheduler.run has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (29 pts), loops 3 (9 pts), boolean chains 3, error handling 2 (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 · LibraryQueueStore._queueAlbumUnionSql (cognitive 43) · ×1
  • LibraryQueueStore._queueAlbumUnionSql (cognitive 43) lib/services/library_queue_store.dart:588 — LibraryQueueStore._queueAlbumUnionSql has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 16 (29 pts), boolean chains 7, if/else 5 (7 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 · AudioplayersPlaybackDeck.setFileSource (cognitive 43) · ×1
  • AudioplayersPlaybackDeck.setFileSource (cognitive 43) lib/services/music_playback_deck.dart:383 — AudioplayersPlaybackDeck.setFileSource has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 2 (8 pts), boolean chains 6, error handling 2 (4 pts) (nesting depth added 23). 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 · _TrackTableRowViewState.build (cognitive 43) · ×1
  • _TrackTableRowViewState.build (cognitive 43) lib/widgets/desktop/track_table.dart:619 — _TrackTableRowViewState.build has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 18 (25 pts), if/else 7 (11 pts), boolean chains 6, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TimedLyricSweepPainter.paint (cognitive 43) · ×1
  • _TimedLyricSweepPainter.paint (cognitive 43) lib/widgets/player_lyrics_word_sweep.dart:616 — _TimedLyricSweepPainter.paint has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 5 (11 pts), loops 6 (8 pts), boolean chains 7 (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 · NetworkSession · ×1
  • NetworkSession::execute_stream (cognitive 43) rust_backend/crates/network/src/client.rs:519 — NetworkSession::execute_stream has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 3 (11 pts), boolean chains 4 (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 · _MixBuilder.build (cognitive 42) · ×1
  • _MixBuilder.build (cognitive 42) lib/services/library_mixes.dart:698 — _MixBuilder.build has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 8 (9 pts), boolean chains 5, ternaries 2 (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 · LinkLibraryJobsHost.handle (cognitive 42) · ×1
  • LinkLibraryJobsHost.handle (cognitive 42) lib/services/link/desktop/link_library_jobs_host.dart:76 — LinkLibraryJobsHost.handle has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 12, loops 4 (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.
D2 · Cognitive Complexity · MusicHapticsAnalyzer.analyze (cognitive 42) · ×1
  • MusicHapticsAnalyzer.analyze (cognitive 42) lib/services/music_haptics.dart:274 — MusicHapticsAnalyzer.analyze has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (31 pts), error handling 3 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkStorageService._openRead (cognitive 42) · ×1
  • NetworkStorageService._openRead (cognitive 42) lib/services/network_storage_service.dart:1335 — NetworkStorageService._openRead has cognitive complexity 42 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 6 (13 pts), error handling 5 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncedLyricsViewState._maybeAutoScroll (cognitive 42) · ×1
  • _SyncedLyricsViewState._maybeAutoScroll (cognitive 42) lib/widgets/player_lyrics.dart:767 — _SyncedLyricsViewState._maybeAutoScroll has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 16, ternaries 6 (9 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 · CookieJar · ×1
  • CookieJar::store (cognitive 42) rust_backend/crates/network/src/cookies.rs:22 — CookieJar::store has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 7, 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 · CoverDownloadService.saveRemoteCover (cognitive 41) · ×1
  • CoverDownloadService.saveRemoteCover (cognitive 41) lib/services/cover_download_service.dart:18 — CoverDownloadService.saveRemoteCover has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateChecker.checkForUpdate (cognitive 41) · ×1
  • UpdateChecker.checkForUpdate (cognitive 41) lib/services/update_checker.dart:335 — UpdateChecker.checkForUpdate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 2 (6 pts), loops 2 (5 pts), boolean chains 1, 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 · PlayerMetadataController.load (cognitive 40) · ×1
  • PlayerMetadataController.load (cognitive 40) lib/controllers/player_metadata_controller.dart:193 — PlayerMetadataController.load has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 9, 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 · PlaybackController.playTrackList (cognitive 40) · ×1
  • PlaybackController.playTrackList (cognitive 40) lib/providers/playback_provider.dart:160 — PlaybackController.playTrackList has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 3 (5 pts), ternaries 1 (3 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.
D2 · Cognitive Complexity · _RepoTabState.build (cognitive 40) · ×1
  • _RepoTabState.build (cognitive 40) lib/screens/repo_tab.dart:68 — _RepoTabState.build has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 3 (6 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · _LibrarySettingsPageState._pickLibraryFolder (cognitive 40) · ×1
  • _LibrarySettingsPageState._pickLibraryFolder (cognitive 40) lib/screens/settings/library_settings_page.dart:116 — _LibrarySettingsPageState._pickLibraryFolder has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (29 pts), error handling 2 (5 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 23). 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 · SongAnalysis._sweepLibrary (cognitive 40) · ×1
  • SongAnalysis._sweepLibrary (cognitive 40) lib/services/song_analysis.dart:256 — SongAnalysis._sweepLibrary has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 6, loops 2 (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 · LinkLibraryJobRow.build (cognitive 40) · ×1
  • LinkLibraryJobRow.build (cognitive 40) lib/widgets/link/link_library_actions.dart:654 — LinkLibraryJobRow.build has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (8 pts), ternaries 5 (8 pts), boolean chains 7, 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 · _RenderPinnedSectionList.performLayout (cognitive 40) · ×1
  • _RenderPinnedSectionList.performLayout (cognitive 40) lib/widgets/pinned_section_sliver_list.dart:64 — _RenderPinnedSectionList.performLayout has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (6 pts), boolean chains 5, ternaries 3 (4 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 · (anonymous).exportValue (cognitive 40) · ×1
  • (anonymous).exportValue (cognitive 40) rust_backend/crates/extensions/src/prelude.js:117 — (anonymous).exportValue has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 6, ternaries 3 (6 pts), error handling 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkDownloadUpdates._drain (cognitive 39) · ×1
  • LinkDownloadUpdates._drain (cognitive 39) lib/services/link/desktop/link_downloads.dart:104 — LinkDownloadUpdates._drain has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 3 (10 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (3 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.
D2 · Cognitive Complexity · LinkMirroredPlayback._resolve (cognitive 39) · ×1
  • LinkMirroredPlayback._resolve (cognitive 39) lib/services/link/link_mirrored_playback.dart:435 — LinkMirroredPlayback._resolve has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 9, ternaries 2 (5 pts), 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 · _LibraryDirectoryViewState._buildFolder (cognitive 39) · ×1
  • _LibraryDirectoryViewState._buildFolder (cognitive 39) lib/widgets/library_directory_view.dart:566 — _LibraryDirectoryViewState._buildFolder has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 7, ternaries 4 (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.
D2 · Cognitive Complexity · _UpdateDialogState.build (cognitive 39) · ×1
  • _UpdateDialogState.build (cognitive 39) lib/widgets/update_dialog.dart:246 — _UpdateDialogState.build has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 12 (24 pts), if/else 8 (11 pts), match/switch 2 (4 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 · ExtensionSetting · ×1
  • ExtensionSetting::deserialize (cognitive 39) rust_backend/crates/extensions/src/manifest.rs:64 — ExtensionSetting::deserialize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 10 (18 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 · _RewindSlide._content (cognitive 38) · ×1
  • _RewindSlide._content (cognitive 38) lib/screens/listening_rewind_slides.dart:81 — _RewindSlide._content has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 4 (10 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 19). 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 · _NetworkConnectionFormState.build (cognitive 38) · ×1
  • _NetworkConnectionFormState.build (cognitive 38) lib/screens/network_storage_screen.dart:873 — _NetworkConnectionFormState.build has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 13 (21 pts), if/else 8, match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SettingItemState._invokeAction (cognitive 38) · ×1
  • _SettingItemState._invokeAction (cognitive 38) lib/screens/settings/extension_detail_page_widgets.dart:540 — _SettingItemState._invokeAction has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 4, error handling 1 (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 · LinkHandoff._sendLater (cognitive 38) · ×1
  • LinkHandoff._sendLater (cognitive 38) lib/services/link/features/link_handoff.dart:517 — LinkHandoff._sendLater has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (20 pts), error handling 3 (6 pts), ternaries 2 (6 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubsonicClient.cachedCover (cognitive 38) · ×1
  • SubsonicClient.cachedCover (cognitive 38) lib/services/network_storage_subsonic.dart:553 — SubsonicClient.cachedCover has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 12, error handling 2 (4 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 · LinkNowPlayingController.handle (cognitive 38) · ×1
  • LinkNowPlayingController.handle (cognitive 38) ios/Runner/LinkNowPlayingBridge.swift:53 — LinkNowPlayingController.handle has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 7, loops 1 (4 pts), ternaries 1 (3 pts), match/switch 1 (2 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 · _ExtensionDetailPageState.build (cognitive 37) · ×1
  • _ExtensionDetailPageState.build (cognitive 37) lib/screens/settings/extension_detail_page.dart:85 — _ExtensionDetailPageState.build has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 17, 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.
D2 · Cognitive Complexity · _SettingsTabState._buildCategoryList (cognitive 37) · ×1
  • _SettingsTabState._buildCategoryList (cognitive 37) lib/screens/settings/settings_tab.dart:638 — _SettingsTabState._buildCategoryList has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 6 (13 pts), ternaries 6 (8 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 · NetworkStorageService._serve (cognitive 37) · ×1
  • NetworkStorageService._serve (cognitive 37) lib/services/network_storage_service.dart:1440 — NetworkStorageService._serve has cognitive complexity 37 (threshold 15). Drivers by points: error handling 6 (14 pts), if/else 7 (14 pts), boolean chains 7, ternaries 1 (2 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 · _LyricsOptionsButtonState._showMenu (cognitive 37) · ×1
  • _LyricsOptionsButtonState._showMenu (cognitive 37) lib/widgets/lyrics_options_button.dart:217 — _LyricsOptionsButtonState._showMenu has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 4 (8 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SafTreeListingKt.querySafChildrenOrThrow (cognitive 37) · ×1
  • SafTreeListingKt.querySafChildrenOrThrow (cognitive 37) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:155 — SafTreeListingKt.querySafChildrenOrThrow has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 5 (13 pts), boolean chains 5, 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 · LyricsTranslationController.translate (cognitive 36) · ×1
  • LyricsTranslationController.translate (cognitive 36) lib/providers/lyrics_translation_provider.dart:351 — LyricsTranslationController.translate has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 15, if/else 10 (15 pts), ternaries 2 (4 pts), 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 · LibraryCollectionsDatabase.replaceDatabaseFromBackup (cognitive 36) · ×1
  • LibraryCollectionsDatabase.replaceDatabaseFromBackup (cognitive 36) lib/services/library_collections_database.dart:1167 — LibraryCollectionsDatabase.replaceDatabaseFromBackup has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 3 (10 pts), loops 3 (9 pts), match/switch 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 · LinkHistoryArtwork._apply (cognitive 36) · ×1
  • LinkHistoryArtwork._apply (cognitive 36) lib/services/link/sync/link_history_artwork.dart:215 — LinkHistoryArtwork._apply has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 2 (6 pts), loops 3 (5 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 · _MusicAutoplay._fill (cognitive 36) · ×1
  • _MusicAutoplay._fill (cognitive 36) lib/services/music_player_autoplay.dart:506 — _MusicAutoplay._fill has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 12, loops 2 (5 pts), error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkMetadataService._load (cognitive 36) · ×1
  • NetworkMetadataService._load (cognitive 36) lib/services/network_metadata_service.dart:196 — NetworkMetadataService._load has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 4 (11 pts), boolean chains 1, 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 · PlatformBridge._ensureBackendEventHandler (cognitive 36) · ×1
  • PlatformBridge._ensureBackendEventHandler (cognitive 36) lib/services/platform_bridge.dart:454 — PlatformBridge._ensureBackendEventHandler has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 3 (7 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · LogBuffer._fetchNativeLogs (cognitive 36) · ×1
  • LogBuffer._fetchNativeLogs (cognitive 36) lib/utils/logger.dart:220 — LogBuffer._fetchNativeLogs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 1 (6 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeDownloadFinalizer.writeAlbumReplayGain (cognitive 36) · ×1
  • NativeDownloadFinalizer.writeAlbumReplayGain (cognitive 36) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:327 — NativeDownloadFinalizer.writeAlbumReplayGain has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 4 (6 pts), error handling 1 (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 · _AccountForm.parse (cognitive 35) · ×1
  • _AccountForm.parse (cognitive 35) lib/controllers/extension_action_forms.dart:80 — _AccountForm.parse has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 21, if/else 6 (11 pts), ternaries 2, loops 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.
D2 · Cognitive Complexity · DownloadQueueNotifier._startQueueRestore (cognitive 35) · ×1
  • DownloadQueueNotifier._startQueueRestore (cognitive 35) lib/providers/download_queue_provider.dart:274 — DownloadQueueNotifier._startQueueRestore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 8, error handling 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.
D2 · Cognitive Complexity · LocalLibraryNotifier._loadFromDatabase (cognitive 35) · ×1
  • LocalLibraryNotifier._loadFromDatabase (cognitive 35) lib/providers/local_library_provider.dart:277 — LocalLibraryNotifier._loadFromDatabase has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), error handling 2 (4 pts), loops 1 (2 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.
D2 · Cognitive Complexity · SettingsNotifier._runMigrations (cognitive 35) · ×1
  • SettingsNotifier._runMigrations (cognitive 35) lib/providers/settings_provider.dart:300 — SettingsNotifier._runMigrations has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 4, loops 1 (4 pts), ternaries 1 (3 pts) (nesting depth added 18). 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 · _SettingsTabState._buildList (cognitive 35) · ×1
  • _SettingsTabState._buildList (cognitive 35) lib/screens/settings/settings_tab.dart:784 — _SettingsTabState._buildList has cognitive complexity 35 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 6 (13 pts), ternaries 6 (7 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 · LastfmService._flush (cognitive 35) · ×1
  • LastfmService._flush (cognitive 35) lib/services/lastfm/lastfm_service.dart:379 — LastfmService._flush has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (4 pts), 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.
D2 · Cognitive Complexity · LibrarySearchStore.search (cognitive 35) · ×1
  • LibrarySearchStore.search (cognitive 35) lib/services/library_search.dart:126 — LibrarySearchStore.search has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 3 (4 pts), match/switch 2 (3 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.
D2 · Cognitive Complexity · LinkDesktopHost.exportCatalog (cognitive 35) · ×1
  • LinkDesktopHost.exportCatalog (cognitive 35) lib/services/link/desktop/link_desktop_host.dart:1024 — LinkDesktopHost.exportCatalog has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (8 pts), boolean chains 5, error handling 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 · LinkPlaysOnDesktop.build (cognitive 35) · ×1
  • LinkPlaysOnDesktop.build (cognitive 35) lib/services/link/features/link_remote_playback.dart:35 — LinkPlaysOnDesktop.build has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 15, error handling 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AudioplayersPlaybackDeck.resume (cognitive 35) · ×1
  • AudioplayersPlaybackDeck.resume (cognitive 35) lib/services/music_playback_deck.dart:570 — AudioplayersPlaybackDeck.resume has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, error handling 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 · ExtensionNotifier.restoreFromBackup (cognitive 34) · ×1
  • ExtensionNotifier.restoreFromBackup (cognitive 34) lib/providers/extension_provider.dart:698 — ExtensionNotifier.restoreFromBackup has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 4 (9 pts), boolean chains 2, ternaries 2, 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 · AppStateDatabase.migrateRecentAccessFromSharedPreferences (cognitive 34) · ×1
  • AppStateDatabase.migrateRecentAccessFromSharedPreferences (cognitive 34) lib/services/app_state_database.dart:261 — AppStateDatabase.migrateRecentAccessFromSharedPreferences has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 8, loops 2 (7 pts), error handling 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 · LinkCollectionSyncStore._write (cognitive 34) · ×1
  • LinkCollectionSyncStore._write (cognitive 34) lib/services/link/sync/link_collection_sync_store.dart:439 — LinkCollectionSyncStore._write has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 2, boolean chains 1, loops 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 · MusicPlayerHandler._resolveSource (cognitive 34) · ×1
  • MusicPlayerHandler._resolveSource (cognitive 34) lib/services/music_player_service.dart:1187 — MusicPlayerHandler._resolveSource has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 5 (11 pts), ternaries 1 (4 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 · _LibraryDirectoryViewState.build (cognitive 34) · ×1
  • _LibraryDirectoryViewState.build (cognitive 34) lib/widgets/library_directory_view.dart:396 — _LibraryDirectoryViewState.build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 10, ternaries 7 (8 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 · _TrackOptionsSheet.build (cognitive 34) · ×1
  • _TrackOptionsSheet.build (cognitive 34) lib/widgets/track_collection_quick_actions.dart:264 — _TrackOptionsSheet.build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 12 (15 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · SignedSession · ×1
  • SignedSession::deserialize (cognitive 34) rust_backend/crates/extensions/src/manifest.rs:64 — SignedSession::deserialize has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 9 (15 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 · _DownloadSettingsPageState.build (cognitive 33) · ×1
  • _DownloadSettingsPageState.build (cognitive 33) lib/screens/settings/download_settings_page.dart:32 — _DownloadSettingsPageState.build has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 7 (10 pts), boolean chains 7, 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 · _LibraryHeroCard.build (cognitive 33) · ×1
  • _LibraryHeroCard.build (cognitive 33) lib/screens/settings/library_settings_page_widgets.dart:331 — _LibraryHeroCard.build has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 8, if/else 6 (7 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 · LastfmService.finishConnection (cognitive 33) · ×1
  • LastfmService.finishConnection (cognitive 33) lib/services/lastfm/lastfm_service.dart:206 — LastfmService.finishConnection has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (9 pts), boolean chains 7, error handling 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 · _HiResCheckCardState.build (cognitive 33) · ×1
  • _HiResCheckCardState.build (cognitive 33) lib/widgets/hires_check_card.dart:89 — _HiResCheckCardState.build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 3 (7 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 · _MornyeBottomBarState.build (cognitive 33) · ×1
  • _MornyeBottomBarState.build (cognitive 33) lib/widgets/mornye_bottom_bar.dart:158 — _MornyeBottomBarState.build has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 26 (30 pts), boolean chains 2, if/else 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 · TrackCard._buildCard (cognitive 33) · ×1
  • TrackCard._buildCard (cognitive 33) lib/widgets/track_card.dart:174 — TrackCard._buildCard has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 12 (15 pts), if/else 12 (13 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 · NativeFinalizerDecryptKt.finalizeDecryption (cognitive 33) · ×1
  • NativeFinalizerDecryptKt.finalizeDecryption (cognitive 33) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerDecrypt.kt:12 — NativeFinalizerDecryptKt.finalizeDecryption has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 2 (6 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QualitySpecificSetting · ×1
  • QualitySpecificSetting::deserialize (cognitive 33) rust_backend/crates/extensions/src/manifest.rs:64 — QualitySpecificSetting::deserialize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 8 (16 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.
D2 · Cognitive Complexity · SearchBehavior · ×1
  • SearchBehavior::deserialize (cognitive 33) rust_backend/crates/extensions/src/manifest.rs:64 — SearchBehavior::deserialize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 8 (16 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.
D2 · Cognitive Complexity · AutoMixAnalyzer.analyze (cognitive 32) · ×1
  • AutoMixAnalyzer.analyze (cognitive 32) lib/services/automix_analyzer.dart:119 — AutoMixAnalyzer.analyze has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), error handling 3 (5 pts), loops 1 (2 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 · DiscordPresenceService._authenticate (cognitive 32) · ×1
  • DiscordPresenceService._authenticate (cognitive 32) lib/services/discord_presence_service.dart:251 — DiscordPresenceService._authenticate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, ternaries 3 (6 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 · LibraryCollectionsDatabase.migrateFromSharedPreferences (cognitive 32) · ×1
  • LibraryCollectionsDatabase.migrateFromSharedPreferences (cognitive 32) lib/services/library_collections_database.dart:270 — LibraryCollectionsDatabase.migrateFromSharedPreferences has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (9 pts), boolean chains 5, 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 · LinkPhoneCatalogs._fetchCovers (cognitive 32) · ×1
  • LinkPhoneCatalogs._fetchCovers (cognitive 32) lib/services/link/desktop/link_phone_catalogs.dart:274 — LinkPhoneCatalogs._fetchCovers has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (9 pts), ternaries 1 (4 pts), boolean chains 2, error handling 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 · NetworkStorageService.list (cognitive 32) · ×1
  • NetworkStorageService.list (cognitive 32) lib/services/network_storage_service.dart:974 — NetworkStorageService.list has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 3 (5 pts), boolean chains 4, loops 2 (4 pts), match/switch 1, 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 · UsbDirectPlayback.command (cognitive 32) · ×1
  • UsbDirectPlayback.command (cognitive 32) android/app/src/main/kotlin/com/zarz/mornye/UsbDirectPlayback.kt:81 — UsbDirectPlayback.command has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, error handling 2 (4 pts), match/switch 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 · Vm · ×1
  • Vm::call (cognitive 32) rust_backend/crates/extensions/src/runtime/vm.rs:334 — Vm::call has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (28 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 · _ConcertDetailScreenState._materialPage (cognitive 31) · ×1
  • _ConcertDetailScreenState._materialPage (cognitive 31) lib/screens/concert_detail_screen.dart:446 — _ConcertDetailScreenState._materialPage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 6 (12 pts), boolean chains 2 (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 · _HomeSections.build (cognitive 31) · ×1
  • _HomeSections.build (cognitive 31) lib/screens/home_tab_intro.dart:358 — _HomeSections.build has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, ternaries 3 (5 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 · _LibraryTracksFolderScreenState._buildSelectionBottomBar (cognitive 31) · ×1
  • _LibraryTracksFolderScreenState._buildSelectionBottomBar (cognitive 31) lib/screens/library_tracks_folder_screen.dart:744 — _LibraryTracksFolderScreenState._buildSelectionBottomBar has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 13 (22 pts), if/else 4, boolean chains 3, loops 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 · LinkDesktopSettingsPage.build (cognitive 31) · ×1
  • LinkDesktopSettingsPage.build (cognitive 31) lib/screens/settings/link_desktop_settings_page.dart:35 — LinkDesktopSettingsPage.build has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (7 pts), 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 · ExtensionStorageService.setUnsecuredStorage (cognitive 31) · ×1
  • ExtensionStorageService.setUnsecuredStorage (cognitive 31) lib/services/extension_storage_service.dart:72 — ExtensionStorageService.setUnsecuredStorage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), error handling 3 (6 pts), boolean chains 2, 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 · LinkLibraryJobsHost._drain (cognitive 31) · ×1
  • LinkLibraryJobsHost._drain (cognitive 31) lib/services/link/desktop/link_library_jobs_host.dart:165 — LinkLibraryJobsHost._drain has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (8 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (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 · LocalTrackRedownloadService._scoreMatch (cognitive 31) · ×1
  • LocalTrackRedownloadService._scoreMatch (cognitive 31) lib/services/local_track_redownload_service.dart:108 — LocalTrackRedownloadService._scoreMatch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 9, 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 · MotionArtworkStore.find (cognitive 31) · ×1
  • MotionArtworkStore.find (cognitive 31) lib/services/motion_artwork_store.dart:61 — MotionArtworkStore.find has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 3, error handling 2 (3 pts) (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.
D2 · Cognitive Complexity · NativeHistoryStore.buildPathMatchKeys (cognitive 31) · ×1
  • NativeHistoryStore.buildPathMatchKeys (cognitive 31) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:473 — NativeHistoryStore.buildPathMatchKeys has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (20 pts), error handling 4 (6 pts), loops 3 (4 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 · HealthCheck · ×1
  • HealthCheck::deserialize (cognitive 31) rust_backend/crates/extensions/src/manifest.rs:64 — HealthCheck::deserialize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 8 (14 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous).album (cognitive 31) · ×1
  • (anonymous).album (cognitive 31) rust_backend/crates/extensions/src/provider.js:156 — (anonymous).album has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 13). Of this number, 27 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadContainerFinalizer.finalize (cognitive 30) · ×1
  • DownloadContainerFinalizer.finalize (cognitive 30) lib/services/download_container_finalizer.dart:27 — DownloadContainerFinalizer.finalize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 10, 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 · LinkPairingClient.pair (cognitive 30) · ×1
  • LinkPairingClient.pair (cognitive 30) lib/services/link/client/link_client_pairing.dart:170 — LinkPairingClient.pair has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, ternaries 2 (5 pts), match/switch 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 · PreferenceBlobStore._read (cognitive 30) · ×1
  • PreferenceBlobStore._read (cognitive 30) lib/services/preference_blob_store.dart:82 — PreferenceBlobStore._read has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), error handling 3 (6 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PlaylistPickerSheetContentState.build (cognitive 30) · ×1
  • _PlaylistPickerSheetContentState.build (cognitive 30) lib/widgets/playlist_picker_sheet.dart:144 — _PlaylistPickerSheetContentState.build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 6, ternaries 5, 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 · PlayerWidgetProvider.render (cognitive 30) · ×1
  • PlayerWidgetProvider.render (cognitive 30) android/app/src/main/kotlin/com/zarz/mornye/PlayerWidgetProvider.kt:133 — PlayerWidgetProvider.render has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, boolean chains 5, match/switch 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 · UsbBitPerfectPlugin.onMethodCall (cognitive 30) · ×1
  • UsbBitPerfectPlugin.onMethodCall (cognitive 30) android/app/src/main/kotlin/com/zarz/mornye/UsbBitPerfectPlugin.kt:58 — UsbBitPerfectPlugin.onMethodCall has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (25 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 · IndexCache · ×1
  • IndexCache::index (cognitive 30) rust_backend/crates/core/src/isrc/cache.rs:177 — IndexCache::index has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (5 pts), boolean chains 4 (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 · ResolverHttp · ×1
  • ResolverHttp::execute (cognitive 30) rust_backend/crates/providers/src/resolver/http.rs:69 — ResolverHttp::execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 6 (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 · ArtistConcert.parseList (cognitive 29) · ×1
  • ArtistConcert.parseList (cognitive 29) lib/models/artist_concert.dart:28 — ArtistConcert.parseList has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, ternaries 3 (6 pts), error handling 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomeContinueListeningCardState.build (cognitive 29) · ×1
  • _HomeContinueListeningCardState.build (cognitive 29) lib/screens/home_tab_intro.dart:672 — _HomeContinueListeningCardState.build has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 16, if/else 6 (9 pts), boolean chains 4 (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 · _FilesSettingsPageState.build (cognitive 29) · ×1
  • _FilesSettingsPageState.build (cognitive 29) lib/screens/settings/files_settings_page.dart:125 — _FilesSettingsPageState.build has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 8 (9 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · AppStateDatabase.getPendingDownloadQueueRows (cognitive 29) · ×1
  • AppStateDatabase.getPendingDownloadQueueRows (cognitive 29) lib/services/app_state_database.dart:325 — AppStateDatabase.getPendingDownloadQueueRows has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 5 (9 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetadataAutofillService.resolveDetails (cognitive 29) · ×1
  • MetadataAutofillService.resolveDetails (cognitive 29) lib/services/metadata_autofill_service.dart:56 — MetadataAutofillService.resolveDetails has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (5 pts), boolean chains 4, ternaries 1 (4 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.
D2 · Cognitive Complexity · MusicPlayerHandler._playInternal (cognitive 29) · ×1
  • MusicPlayerHandler._playInternal (cognitive 29) lib/services/music_player_service.dart:2179 — MusicPlayerHandler._playInternal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 11, 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 · AlbumDetailHeader._buildAppBar (cognitive 29) · ×1
  • AlbumDetailHeader._buildAppBar (cognitive 29) lib/widgets/album_detail_header.dart:334 — AlbumDetailHeader._buildAppBar has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 10 (15 pts), if/else 11 (12 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DesktopInspector.build (cognitive 29) · ×1
  • DesktopInspector.build (cognitive 29) lib/widgets/desktop/desktop_inspector.dart:145 — DesktopInspector.build has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 8 (11 pts), match/switch 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 · DownloadServiceSnapshotKt.writeNativeWorkerSnapshot (cognitive 29) · ×1
  • DownloadServiceSnapshotKt.writeNativeWorkerSnapshot (cognitive 29) android/app/src/main/kotlin/com/zarz/mornye/DownloadServiceSnapshot.kt:26 — DownloadServiceSnapshotKt.writeNativeWorkerSnapshot has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (26 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WavPackDsdSource.readFrames (cognitive 29) · ×1
  • WavPackDsdSource.readFrames (cognitive 29) android/app/src/main/kotlin/com/zarz/mornye/DsdSource.kt:57 — WavPackDsdSource.readFrames has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (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 · NativeFinalizerContainerKt.finalizeAutoConversion (cognitive 29) · ×1
  • NativeFinalizerContainerKt.finalizeAutoConversion (cognitive 29) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerContainer.kt:10 — NativeFinalizerContainerKt.finalizeAutoConversion has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 4, 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 · (anonymous).queryMethods (cognitive 29) · ×1
  • (anonymous).queryMethods (cognitive 29) rust_backend/crates/extensions/src/prelude.js:70 — (anonymous).queryMethods has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 5 (18 pts), if/else 4 (9 pts), boolean chains 1, loops 1 (nesting depth added 18). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 74, a function literal at line 80, toString). 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 · (anonymous).exported (cognitive 29) · ×1
  • (anonymous).exported (cognitive 29) rust_backend/crates/extensions/src/provider.js:25 — (anonymous).exported has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, error handling 4, loops 2 (4 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 · RecentAccessNotifier._loadHistory (cognitive 28) · ×1
  • RecentAccessNotifier._loadHistory (cognitive 28) lib/providers/recent_access_provider.dart:142 — RecentAccessNotifier._loadHistory has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 2 (4 pts), loops 2 (4 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.
D2 · Cognitive Complexity · _ConcertDetailScreenState._page (cognitive 28) · ×1
  • _ConcertDetailScreenState._page (cognitive 28) lib/screens/concert_detail_screen.dart:152 — _ConcertDetailScreenState._page has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 5 (10 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 · _NetworkConnectionFormState._save (cognitive 28) · ×1
  • _NetworkConnectionFormState._save (cognitive 28) lib/screens/network_storage_screen.dart:690 — _NetworkConnectionFormState._save has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 4 (7 pts), boolean chains 4, 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 · AutoplayPreferenceModel._features (cognitive 28) · ×1
  • AutoplayPreferenceModel._features (cognitive 28) lib/services/autoplay_personalization.dart:147 — AutoplayPreferenceModel._features has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 3 (6 pts), loops 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ContentUriPlaybackCache.resolve (cognitive 28) · ×1
  • ContentUriPlaybackCache.resolve (cognitive 28) lib/services/content_uri_playback_cache.dart:42 — ContentUriPlaybackCache.resolve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 8, loops 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkPhoneCatalogs._addCovers (cognitive 28) · ×1
  • LinkPhoneCatalogs._addCovers (cognitive 28) lib/services/link/desktop/link_phone_catalogs.dart:357 — LinkPhoneCatalogs._addCovers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 6, error handling 1 (3 pts), 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.
D2 · Cognitive Complexity · NetworkPlaybackCache._load (cognitive 28) · ×1
  • NetworkPlaybackCache._load (cognitive 28) lib/services/network_playback_cache.dart:319 — NetworkPlaybackCache._load has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (8 pts), error handling 3 (7 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 · NetworkPlaybackCache._download (cognitive 28) · ×1
  • NetworkPlaybackCache._download (cognitive 28) lib/services/network_playback_cache.dart:430 — NetworkPlaybackCache._download has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), error handling 3 (4 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 · SubsonicClient._albumCatalog (cognitive 28) · ×1
  • SubsonicClient._albumCatalog (cognitive 28) lib/services/network_storage_subsonic.dart:475 — SubsonicClient._albumCatalog has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (6 pts), ternaries 1 (2 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 · WeeklyReleaseService.load (cognitive 28) · ×1
  • WeeklyReleaseService.load (cognitive 28) lib/services/weekly_releases.dart:96 — WeeklyReleaseService.load has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 5, error handling 2 (5 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlbumDescription._text (cognitive 28) · ×1
  • AlbumDescription._text (cognitive 28) lib/widgets/album_description.dart:20 — AlbumDescription._text has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (5 pts), ternaries 1 (3 pts), loops 2 (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.
D2 · Cognitive Complexity · HeaderCircleButton.build (cognitive 28) · ×1
  • HeaderCircleButton.build (cognitive 28) lib/widgets/album_detail_header.dart:920 — HeaderCircleButton.build has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (20 pts), boolean chains 4, if/else 3 (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.
D2 · Cognitive Complexity · _MornyeSelectionPillState.build (cognitive 28) · ×1
  • _MornyeSelectionPillState.build (cognitive 28) lib/widgets/mornye_selection_pill.dart:157 — _MornyeSelectionPillState.build has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 9, if/else 9 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _TvNavigationState._handleKey (cognitive 28) · ×1
  • _TvNavigationState._handleKey (cognitive 28) lib/widgets/tv_navigation.dart:183 — _TvNavigationState._handleKey has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (11 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AppDelegate.invokeOsMethod (cognitive 28) · ×1
  • AppDelegate.invokeOsMethod (cognitive 28) ios/Runner/AppDelegate.swift:532 — AppDelegate.invokeOsMethod has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 9, error handling 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (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 · ExploreNotifier.fetchHomeFeed (cognitive 27) · ×1
  • ExploreNotifier.fetchHomeFeed (cognitive 27) lib/providers/explore_provider.dart:477 — ExploreNotifier.fetchHomeFeed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, 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 · _LibraryMixes._songs (cognitive 27) · ×1
  • _LibraryMixes._songs (cognitive 27) lib/providers/library_mixes_provider.dart:369 — _LibraryMixes._songs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 2 (8 pts), loops 3 (6 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 · _MainShellState._desktopDestinations (cognitive 27) · ×1
  • _MainShellState._desktopDestinations (cognitive 27) lib/screens/main_shell.dart:698 — _MainShellState._desktopDestinations has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (24 pts), match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · _MainShellState.build (cognitive 27) · ×1
  • _MainShellState.build (cognitive 27) lib/screens/main_shell.dart:910 — _MainShellState.build has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 6 (9 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 · _CacheManagementPageState.build (cognitive 27) · ×1
  • _CacheManagementPageState.build (cognitive 27) lib/screens/settings/cache_management_page.dart:346 — _CacheManagementPageState.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 5 (8 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 · AutoMixPlan.create (cognitive 27) · ×1
  • AutoMixPlan.create (cognitive 27) lib/services/automix_analysis.dart:240 — AutoMixPlan.create has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 12, 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, 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 · CsvImportService._bestCandidate (cognitive 27) · ×1
  • CsvImportService._bestCandidate (cognitive 27) lib/services/csv_import_service.dart:185 — CsvImportService._bestCandidate has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (11 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadedEmbeddedCoverResolver._deletePersistentVariantsForSource (cognitive 27) · ×1
  • DownloadedEmbeddedCoverResolver._deletePersistentVariantsForSource (cognitive 27) lib/services/downloaded_embedded_cover_resolver.dart:974 — DownloadedEmbeddedCoverResolver._deletePersistentVariantsForSource has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (2 pts), 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 · ExclusiveOutputDeck._switchTo (cognitive 27) · ×1
  • ExclusiveOutputDeck._switchTo (cognitive 27) lib/services/exclusive_output_deck.dart:94 — ExclusiveOutputDeck._switchTo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _MixBuilder._index (cognitive 27) · ×1
  • _MixBuilder._index (cognitive 27) lib/services/library_mixes.dart:763 — _MixBuilder._index has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, loops 4 (6 pts), ternaries 1 (4 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 · _MixBuilder._compose (cognitive 27) · ×1
  • _MixBuilder._compose (cognitive 27) lib/services/library_mixes.dart:1122 — _MixBuilder._compose has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), ternaries 1 (2 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 · LibrarySchema.upgrade (cognitive 27) · ×1
  • LibrarySchema.upgrade (cognitive 27) lib/services/library_schema.dart:104 — LibrarySchema.upgrade has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 5 (8 pts), ternaries 1 (3 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.
D2 · Cognitive Complexity · LinkHistoryArtwork._cover (cognitive 27) · ×1
  • LinkHistoryArtwork._cover (cognitive 27) lib/services/link/sync/link_history_artwork.dart:150 — LinkHistoryArtwork._cover has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppContentCard.build (cognitive 27) · ×1
  • AppContentCard.build (cognitive 27) lib/widgets/app_content_card.dart:40 — AppContentCard.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 8, if/else 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 · _ExpressivePlaybackTransportState.build (cognitive 27) · ×1
  • _ExpressivePlaybackTransportState.build (cognitive 27) lib/widgets/expressive_playback_transport.dart:72 — _ExpressivePlaybackTransportState.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13, if/else 6, boolean chains 4, loops 2 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _MornyeArtistSurfaceState.build (cognitive 27) · ×1
  • _MornyeArtistSurfaceState.build (cognitive 27) lib/widgets/mornye_artist_header.dart:65 — _MornyeArtistSurfaceState.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 15 (17 pts), boolean chains 6, if/else 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.
D2 · Cognitive Complexity · MornyeLevelSlider.build (cognitive 27) · ×1
  • MornyeLevelSlider.build (cognitive 27) lib/widgets/mornye_level_slider.dart:60 — MornyeLevelSlider.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 10, 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 · _PlaybackSeekSliderState.build (cognitive 27) · ×1
  • _PlaybackSeekSliderState.build (cognitive 27) lib/widgets/playback_seek_slider.dart:88 — _PlaybackSeekSliderState.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (22 pts), boolean chains 4, 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 · _SyncedLyricsViewState._scrollUntilBuilt (cognitive 27) · ×1
  • _SyncedLyricsViewState._scrollUntilBuilt (cognitive 27) lib/widgets/player_lyrics.dart:734 — _SyncedLyricsViewState._scrollUntilBuilt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SafFileInspectionKt.resolveSafFile (cognitive 27) · ×1
  • SafFileInspectionKt.resolveSafFile (cognitive 27) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:10 — SafFileInspectionKt.resolveSafFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SafTreeListingKt.runSafReadsInOrder (cognitive 27) · ×1
  • SafTreeListingKt.runSafReadsInOrder (cognitive 27) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:75 — SafTreeListingKt.runSafReadsInOrder has cognitive complexity 27 (threshold 15). Drivers by points: error handling 4 (12 pts), if/else 4 (8 pts), loops 3 (5 pts), boolean chains 2 (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 · PcmStream · ×1
  • PcmStream::next_frame (cognitive 27) rust_backend/crates/core/src/media/hires/replacement.rs:82 — PcmStream::next_frame has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (10 pts), match/switch 2 (6 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 · _DownloadRun._persistCompletionAndNotify (cognitive 26) · ×1
  • _DownloadRun._persistCompletionAndNotify (cognitive 26) lib/providers/download_queue_provider_single_item.dart:1579 — _DownloadRun._persistCompletionAndNotify has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (5 pts), boolean chains 4, 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 · _HomeTabState._performSearch (cognitive 26) · ×1
  • _HomeTabState._performSearch (cognitive 26) lib/screens/home_tab.dart:518 — _HomeTabState._performSearch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 9, 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 · _BackupRestorePageState._restoreBackup (cognitive 26) · ×1
  • _BackupRestorePageState._restoreBackup (cognitive 26) lib/screens/settings/backup_restore_page.dart:96 — _BackupRestorePageState._restoreBackup has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, error handling 2, 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 · _LogSummaryCard._analyzeLogs (cognitive 26) · ×1
  • _LogSummaryCard._analyzeLogs (cognitive 26) lib/screens/settings/log_screen_widgets.dart:282 — _LogSummaryCard._analyzeLogs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 12, 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 · CoverStore.trim (cognitive 26) · ×1
  • CoverStore.trim (cognitive 26) lib/services/cover_store.dart:242 — CoverStore.trim has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CueSplitLibraryService.publish (cognitive 26) · ×1
  • CueSplitLibraryService.publish (cognitive 26) lib/services/cue_split_library_service.dart:27 — CueSplitLibraryService.publish has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (7 pts), loops 6, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadFileFinalizer.decrypt (cognitive 26) · ×1
  • DownloadFileFinalizer.decrypt (cognitive 26) lib/services/download_file_finalizer.dart:114 — DownloadFileFinalizer.decrypt has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 7 (11 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.
D2 · Cognitive Complexity · FFmpegMetadataInput.prepare (cognitive 26) · ×1
  • FFmpegMetadataInput.prepare (cognitive 26) lib/services/ffmpeg_metadata_input.dart:24 — FFmpegMetadataInput.prepare has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (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 · LinkArrivingFiles._serve (cognitive 26) · ×1
  • LinkArrivingFiles._serve (cognitive 26) lib/services/link/desktop/link_arriving_files.dart:122 — LinkArrivingFiles._serve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 1 (3 pts), error handling 1, 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 · LinkCollectionSyncStore._keptCovers (cognitive 26) · ×1
  • LinkCollectionSyncStore._keptCovers (cognitive 26) lib/services/link/sync/link_collection_sync_store.dart:392 — LinkCollectionSyncStore._keptCovers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkSyncRunner._syncOnce (cognitive 26) · ×1
  • LinkSyncRunner._syncOnce (cognitive 26) lib/services/link/sync/link_sync_runner.dart:256 — LinkSyncRunner._syncOnce has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 10, 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 · M3uPlaylistService.exportPathFor (cognitive 26) · ×1
  • M3uPlaylistService.exportPathFor (cognitive 26) lib/services/m3u_playlist_service.dart:129 — M3uPlaylistService.exportPathFor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 12). 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 · MusicPlayerHandler._configureAudioSession (cognitive 26) · ×1
  • MusicPlayerHandler._configureAudioSession (cognitive 26) lib/services/music_player_service.dart:668 — MusicPlayerHandler._configureAudioSession has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, ternaries 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 · _DownloadServicePickerState.build (cognitive 26) · ×1
  • _DownloadServicePickerState.build (cognitive 26) lib/widgets/download_service_picker.dart:148 — _DownloadServicePickerState.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (7 pts), loops 3 (5 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 · CoreBackendKt.withCoreFFmpegExecution (cognitive 26) · ×1
  • CoreBackendKt.withCoreFFmpegExecution (cognitive 26) android/app/src/main/kotlin/com/zarz/mornye/CoreBackend.kt:99 — CoreBackendKt.withCoreFFmpegExecution has cognitive complexity 26 (threshold 15). Drivers by points: error handling 6 (13 pts), if/else 4 (7 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadServiceSnapshotKt.startNativeWorkerProgressCoordinator (cognitive 26) · ×1
  • DownloadServiceSnapshotKt.startNativeWorkerProgressCoordinator (cognitive 26) android/app/src/main/kotlin/com/zarz/mornye/DownloadServiceSnapshot.kt:228 — DownloadServiceSnapshotKt.startNativeWorkerProgressCoordinator has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · ExtensionAuth · ×1
  • ExtensionAuth::call (cognitive 26) rust_backend/crates/extensions/src/auth/client.rs:33 — ExtensionAuth::call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 1, match/switch 1 (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 · OpenAudioController.open (cognitive 25) · ×1
  • OpenAudioController.open (cognitive 25) lib/controllers/open_audio_controller.dart:94 — OpenAudioController.open has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · PlayerMetadataController.searchOnline (cognitive 25) · ×1
  • PlayerMetadataController.searchOnline (cognitive 25) lib/controllers/player_metadata_controller.dart:103 — PlayerMetadataController.searchOnline has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 9, 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 · _DownloadRun._convertSafM4aToFlac (cognitive 25) · ×1
  • _DownloadRun._convertSafM4aToFlac (cognitive 25) lib/providers/download_queue_provider_single_item.dart:1200 — _DownloadRun._convertSafM4aToFlac has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 1 (3 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 · ExtensionNotifier.initialize (cognitive 25) · ×1
  • ExtensionNotifier.initialize (cognitive 25) lib/providers/extension_provider.dart:147 — ExtensionNotifier.initialize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 2 (4 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 · TrackNotifier.search (cognitive 25) · ×1
  • TrackNotifier.search (cognitive 25) lib/providers/track_provider.dart:350 — TrackNotifier.search has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (8 pts), error handling 2 (4 pts), loops 1 (2 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 · _ArtistScreenState._fetchDiscography (cognitive 25) · ×1
  • _ArtistScreenState._fetchDiscography (cognitive 25) lib/screens/artist_screen.dart:308 — _ArtistScreenState._fetchDiscography has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (23 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 · _MainShellState._handleBackPress (cognitive 25) · ×1
  • _MainShellState._handleBackPress (cognitive 25) lib/screens/main_shell.dart:596 — _MainShellState._handleBackPress has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, boolean chains 11, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _ExtensionDetailsScreenState._buildInfoCard (cognitive 25) · ×1
  • _ExtensionDetailsScreenState._buildInfoCard (cognitive 25) lib/screens/repo/extension_details_screen.dart:169 — _ExtensionDetailsScreenState._buildInfoCard has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (15 pts), if/else 7 (10 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _LinkSettingsPageState._notices (cognitive 25) · ×1
  • _LinkSettingsPageState._notices (cognitive 25) lib/screens/settings/link_settings_page.dart:188 — _LinkSettingsPageState._notices has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, ternaries 2 (5 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 · _SetupScreenState._requestNotificationPermission (cognitive 25) · ×1
  • _SetupScreenState._requestNotificationPermission (cognitive 25) lib/screens/setup_screen.dart:330 — _SetupScreenState._requestNotificationPermission has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 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 · AutoplayPersonalization.finish (cognitive 25) · ×1
  • AutoplayPersonalization.finish (cognitive 25) lib/services/autoplay_personalization.dart:547 — AutoplayPersonalization.finish has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 8, ternaries 3 (5 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, 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 · SoundAutoplaySignal.prepare (cognitive 25) · ×1
  • SoundAutoplaySignal.prepare (cognitive 25) lib/services/autoplay_sound_signal.dart:93 — SoundAutoplaySignal.prepare has cognitive complexity 25 (threshold 15). Drivers by points: loops 10 (14 pts), if/else 6 (9 pts), boolean chains 2 (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 · LibraryCollectionsDatabase.relinkLocalTrack (cognitive 25) · ×1
  • LibraryCollectionsDatabase.relinkLocalTrack (cognitive 25) lib/services/library_collections_database.dart:96 — LibraryCollectionsDatabase.relinkLocalTrack has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (8 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryDatabase.updateAudioMetadata (cognitive 25) · ×1
  • LibraryDatabase.updateAudioMetadata (cognitive 25) lib/services/library_database.dart:957 — LibraryDatabase.updateAudioMetadata has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11, ternaries 5 (8 pts), boolean chains 6 (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 · LinkWebCovers._probeNew (cognitive 25) · ×1
  • LinkWebCovers._probeNew (cognitive 25) lib/services/link/desktop/link_web_covers.dart:517 — LinkWebCovers._probeNew has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 6 (10 pts), boolean chains 2, 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 · LinkPhoneSession.apply (cognitive 25) · ×1
  • LinkPhoneSession.apply (cognitive 25) lib/services/link/features/link_phone_session.dart:226 — LinkPhoneSession.apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 11). 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 · ListeningRewind.compute (cognitive 25) · ×1
  • ListeningRewind.compute (cognitive 25) lib/services/listening_rewind.dart:161 — ListeningRewind.compute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 4 (6 pts), loops 5, 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 · AudioplayersPlaybackDeck.refreshNativeStatus (cognitive 25) · ×1
  • AudioplayersPlaybackDeck.refreshNativeStatus (cognitive 25) lib/services/music_playback_deck.dart:504 — AudioplayersPlaybackDeck.refreshNativeStatus has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, error handling 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 · NativeDownloadWorkerMonitor.run (cognitive 25) · ×1
  • NativeDownloadWorkerMonitor.run (cognitive 25) lib/services/native_download_worker_monitor.dart:28 — NativeDownloadWorkerMonitor.run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, ternaries 1 (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 · SubsonicClient.list (cognitive 25) · ×1
  • SubsonicClient.list (cognitive 25) lib/services/network_storage_subsonic.dart:319 — SubsonicClient.list has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, loops 2 (5 pts), ternaries 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 · LyricsDraft.toLrc (cognitive 25) · ×1
  • LyricsDraft.toLrc (cognitive 25) lib/utils/lyrics_draft.dart:278 — LyricsDraft.toLrc has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (6 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LyricDisplayLayout.LyricDisplayLayout (cognitive 25) · ×1
  • LyricDisplayLayout.LyricDisplayLayout (cognitive 25) lib/utils/lyrics_timeline.dart:11 — LyricDisplayLayout.LyricDisplayLayout has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5, ternaries 2 (4 pts), boolean chains 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 · _AudioAnalysisCardState._analyze (cognitive 25) · ×1
  • _AudioAnalysisCardState._analyze (cognitive 25) lib/widgets/audio_analysis_widget.dart:234 — _AudioAnalysisCardState._analyze has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, error handling 3, 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 · _AudioFacts._processing (cognitive 25) · ×1
  • _AudioFacts._processing (cognitive 25) lib/widgets/audio_info_sheet.dart:600 — _AudioFacts._processing has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 4 (6 pts), 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 · _BatchConvertSheetState.build (cognitive 25) · ×1
  • _BatchConvertSheetState.build (cognitive 25) lib/widgets/batch_convert_sheet.dart:83 — _BatchConvertSheetState.build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, ternaries 3 (6 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 · MornyePlayerQueue.build (cognitive 25) · ×1
  • MornyePlayerQueue.build (cognitive 25) lib/widgets/mornye_player_queue.dart:18 — MornyePlayerQueue.build has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (16 pts), if/else 5, match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous).invokeVerified (cognitive 25) · ×1
  • (anonymous).invokeVerified (cognitive 25) rust_backend/crates/extensions/src/provider.js:310 — (anonymous).invokeVerified has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (7 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadHistoryNotifier._commitInspectedHistoryChanges (cognitive 24) · ×1
  • DownloadHistoryNotifier._commitInspectedHistoryChanges (cognitive 24) lib/providers/download_history_provider.dart:1081 — DownloadHistoryNotifier._commitInspectedHistoryChanges has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, ternaries 3 (5 pts), 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 · DownloadQueueNotifier.pauseQueue (cognitive 24) · ×1
  • DownloadQueueNotifier.pauseQueue (cognitive 24) lib/providers/download_queue_provider.dart:1173 — DownloadQueueNotifier.pauseQueue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadQueueLookup.withoutIndex (cognitive 24) · ×1
  • DownloadQueueLookup.withoutIndex (cognitive 24) lib/providers/download_queue_state.dart:437 — DownloadQueueLookup.withoutIndex has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10, if/else 6 (9 pts), boolean chains 3, loops 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 · _HomeShortcuts.build (cognitive 24) · ×1
  • _HomeShortcuts.build (cognitive 24) lib/screens/home_tab_intro.dart:1515 — _HomeShortcuts.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 3 (8 pts), loops 4 (6 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LibraryTracksFolderScreenState._showEntryMenu (cognitive 24) · ×1
  • _LibraryTracksFolderScreenState._showEntryMenu (cognitive 24) lib/screens/library_tracks_folder_screen.dart:646 — _LibraryTracksFolderScreenState._showEntryMenu has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (7 pts), loops 2 (4 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 · _SetupScreenState._completeSetup (cognitive 24) · ×1
  • _SetupScreenState._completeSetup (cognitive 24) lib/screens/setup_screen.dart:629 — _SetupScreenState._completeSetup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, ternaries 1 (3 pts), 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 · DesktopUpdater.download (cognitive 24) · ×1
  • DesktopUpdater.download (cognitive 24) lib/services/desktop_updater.dart:83 — DesktopUpdater.download has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, error handling 2 (3 pts), loops 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 · FFmpegOutput.finalize (cognitive 24) · ×1
  • FFmpegOutput.finalize (cognitive 24) lib/services/ffmpeg_support.dart:228 — FFmpegOutput.finalize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 3 (7 pts), boolean chains 4 (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 · LinkTrackResolver.resolve (cognitive 24) · ×1
  • LinkTrackResolver.resolve (cognitive 24) lib/services/link/features/link_track_resolver.dart:85 — LinkTrackResolver.resolve has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, 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 · AudioplayersPlaybackDeck._syncEqualizer (cognitive 24) · ×1
  • AudioplayersPlaybackDeck._syncEqualizer (cognitive 24) lib/services/music_playback_deck.dart:227 — AudioplayersPlaybackDeck._syncEqualizer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, ternaries 1 (3 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 · _MusicCast._changed (cognitive 24) · ×1
  • _MusicCast._changed (cognitive 24) lib/services/music_player_cast.dart:26 — _MusicCast._changed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 8, 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 · MusicPlayerHandler.applySettings (cognitive 24) · ×1
  • MusicPlayerHandler.applySettings (cognitive 24) lib/services/music_player_service.dart:227 — MusicPlayerHandler.applySettings has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 17, 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 · MusicPlayerHandler._listenToPlayer (cognitive 24) · ×1
  • MusicPlayerHandler._listenToPlayer (cognitive 24) lib/services/music_player_service.dart:534 — MusicPlayerHandler._listenToPlayer has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 11 (12 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 · LyricPronunciationLayout.measure (cognitive 24) · ×1
  • LyricPronunciationLayout.measure (cognitive 24) lib/widgets/aligned_lyric_pronunciation.dart:31 — LyricPronunciationLayout.measure has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 9, loops 3 (4 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 · AppAlertDialog.build (cognitive 24) · ×1
  • AppAlertDialog.build (cognitive 24) lib/widgets/app_alert_dialog.dart:240 — AppAlertDialog.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, 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 · _AudioOutputButtonState._showPicker (cognitive 24) · ×1
  • _AudioOutputButtonState._showPicker (cognitive 24) lib/widgets/audio_output_button.dart:52 — _AudioOutputButtonState._showPicker has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 pts), error handling 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ServiceChip.build (cognitive 24) · ×1
  • _ServiceChip.build (cognitive 24) lib/widgets/download_service_picker.dart:416 — _ServiceChip.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 7 (11 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 · ExpressiveButton.build (cognitive 24) · ×1
  • ExpressiveButton.build (cognitive 24) lib/widgets/expressive_button.dart:29 — ExpressiveButton.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaterialPlayerLayout.build (cognitive 24) · ×1
  • MaterialPlayerLayout.build (cognitive 24) lib/widgets/material_player_layout.dart:65 — MaterialPlayerLayout.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 7, if/else 3 (4 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 · Cover · ×1
  • Cover::cached (cognitive 24) rust_backend/crates/extensions/src/backend/cover.rs:115 — Cover::cached has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), match/switch 1 (4 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 · LyricsCache · ×1
  • LyricsCache::set_persistence_path (cognitive 24) rust_backend/crates/providers/src/lyrics/cache.rs:137 — LyricsCache::set_persistence_path has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, 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 · (anonymous).goString (cognitive 24) · ×1
  • (anonymous).goString (cognitive 24) rust_backend/crates/extensions/src/prelude.js:12 — (anonymous).goString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (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 · CompletionBridgeTracker.historyItemFor (cognitive 23) · ×1
  • CompletionBridgeTracker.historyItemFor (cognitive 23) lib/controllers/completion_bridge_tracker.dart:22 — CompletionBridgeTracker.historyItemFor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (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 · DownloadQueueNotifier._buildDownloadRequestPayload (cognitive 23) · ×1
  • DownloadQueueNotifier._buildDownloadRequestPayload (cognitive 23) lib/providers/download_queue_provider.dart:529 — DownloadQueueNotifier._buildDownloadRequestPayload has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9, boolean chains 8, if/else 4 (6 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 · _AlbumScreenState._buildAppBar (cognitive 23) · ×1
  • _AlbumScreenState._buildAppBar (cognitive 23) lib/screens/album_screen.dart:522 — _AlbumScreenState._buildAppBar has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 14, boolean chains 7, if/else 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 · _LoadingOrErrorScaffold.build (cognitive 23) · ×1
  • _LoadingOrErrorScaffold.build (cognitive 23) lib/screens/extension_collection_screens.dart:66 — _LoadingOrErrorScaffold.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (13 pts), boolean chains 5, if/else 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CollectionTrackTile.build (cognitive 23) · ×1
  • _CollectionTrackTile.build (cognitive 23) lib/screens/library_tracks_folder_screen.dart:1358 — _CollectionTrackTile.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12, if/else 5 (6 pts), boolean chains 5 (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 · AudioAnalysisRunner.runAnalysis (cognitive 23) · ×1
  • AudioAnalysisRunner.runAnalysis (cognitive 23) lib/services/audio_analysis_runner.dart:156 — AudioAnalysisRunner.runAnalysis has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), error handling 2 (5 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 · AudioAnalysisRunner._generateSpectrogram (cognitive 23) · ×1
  • AudioAnalysisRunner._generateSpectrogram (cognitive 23) lib/services/audio_analysis_runner.dart:306 — AudioAnalysisRunner._generateSpectrogram has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 3 (9 pts), ternaries 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FFmpegDecryption._decryptMovKeyFile (cognitive 23) · ×1
  • FFmpegDecryption._decryptMovKeyFile (cognitive 23) lib/services/ffmpeg_decryption.dart:76 — FFmpegDecryption._decryptMovKeyFile has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (7 pts), ternaries 4, loops 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HistoryDatabase.findExistingTracks (cognitive 23) · ×1
  • HistoryDatabase.findExistingTracks (cognitive 23) lib/services/history_database.dart:481 — HistoryDatabase.findExistingTracks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (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.
D2 · Cognitive Complexity · LinkDesktopOps.playHandoff (cognitive 23) · ×1
  • LinkDesktopOps.playHandoff (cognitive 23) lib/services/link/desktop/link_desktop_ops.dart:362 — LinkDesktopOps.playHandoff has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (7 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 · LinkCollectionSyncStore.apply (cognitive 23) · ×1
  • LinkCollectionSyncStore.apply (cognitive 23) lib/services/link/sync/link_collection_sync_store.dart:306 — LinkCollectionSyncStore.apply has cognitive complexity 23 (threshold 15). Drivers by points: loops 9 (12 pts), if/else 4 (7 pts), boolean chains 2, ternaries 1 (2 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 · M3uPlaylistService.parseM3uEntries (cognitive 23) · ×1
  • M3uPlaylistService.parseM3uEntries (cognitive 23) lib/services/m3u_playlist_service.dart:47 — M3uPlaylistService.parseM3uEntries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (6 pts), boolean chains 1, 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 · NetworkFileDownload.download (cognitive 23) · ×1
  • NetworkFileDownload.download (cognitive 23) lib/services/network_storage_download.dart:113 — NetworkFileDownload.download has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (6 pts), boolean chains 4, 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 · ReplayGainService._writeLocalTags (cognitive 23) · ×1
  • ReplayGainService._writeLocalTags (cognitive 23) lib/services/replaygain_service.dart:135 — ReplayGainService._writeLocalTags has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (8 pts), ternaries 2 (3 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 · AppChoiceChip.build (cognitive 23) · ×1
  • AppChoiceChip.build (cognitive 23) lib/widgets/app_choice_chip.dart:27 — AppChoiceChip.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (15 pts), if/else 6 (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.
D2 · Cognitive Complexity · _TrailingControls.build (cognitive 23) · ×1
  • _TrailingControls.build (cognitive 23) lib/widgets/desktop/desktop_player_bar.dart:831 — _TrailingControls.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 7 (9 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 · _LastfmSettingsState.build (cognitive 23) · ×1
  • _LastfmSettingsState.build (cognitive 23) lib/widgets/lastfm_settings.dart:32 — _LastfmSettingsState.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5, boolean chains 4, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _LibrarySearchResultsState._open (cognitive 23) · ×1
  • _LibrarySearchResultsState._open (cognitive 23) lib/widgets/library_search_results.dart:331 — _LibrarySearchResultsState._open has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 1 (3 pts), match/switch 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 · ImpellerCompatibilityKt.shouldDisableImpeller (cognitive 23) · ×1
  • ImpellerCompatibilityKt.shouldDisableImpeller (cognitive 23) android/app/src/main/kotlin/com/zarz/mornye/ImpellerCompatibility.kt:68 — ImpellerCompatibilityKt.shouldDisableImpeller has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (6 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 · Builder · ×1
  • Builder::finish (cognitive 23) rust_backend/crates/link/src/catalog.rs:590 — Builder::finish has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 6 (8 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadProgressSample.applyTo (cognitive 22) · ×1
  • DownloadProgressSample.applyTo (cognitive 22) lib/providers/download_progress.dart:32 — DownloadProgressSample.applyTo has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (7 pts), if/else 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 · DownloadQueueNotifier._loadQueueFromStorage (cognitive 22) · ×1
  • DownloadQueueNotifier._loadQueueFromStorage (cognitive 22) lib/providers/download_queue_provider.dart:432 — DownloadQueueNotifier._loadQueueFromStorage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, 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 · LibraryCollectionsNotifier.restoreFromBackup (cognitive 22) · ×1
  • LibraryCollectionsNotifier.restoreFromBackup (cognitive 22) lib/providers/library_collections_provider.dart:810 — LibraryCollectionsNotifier.restoreFromBackup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, ternaries 1 (3 pts), loops 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 · _SearchProviderDropdown.build (cognitive 22) · ×1
  • _SearchProviderDropdown.build (cognitive 22) lib/screens/home_tab_widgets.dart:8 — _SearchProviderDropdown.build has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 4 (6 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 · _QueueLibraryPageData.fromHistorySnapshot (cognitive 22) · ×1
  • _QueueLibraryPageData.fromHistorySnapshot (cognitive 22) lib/screens/queue_tab_helpers.dart:210 — _QueueLibraryPageData.fromHistorySnapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 3 (7 pts), loops 3 (6 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 · _LibrarySourceSettingsItem.build (cognitive 22) · ×1
  • _LibrarySourceSettingsItem.build (cognitive 22) lib/screens/settings/library_settings_page_widgets.dart:167 — _LibrarySourceSettingsItem.build has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14, if/else 4 (5 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DesktopDiagnostics._osCrashReportSince (cognitive 22) · ×1
  • DesktopDiagnostics._osCrashReportSince (cognitive 22) lib/services/desktop_diagnostics.dart:331 — DesktopDiagnostics._osCrashReportSince has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 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.
D2 · Cognitive Complexity · DownloadMetadataResolver.resolveSpotifyTrackViaDeezer (cognitive 22) · ×1
  • DownloadMetadataResolver.resolveSpotifyTrackViaDeezer (cognitive 22) lib/services/download_metadata_resolver.dart:238 — DownloadMetadataResolver.resolveSpotifyTrackViaDeezer has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (6 pts), ternaries 2 (5 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 · FFmpegConversion.convertAudioFormat (cognitive 22) · ×1
  • FFmpegConversion.convertAudioFormat (cognitive 22) lib/services/ffmpeg_conversion.dart:213 — FFmpegConversion.convertAudioFormat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, match/switch 3 (4 pts), ternaries 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.
D2 · Cognitive Complexity · FolderPathTemplate.segments (cognitive 22) · ×1
  • FolderPathTemplate.segments (cognitive 22) lib/services/folder_path_template.dart:41 — FolderPathTemplate.segments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, 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 · LibraryLyricsSearchStore.index (cognitive 22) · ×1
  • LibraryLyricsSearchStore.index (cognitive 22) lib/services/library_lyrics_search.dart:133 — LibraryLyricsSearchStore.index has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkClientController._updateDiscovery (cognitive 22) · ×1
  • LinkClientController._updateDiscovery (cognitive 22) lib/services/link/client/link_client_controller.dart:530 — LinkClientController._updateDiscovery has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, 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 · _Arrival.read (cognitive 22) · ×1
  • _Arrival.read (cognitive 22) lib/services/link/desktop/link_arriving_files.dart:227 — _Arrival.read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), ternaries 2 (4 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · LinkPhoneSources.onMessage (cognitive 22) · ×1
  • LinkPhoneSources.onMessage (cognitive 22) lib/services/link/desktop/link_phone_sources.dart:424 — LinkPhoneSources.onMessage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (8 pts), ternaries 2 (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 · LinkPhoneSources.metadata (cognitive 22) · ×1
  • LinkPhoneSources.metadata (cognitive 22) lib/services/link/desktop/link_phone_sources.dart:492 — LinkPhoneSources.metadata has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 pts), ternaries 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeLinkPlayerPort.snapshot (cognitive 22) · ×1
  • RuntimeLinkPlayerPort.snapshot (cognitive 22) lib/services/link/desktop/link_player.dart:247 — RuntimeLinkPlayerPort.snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 8, 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 · _MusicAutoMix._alignIncoming (cognitive 22) · ×1
  • _MusicAutoMix._alignIncoming (cognitive 22) lib/services/music_player_automix.dart:594 — _MusicAutoMix._alignIncoming has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 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.
D2 · Cognitive Complexity · MusicPlayerHandler.customAction (cognitive 22) · ×1
  • MusicPlayerHandler.customAction (cognitive 22) lib/services/music_player_service.dart:950 — MusicPlayerHandler.customAction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 2 (4 pts), ternaries 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 · PlayableMedia.toMediaItem (cognitive 22) · ×1
  • PlayableMedia.toMediaItem (cognitive 22) lib/services/playable_media.dart:130 — PlayableMedia.toMediaItem has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, ternaries 7, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HomeSearchSkeleton._sectionSkeleton (cognitive 22) · ×1
  • HomeSearchSkeleton._sectionSkeleton (cognitive 22) lib/widgets/animation_utils.dart:1215 — HomeSearchSkeleton._sectionSkeleton has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 5 (9 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.
D2 · Cognitive Complexity · _AudioAnalysisCardState._tryLoadFromCache (cognitive 22) · ×1
  • _AudioAnalysisCardState._tryLoadFromCache (cognitive 22) lib/widgets/audio_analysis_widget.dart:143 — _AudioAnalysisCardState._tryLoadFromCache has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, 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 · _LyricsEditorSheetState._buildFooter (cognitive 22) · ×1
  • _LyricsEditorSheetState._buildFooter (cognitive 22) lib/widgets/lyrics_editor_sheet.dart:449 — _LyricsEditorSheetState._buildFooter has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (14 pts), if/else 3 (5 pts), loops 1 (2 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.
D2 · Cognitive Complexity · _MornyeLandscapePlayerState.build (cognitive 22) · ×1
  • _MornyeLandscapePlayerState.build (cognitive 22) lib/widgets/mornye_landscape_player.dart:112 — _MornyeLandscapePlayerState.build has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14 (16 pts), if/else 3, boolean chains 2, 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 · SettingsSegmentedChoice.build (cognitive 22) · ×1
  • SettingsSegmentedChoice.build (cognitive 22) lib/widgets/settings_group.dart:882 — SettingsSegmentedChoice.build has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 4 (6 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadService.buildNotification (cognitive 22) · ×1
  • DownloadService.buildNotification (cognitive 22) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1591 — DownloadService.buildNotification has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PostProcessingHook · ×1
  • PostProcessingHook::deserialize (cognitive 22) rust_backend/crates/extensions/src/manifest.rs:64 — PostProcessingHook::deserialize has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 5 (10 pts), loops 1 (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.
D2 · Cognitive Complexity · NetworkPermissions · ×1
  • NetworkPermissions::validate_with_grants (cognitive 22) rust_backend/crates/network/src/policy.rs:62 — NetworkPermissions::validate_with_grants has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · DownloadHistoryNotifier._loadFromDatabase (cognitive 21) · ×1
  • DownloadHistoryNotifier._loadFromDatabase (cognitive 21) lib/providers/download_history_provider.dart:195 — DownloadHistoryNotifier._loadFromDatabase has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 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 · DownloadQueueNotifier._processQueue (cognitive 21) · ×1
  • DownloadQueueNotifier._processQueue (cognitive 21) lib/providers/download_queue_provider.dart:1601 — DownloadQueueNotifier._processQueue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, error handling 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 · _DownloadRun._convertLocalM4aToFlac (cognitive 21) · ×1
  • _DownloadRun._convertLocalM4aToFlac (cognitive 21) lib/providers/download_queue_provider_single_item.dart:1341 — _DownloadRun._convertLocalM4aToFlac has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · _ExtensionItem.build (cognitive 21) · ×1
  • _ExtensionItem.build (cognitive 21) lib/screens/repo_tab.dart:941 — _ExtensionItem.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 19, boolean chains 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 · _EditMetadataSheetState._save (cognitive 21) · ×1
  • _EditMetadataSheetState._save (cognitive 21) lib/screens/track_metadata_edit_sheet.dart:291 — _EditMetadataSheetState._save has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppStateDatabase._writeQueueChanges (cognitive 21) · ×1
  • AppStateDatabase._writeQueueChanges (cognitive 21) lib/services/app_state_database.dart:561 — AppStateDatabase._writeQueueChanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioMetadataMapper.vorbisToNativeChunkFields (cognitive 21) · ×1
  • AudioMetadataMapper.vorbisToNativeChunkFields (cognitive 21) lib/services/audio_metadata_mapper.dart:28 — AudioMetadataMapper.vorbisToNativeChunkFields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, match/switch 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 · AutoMixAnalyzer.analyzeTransition (cognitive 21) · ×1
  • AutoMixAnalyzer.analyzeTransition (cognitive 21) lib/services/automix_analyzer.dart:65 — AutoMixAnalyzer.analyzeTransition has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadMetadataResolver.resolveDeezerIdViaProviderIfNeeded (cognitive 21) · ×1
  • DownloadMetadataResolver.resolveDeezerIdViaProviderIfNeeded (cognitive 21) lib/services/download_metadata_resolver.dart:188 — DownloadMetadataResolver.resolveDeezerIdViaProviderIfNeeded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 2 (6 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · FFmpegConversion.splitCueToTracks (cognitive 21) · ×1
  • FFmpegConversion.splitCueToTracks (cognitive 21) lib/services/ffmpeg_conversion.dart:534 — FFmpegConversion.splitCueToTracks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 3 (5 pts), error handling 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 · LibraryFileSizes._fill (cognitive 21) · ×1
  • LibraryFileSizes._fill (cognitive 21) lib/services/library_file_sizes.dart:78 — LibraryFileSizes._fill has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (8 pts), ternaries 3 (8 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkLibraryExecutor._exportSidecar (cognitive 21) · ×1
  • LinkLibraryExecutor._exportSidecar (cognitive 21) lib/services/link/desktop/link_library_executor.dart:447 — LinkLibraryExecutor._exportSidecar has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (6 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 · LyricsAiClient._sendTranslation (cognitive 21) · ×1
  • LyricsAiClient._sendTranslation (cognitive 21) lib/services/lyrics_ai_client.dart:768 — LyricsAiClient._sendTranslation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, ternaries 1 (3 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 · MediaKitPlaybackDeck._syncEqualizer (cognitive 21) · ×1
  • MediaKitPlaybackDeck._syncEqualizer (cognitive 21) lib/services/media_kit_playback_deck.dart:772 — MediaKitPlaybackDeck._syncEqualizer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (4 pts), boolean chains 1, 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 · _MusicGapless.handoff (cognitive 21) · ×1
  • _MusicGapless.handoff (cognitive 21) lib/services/music_player_gapless.dart:231 — _MusicGapless.handoff has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 4, error handling 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 · MusicPlayerHandler.restoreSession (cognitive 21) · ×1
  • MusicPlayerHandler.restoreSession (cognitive 21) lib/services/music_player_service.dart:1389 — MusicPlayerHandler.restoreSession has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkPlaybackCache.lookup (cognitive 21) · ×1
  • NetworkPlaybackCache.lookup (cognitive 21) lib/services/network_playback_cache.dart:191 — NetworkPlaybackCache.lookup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, error handling 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 · PlatformBridge._scanToNDJSONFile (cognitive 21) · ×1
  • PlatformBridge._scanToNDJSONFile (cognitive 21) lib/services/platform_bridge.dart:2587 — PlatformBridge._scanToNDJSONFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LyricsParser._alignSupplements (cognitive 21) · ×1
  • LyricsParser._alignSupplements (cognitive 21) lib/utils/lyrics_parser.dart:527 — LyricsParser._alignSupplements has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DesktopNavigationRail.build (cognitive 21) · ×1
  • DesktopNavigationRail.build (cognitive 21) lib/widgets/desktop/desktop_navigation.dart:600 — DesktopNavigationRail.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (6 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DesktopListScopeState._handleKey (cognitive 21) · ×1
  • _DesktopListScopeState._handleKey (cognitive 21) lib/widgets/desktop/desktop_selection.dart:191 — _DesktopListScopeState._handleKey has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, 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 · _TransferSongRow.build (cognitive 21) · ×1
  • _TransferSongRow.build (cognitive 21) lib/widgets/link/link_transfer_tile.dart:650 — _TransferSongRow.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 2, match/switch 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 · _MornyeGlassRim.paint (cognitive 21) · ×1
  • _MornyeGlassRim.paint (cognitive 21) lib/widgets/mornye_chrome.dart:412 — _MornyeGlassRim.paint has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 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 · _MotionHeaderBannerState._initialize (cognitive 21) · ×1
  • _MotionHeaderBannerState._initialize (cognitive 21) lib/widgets/motion_header_banner.dart:119 — _MotionHeaderBannerState._initialize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, ternaries 3, 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 · _SyncedLyricsViewState._scheduleNextLine (cognitive 21) · ×1
  • _SyncedLyricsViewState._scheduleNextLine (cognitive 21) lib/widgets/player_lyrics.dart:505 — _SyncedLyricsViewState._scheduleNextLine has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (5 pts), ternaries 2, loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SettingsItem.build (cognitive 21) · ×1
  • SettingsItem.build (cognitive 21) lib/widgets/settings_group.dart:460 — SettingsItem.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (9 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 · _UpdateDialogState._formatChangelog (cognitive 21) · ×1
  • _UpdateDialogState._formatChangelog (cognitive 21) lib/widgets/update_dialog.dart:565 — _UpdateDialogState._formatChangelog has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1, ternaries 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 · NativeFinalizerMediaKt.finalizeQualityVariantFilename (cognitive 21) · ×1
  • NativeFinalizerMediaKt.finalizeQualityVariantFilename (cognitive 21) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt:31 — NativeFinalizerMediaKt.finalizeQualityVariantFilename has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeFinalizerMetadataKt.refreshFinalAudioQualityMetadata (cognitive 21) · ×1
  • NativeFinalizerMetadataKt.refreshFinalAudioQualityMetadata (cognitive 21) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMetadata.kt:141 — NativeFinalizerMetadataKt.refreshFinalAudioQualityMetadata has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 5, 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 · NativeFinalizerPostProcessKt.runPostProcessing (cognitive 21) · ×1
  • NativeFinalizerPostProcessKt.runPostProcessing (cognitive 21) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerPostProcess.kt:8 — NativeFinalizerPostProcessKt.runPostProcessing has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 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 · DownloadProgressSubscription.poll (cognitive 21) · ×1
  • DownloadProgressSubscription.poll (cognitive 21) ios/Runner/DownloadProgressSubscription.swift:104 — DownloadProgressSubscription.poll has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (9 pts), error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Source · ×1
  • Source::analyze_window (cognitive 21) rust_backend/crates/core/src/media/hires.rs:492 — Source::analyze_window has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (11 pts), if/else 2 (6 pts), match/switch 2 (4 pts) (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 · Spectra · ×1
  • Spectra::describe (cognitive 21) rust_backend/crates/core/src/native_audio_features.rs:320 — Spectra::describe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mornye_network · ×1
  • mornye_network::url::parse_host (cognitive 21) rust_backend/crates/network/src/url.rs:432 — mornye_network::url::parse_host has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 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 · _AccountFormDialogState._field (cognitive 20) · ×1
  • _AccountFormDialogState._field (cognitive 20) lib/controllers/extension_action_forms.dart:231 — _AccountFormDialogState._field has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 5 (6 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.
D2 · Cognitive Complexity · BatchReEnrichRunner.preview (cognitive 20) · ×1
  • BatchReEnrichRunner.preview (cognitive 20) lib/controllers/local_track_batch_actions.dart:464 — BatchReEnrichRunner.preview has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · _DownloadRun._embedSafNonM4a (cognitive 20) · ×1
  • _DownloadRun._embedSafNonM4a (cognitive 20) lib/providers/download_queue_provider_single_item.dart:1413 — _DownloadRun._embedSafNonM4a has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (5 pts), ternaries 5, error handling 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.
D2 · Cognitive Complexity · ExtensionNotifier.setExtensionEnabled (cognitive 20) · ×1
  • ExtensionNotifier.setExtensionEnabled (cognitive 20) lib/providers/extension_provider.dart:546 — ExtensionNotifier.setExtensionEnabled has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (4 pts), boolean chains 3, 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 · LibraryCollectionsNotifier.ensurePlaylistLoaded (cognitive 20) · ×1
  • LibraryCollectionsNotifier.ensurePlaylistLoaded (cognitive 20) lib/providers/library_collections_provider.dart:86 — LibraryCollectionsNotifier.ensurePlaylistLoaded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 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.
D2 · Cognitive Complexity · LocalLibraryNotifier.cleanupMissingFiles (cognitive 20) · ×1
  • LocalLibraryNotifier.cleanupMissingFiles (cognitive 20) lib/providers/local_library_provider.dart:677 — LocalLibraryNotifier.cleanupMissingFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, 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 · _DownloadedAlbumScreenState._buildAppBar (cognitive 20) · ×1
  • _DownloadedAlbumScreenState._buildAppBar (cognitive 20) lib/screens/downloaded_album_screen.dart:355 — _DownloadedAlbumScreenState._buildAppBar has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11, loops 5 (6 pts), boolean chains 2, 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 · _LocalAlbumScreenState._buildPage (cognitive 20) · ×1
  • _LocalAlbumScreenState._buildPage (cognitive 20) lib/screens/local_album_screen.dart:269 — _LocalAlbumScreenState._buildPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 1 (4 pts), ternaries 4, boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _MonthlyDonationGoalCard.build (cognitive 20) · ×1
  • _MonthlyDonationGoalCard.build (cognitive 20) lib/screens/settings/donate_page.dart:123 — _MonthlyDonationGoalCard.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 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 · _ExtensionsPageState._installExtension (cognitive 20) · ×1
  • _ExtensionsPageState._installExtension (cognitive 20) lib/screens/settings/extensions_page.dart:253 — _ExtensionsPageState._installExtension has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, error handling 1 (2 pts), loops 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 · _LinkSettingsPageState.build (cognitive 20) · ×1
  • _LinkSettingsPageState.build (cognitive 20) lib/screens/settings/link_settings_page.dart:292 — _LinkSettingsPageState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 4, loops 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 · LyricsSettingsPage.build (cognitive 20) · ×1
  • LyricsSettingsPage.build (cognitive 20) lib/screens/settings/lyrics_settings_page.dart:26 — LyricsSettingsPage.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 4, if/else 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CategoryRow.build (cognitive 20) · ×1
  • _CategoryRow.build (cognitive 20) lib/screens/settings/settings_tab.dart:1000 — _CategoryRow.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 16, boolean chains 2, if/else 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 · AudioAnalysisDiskCache.loadFromCache (cognitive 20) · ×1
  • AudioAnalysisDiskCache.loadFromCache (cognitive 20) lib/services/audio_analysis_cache.dart:66 — AudioAnalysisDiskCache.loadFromCache has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoMixEffectRenderer.render (cognitive 20) · ×1
  • AutoMixEffectRenderer.render (cognitive 20) lib/services/automix_effect_renderer.dart:103 — AutoMixEffectRenderer.render has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoverStore.file (cognitive 20) · ×1
  • CoverStore.file (cognitive 20) lib/services/cover_store.dart:153 — CoverStore.file has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, ternaries 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 · DownloadQueuePersistence._enqueue (cognitive 20) · ×1
  • DownloadQueuePersistence._enqueue (cognitive 20) lib/services/download_queue_persistence.dart:103 — DownloadQueuePersistence._enqueue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 3, 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 · DownloadedEmbeddedCoverResolver._ensureCover (cognitive 20) · ×1
  • DownloadedEmbeddedCoverResolver._ensureCover (cognitive 20) lib/services/downloaded_embedded_cover_resolver.dart:478 — DownloadedEmbeddedCoverResolver._ensureCover has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5 (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 · FFmpegConversion._convertToLossless (cognitive 20) · ×1
  • FFmpegConversion._convertToLossless (cognitive 20) lib/services/ffmpeg_conversion.dart:360 — FFmpegConversion._convertToLossless has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 7, boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FFmpegProbe._readAudioProperties (cognitive 20) · ×1
  • FFmpegProbe._readAudioProperties (cognitive 20) lib/services/ffmpeg_probe.dart:87 — FFmpegProbe._readAudioProperties has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 2 (5 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · _Arrival._look (cognitive 20) · ×1
  • _Arrival._look (cognitive 20) lib/services/link/desktop/link_arriving_files.dart:255 — _Arrival._look has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (4 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · LinkDesktopOps.runCommand (cognitive 20) · ×1
  • LinkDesktopOps.runCommand (cognitive 20) lib/services/link/desktop/link_desktop_ops.dart:291 — LinkDesktopOps.runCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (4 pts), match/switch 1 (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 · LinkPhoneCatalogs._page (cognitive 20) · ×1
  • LinkPhoneCatalogs._page (cognitive 20) lib/services/link/desktop/link_phone_catalogs.dart:181 — LinkPhoneCatalogs._page 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 · LinkHistoryArtwork.handle (cognitive 20) · ×1
  • LinkHistoryArtwork.handle (cognitive 20) lib/services/link/sync/link_history_artwork.dart:266 — LinkHistoryArtwork.handle 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.
D2 · Cognitive Complexity · SharedLyricsTranslation.fromJson (cognitive 20) · ×1
  • SharedLyricsTranslation.fromJson (cognitive 20) lib/services/lyrics_translation_sharing.dart:46 — SharedLyricsTranslation.fromJson has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, if/else 3, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PlatformBridge._restorePersistentCache (cognitive 20) · ×1
  • PlatformBridge._restorePersistentCache (cognitive 20) lib/services/platform_bridge.dart:770 — PlatformBridge._restorePersistentCache has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 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 · PlayerWidgetService._readArtwork (cognitive 20) · ×1
  • PlayerWidgetService._readArtwork (cognitive 20) lib/services/player_widget_service.dart:252 — PlayerWidgetService._readArtwork has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (5 pts), boolean chains 4, 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 · ReplayGainService._updateFile (cognitive 20) · ×1
  • ReplayGainService._updateFile (cognitive 20) lib/services/replaygain_service.dart:199 — ReplayGainService._updateFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 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 · CoverPalette._resolve (cognitive 20) · ×1
  • CoverPalette._resolve (cognitive 20) lib/theme/cover_palette.dart:261 — CoverPalette._resolve has cognitive complexity 20 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (6 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 11). 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 · _MaterialContextMenuState.build (cognitive 20) · ×1
  • _MaterialContextMenuState.build (cognitive 20) lib/widgets/desktop/context_menu.dart:279 — _MaterialContextMenuState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 2 (3 pts), if/else 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DesktopSidebar.build (cognitive 20) · ×1
  • DesktopSidebar.build (cognitive 20) lib/widgets/desktop/desktop_navigation.dart:1082 — DesktopSidebar.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (9 pts), loops 4 (6 pts), if/else 4, boolean chains 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.
D2 · Cognitive Complexity · MornyeContextMenu.build (cognitive 20) · ×1
  • MornyeContextMenu.build (cognitive 20) lib/widgets/mornye_context_menu.dart:600 — MornyeContextMenu.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (11 pts), loops 3 (4 pts), if/else 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 · _PlaybackTimeBuilderState._sync (cognitive 20) · ×1
  • _PlaybackTimeBuilderState._sync (cognitive 20) lib/widgets/playback_time_builder.dart:70 — _PlaybackTimeBuilderState._sync has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, if/else 4, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · DownloadService.startNativeWorker (cognitive 20) · ×1
  • DownloadService.startNativeWorker (cognitive 20) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:673 — DownloadService.startNativeWorker has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 4 (7 pts), loops 3, 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.
D2 · Cognitive Complexity · Lines · ×1
  • Lines::next (cognitive 20) rust_backend/crates/core/src/cue.rs:199 — Lines::next has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 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 · Health · ×1
  • Health::run_check (cognitive 20) rust_backend/crates/extensions/src/backend/health.rs:232 — Health::run_check has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 3 (4 pts), boolean chains 1, loops 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.
D2 · Cognitive Complexity · QualityOption · ×1
  • QualityOption::deserialize (cognitive 20) rust_backend/crates/extensions/src/manifest.rs:64 — QualityOption::deserialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 5 (9 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 · (anonymous).invokeManaged (cognitive 20) · ×1
  • (anonymous).invokeManaged (cognitive 20) rust_backend/crates/extensions/src/prelude.js:740 — (anonymous).invokeManaged has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 2 (4 pts), loops 1 (2 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 · _EagerInitializationState._maybeAutoScanLocalLibrary (cognitive 19) · ×1
  • _EagerInitializationState._maybeAutoScanLocalLibrary (cognitive 19) lib/main.dart:756 — _EagerInitializationState._maybeAutoScanLocalLibrary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadQueueLookup.updatedForIndices (cognitive 19) · ×1
  • DownloadQueueLookup.updatedForIndices (cognitive 19) lib/providers/download_queue_state.dart:608 — DownloadQueueLookup.updatedForIndices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 3, ternaries 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 · EqualizerController._load (cognitive 19) · ×1
  • EqualizerController._load (cognitive 19) lib/providers/equalizer_provider.dart:45 — EqualizerController._load has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (7 pts), boolean chains 2, error handling 1 (nesting depth added 9). 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 · TrackNotifier.customSearch (cognitive 19) · ×1
  • TrackNotifier.customSearch (cognitive 19) lib/providers/track_provider.dart:455 — TrackNotifier.customSearch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (4 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 · _ArtistScreenState.initState (cognitive 19) · ×1
  • _ArtistScreenState.initState (cognitive 19) lib/screens/artist_screen.dart:224 — _ArtistScreenState.initState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 2 (4 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 · _TrackItemWithStatus.activate (cognitive 19) · ×1
  • _TrackItemWithStatus.activate (cognitive 19) lib/screens/home_tab_widgets.dart:358 — _TrackItemWithStatus.activate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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 · _ListeningStatisticsScreenState._summarySlivers (cognitive 19) · ×1
  • _ListeningStatisticsScreenState._summarySlivers (cognitive 19) lib/screens/listening_statistics_screen.dart:299 — _ListeningStatisticsScreenState._summarySlivers has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (13 pts), loops 3 (4 pts), if/else 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 · _BackgroundPicker.build (cognitive 19) · ×1
  • _BackgroundPicker.build (cognitive 19) lib/screens/lyrics_share_screen.dart:323 — _BackgroundPicker.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (18 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 · _NetworkStorageScreenState._load (cognitive 19) · ×1
  • _NetworkStorageScreenState._load (cognitive 19) lib/screens/network_storage_screen.dart:192 — _NetworkStorageScreenState._load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LogScreenState.build (cognitive 19) · ×1
  • _LogScreenState.build (cognitive 19) lib/screens/settings/log_screen.dart:292 — _LogScreenState.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13, boolean chains 4, if/else 1, 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 · ExtensionStorageService._migrateDirectory (cognitive 19) · ×1
  • ExtensionStorageService._migrateDirectory (cognitive 19) lib/services/extension_storage_service.dart:292 — ExtensionStorageService._migrateDirectory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 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 · LinkClientController._onDiscoveryChanged (cognitive 19) · ×1
  • LinkClientController._onDiscoveryChanged (cognitive 19) lib/services/link/client/link_client_controller.dart:575 — LinkClientController._onDiscoveryChanged has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, loops 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.
D2 · Cognitive Complexity · AppLinkDownloadsPort.resolveUrl (cognitive 19) · ×1
  • AppLinkDownloadsPort.resolveUrl (cognitive 19) lib/services/link/desktop/link_downloads.dart:181 — AppLinkDownloadsPort.resolveUrl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (2 pts), ternaries 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 · LinkDesktopRemote.refresh (cognitive 19) · ×1
  • LinkDesktopRemote.refresh (cognitive 19) lib/services/link/features/link_desktop_remote.dart:150 — LinkDesktopRemote.refresh has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, error handling 2, ternaries 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 · LinkPhoneFileRequests._deleteSong (cognitive 19) · ×1
  • LinkPhoneFileRequests._deleteSong (cognitive 19) lib/services/link/features/link_phone_library_sync.dart:399 — LinkPhoneFileRequests._deleteSong has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkDownloadFolderDestination.store (cognitive 19) · ×1
  • LinkDownloadFolderDestination.store (cognitive 19) lib/services/link/features/link_save_offline.dart:542 — LinkDownloadFolderDestination.store has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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 · MediaKitPlaybackDeck.queueNextSource (cognitive 19) · ×1
  • MediaKitPlaybackDeck.queueNextSource (cognitive 19) lib/services/media_kit_playback_deck.dart:363 — MediaKitPlaybackDeck.queueNextSource has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), error handling 1 (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 · _MusicAutoMix.onPosition (cognitive 19) · ×1
  • _MusicAutoMix.onPosition (cognitive 19) lib/services/music_player_automix.dart:118 — _MusicAutoMix.onPosition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MusicPlayerHandler._refreshPlaybackAutomation (cognitive 19) · ×1
  • MusicPlayerHandler._refreshPlaybackAutomation (cognitive 19) lib/services/music_player_service.dart:731 — MusicPlayerHandler._refreshPlaybackAutomation has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (9 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 · MusicPlayerHandler._loadNetworkMetadata (cognitive 19) · ×1
  • MusicPlayerHandler._loadNetworkMetadata (cognitive 19) lib/services/music_player_service.dart:2027 — MusicPlayerHandler._loadNetworkMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), 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 · MusicPlayerHandler._ensureDurationKnown (cognitive 19) · ×1
  • MusicPlayerHandler._ensureDurationKnown (cognitive 19) lib/services/music_player_service.dart:2080 — MusicPlayerHandler._ensureDurationKnown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, error handling 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 · PlayableMedia.fromJson (cognitive 19) · ×1
  • PlayableMedia.fromJson (cognitive 19) lib/services/playable_media.dart:84 — PlayableMedia.fromJson has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, error handling 1 (3 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 · AppSheetOption.build (cognitive 19) · ×1
  • AppSheetOption.build (cognitive 19) lib/widgets/app_bottom_sheet.dart:607 — AppSheetOption.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 5, 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 · _AudioFacts._source (cognitive 19) · ×1
  • _AudioFacts._source (cognitive 19) lib/widgets/audio_info_sheet.dart:487 — _AudioFacts._source has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _Transport._buildControls (cognitive 19) · ×1
  • _Transport._buildControls (cognitive 19) lib/widgets/desktop/desktop_player_bar.dart:422 — _Transport._buildControls has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (16 pts), if/else 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 · _LibrarySearchResultsState._row (cognitive 19) · ×1
  • _LibrarySearchResultsState._row (cognitive 19) lib/widgets/library_search_results.dart:403 — _LibrarySearchResultsState._row has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 12, boolean chains 4, if/else 2, 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 · LinkTransferTile.build (cognitive 19) · ×1
  • LinkTransferTile.build (cognitive 19) lib/widgets/link/link_transfer_tile.dart:339 — LinkTransferTile.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 5 (6 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 · _LyricsOptionsButtonState._buildButton (cognitive 19) · ×1
  • _LyricsOptionsButtonState._buildButton (cognitive 19) lib/widgets/lyrics_options_button.dart:121 — _LyricsOptionsButtonState._buildButton has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 7, if/else 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MaterialPlayerLayout._metadataAndControls (cognitive 19) · ×1
  • MaterialPlayerLayout._metadataAndControls (cognitive 19) lib/widgets/material_player_layout.dart:312 — MaterialPlayerLayout._metadataAndControls has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 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 · MornyeContextMenu._action (cognitive 19) · ×1
  • MornyeContextMenu._action (cognitive 19) lib/widgets/mornye_context_menu.dart:678 — MornyeContextMenu._action has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 14 (15 pts), if/else 3, 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 · _MornyePlaybackButtonState.build (cognitive 19) · ×1
  • _MornyePlaybackButtonState.build (cognitive 19) lib/widgets/mornye_playback_button.dart:117 — _MornyePlaybackButtonState.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 12, boolean chains 5, if/else 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 · SettingsSwitchItem.build (cognitive 19) · ×1
  • SettingsSwitchItem.build (cognitive 19) lib/widgets/settings_group.dart:595 — SettingsSwitchItem.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 4, 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 · NativeDataJobsKt.runNativeDataJobPlatform (cognitive 19) · ×1
  • NativeDataJobsKt.runNativeDataJobPlatform (cognitive 19) android/app/src/rust/kotlin/com/zarz/mornye/NativeDataJobs.kt:46 — NativeDataJobsKt.runNativeDataJobPlatform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (8 pts), boolean chains 2 (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 · Actor · ×1
  • Actor::run (cognitive 19) rust_backend/crates/cast/src/sender.rs:413 — Actor::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (8 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAudioController.pickFolder (cognitive 18) · ×1
  • OpenAudioController.pickFolder (cognitive 18) lib/controllers/open_audio_controller.dart:63 — OpenAudioController.pickFolder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 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 · DownloadHistoryNotifier.updateAudioMetadataForItem (cognitive 18) · ×1
  • DownloadHistoryNotifier.updateAudioMetadataForItem (cognitive 18) lib/providers/download_history_provider.dart:671 — DownloadHistoryNotifier.updateAudioMetadataForItem has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 15, if/else 2, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _DownloadRun._recoverSafUriIfNeeded (cognitive 18) · ×1
  • _DownloadRun._recoverSafUriIfNeeded (cognitive 18) lib/providers/download_queue_provider_single_item.dart:1537 — _DownloadRun._recoverSafUriIfNeeded has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, 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 · _DownloadRun._handleRunException (cognitive 18) · ×1
  • _DownloadRun._handleRunException (cognitive 18) lib/providers/download_queue_provider_single_item.dart:1810 — _DownloadRun._handleRunException has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 3, error handling 2 (3 pts), ternaries 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.
D2 · Cognitive Complexity · ExtensionNotifier.exportBackup (cognitive 18) · ×1
  • ExtensionNotifier.exportBackup (cognitive 18) lib/providers/extension_provider.dart:630 — ExtensionNotifier.exportBackup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (4 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 · _ArtistScreenState._loadMoreAlbums (cognitive 18) · ×1
  • _ArtistScreenState._loadMoreAlbums (cognitive 18) lib/screens/artist_screen.dart:474 — _ArtistScreenState._loadMoreAlbums has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomeTabState._fetchMetadata (cognitive 18) · ×1
  • _HomeTabState._fetchMetadata (cognitive 18) lib/screens/home_tab.dart:637 — _HomeTabState._fetchMetadata has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (6 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 · _NetworkStorageScreenState._play (cognitive 18) · ×1
  • _NetworkStorageScreenState._play (cognitive 18) lib/screens/network_storage_screen.dart:253 — _NetworkStorageScreenState._play has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (5 pts), loops 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 · AppearanceSettingsPage.build (cognitive 18) · ×1
  • AppearanceSettingsPage.build (cognitive 18) lib/screens/settings/appearance_settings_page.dart:26 — AppearanceSettingsPage.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (8 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 · _ScanProgressTile.build (cognitive 18) · ×1
  • _ScanProgressTile.build (cognitive 18) lib/screens/settings/library_settings_page_widgets.dart:604 — _ScanProgressTile.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 6, if/else 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.
D2 · Cognitive Complexity · _SetupScreenState.build (cognitive 18) · ×1
  • _SetupScreenState.build (cognitive 18) lib/screens/setup_screen.dart:750 — _SetupScreenState.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, ternaries 6, 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 · _WhatsNewScreenState.build (cognitive 18) · ×1
  • _WhatsNewScreenState.build (cognitive 18) lib/screens/whats_new_screen.dart:133 — _WhatsNewScreenState.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 12 (13 pts), if/else 3, 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 · AudioAnalysisRunner._getMediaInfo (cognitive 18) · ×1
  • AudioAnalysisRunner._getMediaInfo (cognitive 18) lib/services/audio_analysis_runner.dart:415 — AudioAnalysisRunner._getMediaInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, error handling 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.
D2 · Cognitive Complexity · AudioAnalysisRunner._runFullStreamLevelAnalysis (cognitive 18) · ×1
  • AudioAnalysisRunner._runFullStreamLevelAnalysis (cognitive 18) lib/services/audio_analysis_runner.dart:578 — AudioAnalysisRunner._runFullStreamLevelAnalysis has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (6 pts), error handling 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 · OpenAudioFile.parse (cognitive 18) · ×1
  • OpenAudioFile.parse (cognitive 18) lib/services/audio_file_open_service.dart:26 — OpenAudioFile.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 5 (6 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · AudioMetadataMapper.normalizeToVorbisComments (cognitive 18) · ×1
  • AudioMetadataMapper.normalizeToVorbisComments (cognitive 18) lib/services/audio_metadata_mapper.dart:117 — AudioMetadataMapper.normalizeToVorbisComments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 3, match/switch 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 · HistoryDatabase.updateFilePath (cognitive 18) · ×1
  • HistoryDatabase.updateFilePath (cognitive 18) lib/services/history_database.dart:622 — HistoryDatabase.updateFilePath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), 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, 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 · HistorySchema.upgrade (cognitive 18) · ×1
  • HistorySchema.upgrade (cognitive 18) lib/services/history_schema.dart:82 — HistorySchema.upgrade has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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 · LibraryCollectionsDatabase._projectCollectionReadDatabase (cognitive 18) · ×1
  • LibraryCollectionsDatabase._projectCollectionReadDatabase (cognitive 18) lib/services/library_collections_database.dart:602 — LibraryCollectionsDatabase._projectCollectionReadDatabase has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkTrackRefCache.resolve (cognitive 18) · ×1
  • LinkTrackRefCache.resolve (cognitive 18) lib/services/link/features/link_track_resolver.dart:153 — LinkTrackRefCache.resolve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 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 · LinkLyricsTranslations.handle (cognitive 18) · ×1
  • LinkLyricsTranslations.handle (cognitive 18) lib/services/link/link_lyrics_translations.dart:47 — LinkLyricsTranslations.handle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LinkSyncHandlers.updatePlaylist (cognitive 18) · ×1
  • _LinkSyncHandlers.updatePlaylist (cognitive 18) lib/services/link/sync/link_sync_handlers.dart:389 — _LinkSyncHandlers.updatePlaylist has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalNetworkAccess._isLocalAddress (cognitive 18) · ×1
  • LocalNetworkAccess._isLocalAddress (cognitive 18) lib/services/local_network_access.dart:80 — LocalNetworkAccess._isLocalAddress has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (6 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 · MprisPlayerObject.handleMethodCall (cognitive 18) · ×1
  • MprisPlayerObject.handleMethodCall (cognitive 18) lib/services/media_session_mpris.dart:264 — MprisPlayerObject.handleMethodCall has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, match/switch 2 (3 pts), ternaries 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 · _MusicFailures.skipMissing (cognitive 18) · ×1
  • _MusicFailures.skipMissing (cognitive 18) lib/services/music_player_failures.dart:67 — _MusicFailures.skipMissing has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 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.
D2 · Cognitive Complexity · MusicPlayerRuntime._initialize (cognitive 18) · ×1
  • MusicPlayerRuntime._initialize (cognitive 18) lib/services/music_player_runtime.dart:577 — MusicPlayerRuntime._initialize 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 · MusicPlayerHandler.reapplyNormalization (cognitive 18) · ×1
  • MusicPlayerHandler.reapplyNormalization (cognitive 18) lib/services/music_player_service.dart:1136 — MusicPlayerHandler.reapplyNormalization has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 6, error handling 2 (3 pts), ternaries 2 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkFileDownload.identity (cognitive 18) · ×1
  • NetworkFileDownload.identity (cognitive 18) lib/services/network_storage_download.dart:47 — NetworkFileDownload.identity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 1 (4 pts), boolean chains 2, match/switch 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 · PlatformBridge._withMediaFileAccess (cognitive 18) · ×1
  • PlatformBridge._withMediaFileAccess (cognitive 18) lib/services/platform_bridge.dart:1570 — PlatformBridge._withMediaFileAccess has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), error handling 1 (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 · PlayableMedia.toJson (cognitive 18) · ×1
  • PlayableMedia.toJson (cognitive 18) lib/services/playable_media.dart:62 — PlayableMedia.toJson has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DesktopLinkDevicesSheet.build (cognitive 18) · ×1
  • DesktopLinkDevicesSheet.build (cognitive 18) lib/widgets/desktop/desktop_link_devices_sheet.dart:32 — DesktopLinkDevicesSheet.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 4 (6 pts), boolean chains 3, error handling 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 · _TrackInfoHeaderState.build (cognitive 18) · ×1
  • _TrackInfoHeaderState.build (cognitive 18) lib/widgets/download_service_picker.dart:686 — _TrackInfoHeaderState.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 5 (6 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 · _HiResCheckCardState._buildResult (cognitive 18) · ×1
  • _HiResCheckCardState._buildResult (cognitive 18) lib/widgets/hires_check_card.dart:205 — _HiResCheckCardState._buildResult has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 1, match/switch 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 · _LibraryFastScrollerState.build (cognitive 18) · ×1
  • _LibraryFastScrollerState.build (cognitive 18) lib/widgets/library_fast_scroller.dart:209 — _LibraryFastScrollerState.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 2 (3 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 · LinkLibraryJobsView.build (cognitive 18) · ×1
  • LinkLibraryJobsView.build (cognitive 18) lib/widgets/link/link_library_actions.dart:558 — LinkLibraryJobsView.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (6 pts), loops 1 (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 · _MornyePlayerArtworkState.build (cognitive 18) · ×1
  • _MornyePlayerArtworkState.build (cognitive 18) lib/widgets/mornye_player_artwork.dart:35 — _MornyePlayerArtworkState.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, 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 · _WordHighlightedLyricLineState._updateVisualEnd (cognitive 18) · ×1
  • _WordHighlightedLyricLineState._updateVisualEnd (cognitive 18) lib/widgets/player_lyrics_word_sweep.dart:273 — _WordHighlightedLyricLineState._updateVisualEnd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (14 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 · _PlayerTrackSwipeState._finish (cognitive 18) · ×1
  • _PlayerTrackSwipeState._finish (cognitive 18) lib/widgets/player_track_swipe.dart:73 — _PlayerTrackSwipeState._finish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 2 (4 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 · _PlaylistPickerSheetContentState._handleDone (cognitive 18) · ×1
  • _PlaylistPickerSheetContentState._handleDone (cognitive 18) lib/widgets/playlist_picker_sheet.dart:93 — _PlaylistPickerSheetContentState._handleDone has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 pts), ternaries 1 (2 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 · _ScrollEdgeFadeState.build (cognitive 18) · ×1
  • _ScrollEdgeFadeState.build (cognitive 18) lib/widgets/scroll_edge_fade.dart:39 — _ScrollEdgeFadeState.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 12 (17 pts), 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 · AndroidLibraryCovers.cache (cognitive 18) · ×1
  • AndroidLibraryCovers.cache (cognitive 18) android/app/src/main/kotlin/com/zarz/mornye/AndroidLibraryCovers.kt:8 — AndroidLibraryCovers.cache has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MainActivityMetadataCallsKt.handleReEnrichFile (cognitive 18) · ×1
  • MainActivityMetadataCallsKt.handleReEnrichFile (cognitive 18) android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:229 — MainActivityMetadataCallsKt.handleReEnrichFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (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 · NativeFinalizationPolicy.flacAutoConversionArguments (cognitive 18) · ×1
  • NativeFinalizationPolicy.flacAutoConversionArguments (cognitive 18) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizationPolicy.kt:149 — NativeFinalizationPolicy.flacAutoConversionArguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 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 · NativeFinalizerContainerKt.finalizeContainerConversion (cognitive 18) · ×1
  • NativeFinalizerContainerKt.finalizeContainerConversion (cognitive 18) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerContainer.kt:133 — NativeFinalizerContainerKt.finalizeContainerConversion 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 · SafBatchQueriesKt.safExistsBatch (cognitive 18) · ×1
  • SafBatchQueriesKt.safExistsBatch (cognitive 18) android/app/src/main/kotlin/com/zarz/mornye/SafBatchQueries.kt:12 — SafBatchQueriesKt.safExistsBatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 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 · AppDelegate.handleMethodCall (cognitive 18) · ×1
  • AppDelegate.handleMethodCall (cognitive 18) ios/Runner/AppDelegate.swift:317 — AppDelegate.handleMethodCall has cognitive complexity 18 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 4 (5 pts), ternaries 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MainFlutterWindow.awakeFromNib (cognitive 18) · ×1
  • MainFlutterWindow.awakeFromNib (cognitive 18) macos/Runner/MainFlutterWindow.swift:32 — MainFlutterWindow.awakeFromNib has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (4 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reader · ×1
  • Reader::specific_config (cognitive 18) rust_backend/crates/core/src/media/mp4.rs:214 — Reader::specific_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RangeReader · ×1
  • RangeReader::fetch (cognitive 18) rust_backend/crates/mobile/src/network_tags.rs:387 — RangeReader::fetch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, 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, 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 · Volume · ×1
  • Volume::open (cognitive 18) rust_backend/crates/mobile/src/usb_audio/volume.rs:149 — Volume::open has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 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 · BuiltinLyricsClient · ×1
  • BuiltinLyricsClient::genius (cognitive 18) rust_backend/crates/providers/src/lyrics/builtin/direct.rs:264 — BuiltinLyricsClient::genius has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 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 · DownloadResult.outputExtension (cognitive 17) · ×1
  • DownloadResult.outputExtension (cognitive 17) lib/models/download_result.dart:87 — DownloadResult.outputExtension has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DownloadRun._resolveTrackIdentifiers (cognitive 17) · ×1
  • _DownloadRun._resolveTrackIdentifiers (cognitive 17) lib/providers/download_queue_provider_single_item.dart:429 — _DownloadRun._resolveTrackIdentifiers has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · RepoNotifier.setRegistryUrl (cognitive 17) · ×1
  • RepoNotifier.setRegistryUrl (cognitive 17) lib/providers/repo_provider.dart:237 — RepoNotifier.setRegistryUrl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomeTabState._onSearchChanged (cognitive 17) · ×1
  • _HomeTabState._onSearchChanged (cognitive 17) lib/screens/home_tab.dart:464 — _HomeTabState._onSearchChanged has cognitive complexity 17 (threshold 15). Drivers by points: if/else 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 · _SetupScreenState._isStepCompleted (cognitive 17) · ×1
  • _SetupScreenState._isStepCompleted (cognitive 17) lib/screens/setup_screen.dart:717 — _SetupScreenState._isStepCompleted has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, match/switch 2 (4 pts), ternaries 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 · CoverStore._readStoredIndex (cognitive 17) · ×1
  • CoverStore._readStoredIndex (cognitive 17) lib/services/cover_store.dart:313 — CoverStore._readStoredIndex 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 · CsvImportService._parseCsv (cognitive 17) · ×1
  • CsvImportService._parseCsv (cognitive 17) lib/services/csv_import_service.dart:237 — CsvImportService._parseCsv has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, 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 · LastfmListening.update (cognitive 17) · ×1
  • LastfmListening.update (cognitive 17) lib/services/lastfm/lastfm_listening.dart:58 — LastfmListening.update has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), 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 · LinkDesktopTransfers._run (cognitive 17) · ×1
  • LinkDesktopTransfers._run (cognitive 17) lib/services/link/desktop/link_desktop_transfers.dart:228 — LinkDesktopTransfers._run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (5 pts), match/switch 1 (2 pts), boolean chains 1, error handling 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 · LinkHandoff._sendQueue (cognitive 17) · ×1
  • LinkHandoff._sendQueue (cognitive 17) lib/services/link/features/link_handoff.dart:393 — LinkHandoff._sendQueue has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 4, if/else 4, loops 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.
D2 · Cognitive Complexity · LinkLibraryJobsClient.refresh (cognitive 17) · ×1
  • LinkLibraryJobsClient.refresh (cognitive 17) lib/services/link/features/link_library_jobs_client.dart:61 — LinkLibraryJobsClient.refresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 2 (4 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 · LinkPhoneLibrary._build (cognitive 17) · ×1
  • LinkPhoneLibrary._build (cognitive 17) lib/services/link/features/link_phone_library.dart:393 — LinkPhoneLibrary._build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 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.
D2 · Cognitive Complexity · LinkPlaybackDetails.read (cognitive 17) · ×1
  • LinkPlaybackDetails.read (cognitive 17) lib/services/link/link_playback_details.dart:64 — LinkPlaybackDetails.read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 3 (5 pts), boolean chains 2, loops 2, 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 · MotionArtworkStore._save (cognitive 17) · ×1
  • MotionArtworkStore._save (cognitive 17) lib/services/motion_artwork_store.dart:135 — MotionArtworkStore._save has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 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 · MusicPlayerHandler._stopSession (cognitive 17) · ×1
  • MusicPlayerHandler._stopSession (cognitive 17) lib/services/music_player_service.dart:2368 — MusicPlayerHandler._stopSession has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · NetworkStorageService.downloadCover (cognitive 17) · ×1
  • NetworkStorageService.downloadCover (cognitive 17) lib/services/network_storage_service.dart:551 — NetworkStorageService.downloadCover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaylistCoverStore.normalize (cognitive 17) · ×1
  • PlaylistCoverStore.normalize (cognitive 17) lib/services/playlist_cover_store.dart:35 — PlaylistCoverStore.normalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (4 pts), loops 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 · ShareIntentService._handleSharedMedia (cognitive 17) · ×1
  • ShareIntentService._handleSharedMedia (cognitive 17) lib/services/share_intent_service.dart:62 — ShareIntentService._handleSharedMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 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 · UserProfileStore.save (cognitive 17) · ×1
  • UserProfileStore.save (cognitive 17) lib/services/user_profile_store.dart:62 — UserProfileStore.save has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (4 pts), ternaries 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 · LogBuffer.exportWithDeviceInfo (cognitive 17) · ×1
  • LogBuffer.exportWithDeviceInfo (cognitive 17) lib/utils/logger.dart:300 — LogBuffer.exportWithDeviceInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2, match/switch 1 (2 pts), 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 · AppMenuButton.build (cognitive 17) · ×1
  • AppMenuButton.build (cognitive 17) lib/widgets/app_menu_button.dart:52 — AppMenuButton.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (5 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 · _MornyeSwitchState.build (cognitive 17) · ×1
  • _MornyeSwitchState.build (cognitive 17) lib/widgets/app_switch.dart:69 — _MornyeSwitchState.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 15, boolean chains 1, if/else 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LibrarySelectionPlaybackActions.build (cognitive 17) · ×1
  • LibrarySelectionPlaybackActions.build (cognitive 17) lib/widgets/library_selection_playback_actions.dart:28 — LibrarySelectionPlaybackActions.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5 (7 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.
D2 · Cognitive Complexity · LibraryTrackSelectionBar.build (cognitive 17) · ×1
  • LibraryTrackSelectionBar.build (cognitive 17) lib/widgets/library_track_selection_bar.dart:47 — LibraryTrackSelectionBar.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 5, 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 · LinkDevicesSheet.build (cognitive 17) · ×1
  • LinkDevicesSheet.build (cognitive 17) lib/widgets/link/link_devices_sheet.dart:95 — LinkDevicesSheet.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, boolean chains 4, ternaries 4, loops 1 (2 pts), 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 · _LyricGapIndicatorState.build (cognitive 17) · ×1
  • _LyricGapIndicatorState.build (cognitive 17) lib/widgets/lyric_gap_indicator.dart:41 — _LyricGapIndicatorState.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 2 (4 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 · _MenuLayout.getPositionForChild (cognitive 17) · ×1
  • _MenuLayout.getPositionForChild (cognitive 17) lib/widgets/mornye_context_menu.dart:486 — _MenuLayout.getPositionForChild has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 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 · _PlaybackFeedbackState.initState (cognitive 17) · ×1
  • _PlaybackFeedbackState.initState (cognitive 17) lib/widgets/playback_feedback.dart:31 — _PlaybackFeedbackState.initState has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SettingsGroup.build (cognitive 17) · ×1
  • SettingsGroup.build (cognitive 17) lib/widgets/settings_group.dart:253 — SettingsGroup.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 3, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SettingsInfoCard.build (cognitive 17) · ×1
  • SettingsInfoCard.build (cognitive 17) lib/widgets/settings_group.dart:1004 — SettingsInfoCard.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 3, boolean chains 1, 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 · _UpdateDialogState._downloadAndInstall (cognitive 17) · ×1
  • _UpdateDialogState._downloadAndInstall (cognitive 17) lib/widgets/update_dialog.dart:79 — _UpdateDialogState._downloadAndInstall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 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 · _UpdateDialogState._downloadAndInstallDesktop (cognitive 17) · ×1
  • _UpdateDialogState._downloadAndInstallDesktop (cognitive 17) lib/widgets/update_dialog.dart:174 — _UpdateDialogState._downloadAndInstallDesktop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (2 pts), 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 · BitPerfectPcm.convert (cognitive 17) · ×1
  • BitPerfectPcm.convert (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/BitPerfectPcm.kt:11 — BitPerfectPcm.convert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, match/switch 2 (5 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 · HiResPlayback.prepare (cognitive 17) · ×1
  • HiResPlayback.prepare (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/HiResPlayback.kt:73 — HiResPlayback.prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 1, 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.
D2 · Cognitive Complexity · MainActivityMetadataCallsKt.handleEditFileMetadata (cognitive 17) · ×1
  • MainActivityMetadataCallsKt.handleEditFileMetadata (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:90 — MainActivityMetadataCallsKt.handleEditFileMetadata has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (11 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 · UsbPcmPlayback.prepare (cognitive 17) · ×1
  • UsbPcmPlayback.prepare (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/UsbBitPerfectPlugin.kt:206 — UsbPcmPlayback.prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UsbDirectPlayback.prepare (cognitive 17) · ×1
  • UsbDirectPlayback.prepare (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/UsbDirectPlayback.kt:142 — UsbDirectPlayback.prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, error handling 1, 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, 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 · CastService · ×1
  • CastService::call (cognitive 17) rust_backend/crates/cast/src/service.rs:64 — CastService::call has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts) (nesting depth added 8). 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 · ExtensionPermissions · ×1
  • ExtensionPermissions::deserialize (cognitive 17) rust_backend/crates/extensions/src/manifest.rs:64 — ExtensionPermissions::deserialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 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 · (anonymous).logValue (cognitive 17) · ×1
  • (anonymous).logValue (cognitive 17) rust_backend/crates/extensions/src/prelude.js:510 — (anonymous).logValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, error handling 2 (4 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DownloadHistoryNotifier._cleanupOrphanedDownloadsIncremental (cognitive 16) · ×1
  • DownloadHistoryNotifier._cleanupOrphanedDownloadsIncremental (cognitive 16) lib/providers/download_history_provider.dart:1148 — DownloadHistoryNotifier._cleanupOrphanedDownloadsIncremental has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3, ternaries 2 (3 pts), boolean chains 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 · DownloadQueueNotifier.exportFailedDownloads (cognitive 16) · ×1
  • DownloadQueueNotifier.exportFailedDownloads (cognitive 16) lib/providers/download_queue_provider.dart:1501 — DownloadQueueNotifier.exportFailedDownloads has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AlbumScreenState._buildTrackList (cognitive 16) · ×1
  • _AlbumScreenState._buildTrackList (cognitive 16) lib/screens/album_screen.dart:685 — _AlbumScreenState._buildTrackList has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (6 pts), boolean chains 4, ternaries 3 (4 pts), if/else 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 · _EqualizerCurve.paint (cognitive 16) · ×1
  • _EqualizerCurve.paint (cognitive 16) lib/screens/equalizer_curve.dart:43 — _EqualizerCurve.paint has cognitive complexity 16 (threshold 15). Drivers by points: loops 8, if/else 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 3). 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 · _ExtensionAlbumScreenState._fetchTracks (cognitive 16) · ×1
  • _ExtensionAlbumScreenState._fetchTracks (cognitive 16) lib/screens/extension_collection_screens.dart:460 — _ExtensionAlbumScreenState._fetchTracks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (6 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 · _HomeTabState.initState (cognitive 16) · ×1
  • _HomeTabState.initState (cognitive 16) lib/screens/home_tab.dart:215 — _HomeTabState.initState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 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 · _SearchCoverCell.build (cognitive 16) · ×1
  • _SearchCoverCell.build (cognitive 16) lib/screens/home_tab_search_wide.dart:804 — _SearchCoverCell.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 12, boolean chains 2, if/else 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 · _LibraryTracksFolderScreenState._saveOrder (cognitive 16) · ×1
  • _LibraryTracksFolderScreenState._saveOrder (cognitive 16) lib/screens/library_tracks_folder_screen.dart:134 — _LibraryTracksFolderScreenState._saveOrder has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (4 pts), boolean chains 2, 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 · _MainShellState._handleSharedUrl (cognitive 16) · ×1
  • _MainShellState._handleSharedUrl (cognitive 16) lib/screens/main_shell.dart:379 — _MainShellState._handleSharedUrl has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4, 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 · _ResultStageState.build (cognitive 16) · ×1
  • _ResultStageState.build (cognitive 16) lib/screens/music_recognition_screen.dart:524 — _ResultStageState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, 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 · _NowPlayingScreenState._showMoreActions (cognitive 16) · ×1
  • _NowPlayingScreenState._showMoreActions (cognitive 16) lib/screens/now_playing_screen.dart:1109 — _NowPlayingScreenState._showMoreActions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 5, boolean chains 4, 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 · _LyricsAiTranslationPageState.build (cognitive 16) · ×1
  • _LyricsAiTranslationPageState.build (cognitive 16) lib/screens/settings/lyrics_ai_translation_page.dart:55 — _LyricsAiTranslationPageState.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 12 (13 pts), if/else 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 · _EditMetadataSheetState._showEditorOptionPicker (cognitive 16) · ×1
  • _EditMetadataSheetState._showEditorOptionPicker (cognitive 16) lib/screens/track_metadata_edit_sheet.dart:100 — _EditMetadataSheetState._showEditorOptionPicker has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 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 · _TrackMetadataScreenState._navigateToAdjacentTrack (cognitive 16) · ×1
  • _TrackMetadataScreenState._navigateToAdjacentTrack (cognitive 16) lib/screens/track_metadata_screen.dart:717 — _TrackMetadataScreenState._navigateToAdjacentTrack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, ternaries 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 · AudioMetadataMapper.convertToId3Tags (cognitive 16) · ×1
  • AudioMetadataMapper.convertToId3Tags (cognitive 16) lib/services/audio_metadata_mapper.dart:336 — AudioMetadataMapper.convertToId3Tags has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 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 · AutoplayTasteModel._load (cognitive 16) · ×1
  • AutoplayTasteModel._load (cognitive 16) lib/services/autoplay_taste.dart:163 — AutoplayTasteModel._load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoverDownloadService.detectCoverFileFormat (cognitive 16) · ×1
  • CoverDownloadService.detectCoverFileFormat (cognitive 16) lib/services/cover_download_service.dart:111 — CoverDownloadService.detectCoverFileFormat has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 2 (4 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 · DownloadMetadataEmbedding._ffmpegFields (cognitive 16) · ×1
  • DownloadMetadataEmbedding._ffmpegFields (cognitive 16) lib/services/download_metadata_embedding.dart:367 — DownloadMetadataEmbedding._ffmpegFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (5 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · FFmpegConversion._convertToPcm (cognitive 16) · ×1
  • FFmpegConversion._convertToPcm (cognitive 16) lib/services/ffmpeg_conversion.dart:453 — FFmpegConversion._convertToPcm has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8, boolean chains 5, if/else 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 · Id3v23Lyrics._writeUnsyncedLyricsToFile (cognitive 16) · ×1
  • Id3v23Lyrics._writeUnsyncedLyricsToFile (cognitive 16) lib/services/id3v23_lyrics.dart:39 — Id3v23Lyrics._writeUnsyncedLyricsToFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 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 · LibraryCollectionsDatabase._readDateOrderedRows (cognitive 16) · ×1
  • LibraryCollectionsDatabase._readDateOrderedRows (cognitive 16) lib/services/library_collections_database.dart:495 — LibraryCollectionsDatabase._readDateOrderedRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (5 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 · LinkCatalogExporter.export (cognitive 16) · ×1
  • LinkCatalogExporter.export (cognitive 16) lib/services/link/desktop/link_catalog_exporter.dart:351 — LinkCatalogExporter.export has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkPhoneSong.toJson (cognitive 16) · ×1
  • LinkPhoneSong.toJson (cognitive 16) lib/services/link/link_protocol.dart:660 — LinkPhoneSong.toJson has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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 · _MusicFailures.onRuntimeError (cognitive 16) · ×1
  • _MusicFailures.onRuntimeError (cognitive 16) lib/services/music_player_failures.dart:24 — _MusicFailures.onRuntimeError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MusicPlayerHandler.restoreIosNowPlaying (cognitive 16) · ×1
  • MusicPlayerHandler.restoreIosNowPlaying (cognitive 16) lib/services/music_player_service.dart:508 — MusicPlayerHandler.restoreIosNowPlaying has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), error handling 1 (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 · MusicPlayerHandler._playIndex (cognitive 16) · ×1
  • MusicPlayerHandler._playIndex (cognitive 16) lib/services/music_player_service.dart:1608 — MusicPlayerHandler._playIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 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 · RecordMicrophone.requestAccess (cognitive 16) · ×1
  • RecordMicrophone.requestAccess (cognitive 16) lib/services/music_recognition.dart:239 — RecordMicrophone.requestAccess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (5 pts), boolean chains 3, 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 · NetworkLibraryUploader.upload (cognitive 16) · ×1
  • NetworkLibraryUploader.upload (cognitive 16) lib/services/network_library_upload.dart:227 — NetworkLibraryUploader.upload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (5 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 · SubsonicClient._searchCatalog (cognitive 16) · ×1
  • SubsonicClient._searchCatalog (cognitive 16) lib/services/network_storage_subsonic.dart:508 — SubsonicClient._searchCatalog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), 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 · PlaybackAutomation._applyVolume (cognitive 16) · ×1
  • PlaybackAutomation._applyVolume (cognitive 16) lib/services/playback_automation.dart:85 — PlaybackAutomation._applyVolume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 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 · UpdateChecker._isNewerVersion (cognitive 16) · ×1
  • UpdateChecker._isNewerVersion (cognitive 16) lib/services/update_checker.dart:457 — UpdateChecker._isNewerVersion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 1, 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 · LyricTimelineIndex.activeIndices (cognitive 16) · ×1
  • LyricTimelineIndex.activeIndices (cognitive 16) lib/utils/lyrics_timeline.dart:101 — LyricTimelineIndex.activeIndices has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ProgressStreamPoller._runGuarded (cognitive 16) · ×1
  • ProgressStreamPoller._runGuarded (cognitive 16) lib/utils/progress_stream_poller.dart:144 — ProgressStreamPoller._runGuarded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlignedLyricPronunciation.build (cognitive 16) · ×1
  • AlignedLyricPronunciation.build (cognitive 16) lib/widgets/aligned_lyric_pronunciation.dart:194 — AlignedLyricPronunciation.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (5 pts), boolean chains 4, ternaries 2 (4 pts), 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 · AppActionButton.build (cognitive 16) · ×1
  • AppActionButton.build (cognitive 16) lib/widgets/app_action_button.dart:34 — AppActionButton.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 6, if/else 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 · _AppCrashBannerState.build (cognitive 16) · ×1
  • _AppCrashBannerState.build (cognitive 16) lib/widgets/app_crash_banner.dart:30 — _AppCrashBannerState.build has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (5 pts), ternaries 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _ExpressiveMenuAnchorState._openMenu (cognitive 16) · ×1
  • _ExpressiveMenuAnchorState._openMenu (cognitive 16) lib/widgets/app_menu_button.dart:140 — _ExpressiveMenuAnchorState._openMenu has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _AudioAnalysisCardState._saveSpectrogram (cognitive 16) · ×1
  • _AudioAnalysisCardState._saveSpectrogram (cognitive 16) lib/widgets/audio_analysis_widget.dart:401 — _AudioAnalysisCardState._saveSpectrogram has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 2 (3 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 · _DesktopContentArea.build (cognitive 16) · ×1
  • _DesktopContentArea.build (cognitive 16) lib/widgets/desktop/desktop_navigation.dart:414 — _DesktopContentArea.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 4, if/else 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.
D2 · Cognitive Complexity · _DesktopScrollArrowsState._arrow (cognitive 16) · ×1
  • _DesktopScrollArrowsState._arrow (cognitive 16) lib/widgets/desktop/desktop_scroll_arrows.dart:114 — _DesktopScrollArrowsState._arrow has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 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 · _TransfersListState.build (cognitive 16) · ×1
  • _TransfersListState.build (cognitive 16) lib/widgets/link/link_transfers_view.dart:154 — _TransfersListState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3, ternaries 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 · _LyricsEditorRow.build (cognitive 16) · ×1
  • _LyricsEditorRow.build (cognitive 16) lib/widgets/lyrics_editor_sheet.dart:629 — _LyricsEditorRow.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 16. 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 · _ReEnrichFieldSheetState.build (cognitive 16) · ×1
  • _ReEnrichFieldSheetState.build (cognitive 16) lib/widgets/re_enrich_field_dialog.dart:143 — _ReEnrichFieldSheetState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoreFFmpegStaging.create (cognitive 16) · ×1
  • CoreFFmpegStaging.create (cognitive 16) android/app/src/main/kotlin/com/zarz/mornye/CoreBackend.kt:51 — CoreFFmpegStaging.create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 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 · NativeCrashTrace.fields (cognitive 16) · ×1
  • NativeCrashTrace.fields (cognitive 16) android/app/src/main/kotlin/com/zarz/mornye/NativeCrashTrace.kt:44 — NativeCrashTrace.fields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 2, error handling 1 (2 pts), loops 2, match/switch 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 · NativeFlacConversionKt.convertToStagedFlac (cognitive 16) · ×1
  • NativeFlacConversionKt.convertToStagedFlac (cognitive 16) android/app/src/main/kotlin/com/zarz/mornye/NativeFlacConversion.kt:6 — NativeFlacConversionKt.convertToStagedFlac has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlayerWidgetBridge.attach (cognitive 16) · ×1
  • PlayerWidgetBridge.attach (cognitive 16) android/app/src/main/kotlin/com/zarz/mornye/PlayerWidgetProvider.kt:334 — PlayerWidgetBridge.attach has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (2 pts), 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 · LinkNowPlayingController.sharedArtwork (cognitive 16) · ×1
  • LinkNowPlayingController.sharedArtwork (cognitive 16) ios/Runner/LinkNowPlayingBridge.swift:133 — LinkNowPlayingController.sharedArtwork has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TrackMatching · ×1
  • TrackMatching::deserialize (cognitive 16) rust_backend/crates/extensions/src/manifest.rs:64 — TrackMatching::deserialize has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 3 (6 pts), loops 1 (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 · Registry · ×1
  • Registry::deserialize (cognitive 16) rust_backend/crates/extensions/src/repository/model.rs:66 — Registry::deserialize has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 3 (6 pts), loops 1 (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 · AvailabilityService · ×1
  • AvailabilityService::lookup (cognitive 16) rust_backend/crates/providers/src/resolver/availability/cache.rs:171 — AvailabilityService::lookup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: settings.dart, playback_settings_page.dart, settings_search_catalog.dart lib/models/settings.dart — 3 files — `lib/models/settings.dart`, `lib/screens/settings/playback_settings_page.dart`, `lib/utils/settings_search_catalog.dart` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust_backend/crates/extensions/src/backend/cover.rs:342 — rust_backend/crates/extensions/src/backend/cover.rs:342-528 | rust_backend/crates/extensions/src/backend/cover.rs:536-568 | rust_backend/crates/extensions/src/backend/library.rs:41-55 | rust_backend/crates/extensions/src/backend/library.rs:281-304 | rust_backend/crates/extensions/src/backend/tags.rs:46-73 | rust_backend/crates/extensions/src/backend/tags.rs:82-179 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/services/history_row_mapper.dart:63 — lib/services/history_row_mapper.dart:63-134 | lib/services/history_schema.dart:253-275 | lib/services/library_row_mapper.dart:37-68 | lib/services/library_schema.dart:350-373 — 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 (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) rust_backend/crates/providers/src/resolver/availability/cache.rs:171 — rust_backend/crates/providers/src/resolver/availability/cache.rs:171-262 | rust_backend/crates/providers/src/resolver/service.rs:109-189 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (99 corresponding lines) · ×1
  • Edited copy of a member (99 corresponding lines) lib/widgets/settings_group.dart:460 — lib/widgets/settings_group.dart:460-570 | lib/widgets/settings_group.dart:595-693 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) lib/models/download_history.dart:190 — lib/models/download_history.dart:190-269 | lib/models/track.dart:154-220 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (84 corresponding lines) · ×1
  • Edited copy of a member (84 corresponding lines) lib/screens/settings/app_settings_page.dart:268 — lib/screens/settings/app_settings_page.dart:268-351 | lib/screens/settings/app_settings_page.dart:363-448 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) lib/screens/artist_screen_discography.dart:473 — lib/screens/artist_screen_discography.dart:473-532 | lib/widgets/batch_progress_dialog.dart:113-187 — 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 (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) lib/widgets/library_directory_view.dart:142 — lib/widgets/library_directory_view.dart:142-193 | lib/widgets/library_search_results.dart:170-235 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (7 members, 1+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:10 — rust_backend/crates/core/src/lyrics/models.rs:10-10 | rust_backend/crates/core/src/lyrics/models.rs:36-36 | rust_backend/crates/core/src/lyrics/models.rs:87-87 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:82-82 | rust_backend/crates/core/src/metadata/musicbrainz.rs:22-22 | rust_backend/crates/core/src/metadata/share.rs:16-16 | rust_backend/crates/core/src/resolver.rs:64-64 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 1 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 (8 members, 1+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 1+ corresponding lines) rust_backend/crates/core/src/lyrics/models.rs:74 — rust_backend/crates/core/src/lyrics/models.rs:74-74 | rust_backend/crates/core/src/lyrics/models.rs:119-119 | rust_backend/crates/core/src/lyrics/models.rs:144-144 | rust_backend/crates/core/src/metadata/deezer.rs:69-69 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:9-9 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:22-22 | rust_backend/crates/core/src/metadata/deezer/catalog.rs:124-124 | rust_backend/crates/core/src/resolver.rs:121-121 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 1 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 copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) lib/theme/app_theme.dart:37 — lib/theme/app_theme.dart:37-84 | lib/theme/app_theme.dart:86-135 — 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 copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) lib/screens/settings/lyrics_provider_priority_page.dart:315 — lib/screens/settings/lyrics_provider_priority_page.dart:315-377 | lib/widgets/reorderable_priority_item.dart:24-98 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
  • Edited copy of a member (54 corresponding lines) lib/models/extension.dart:183 — lib/models/extension.dart:183-236 | lib/providers/track_provider.dart:72-131 — 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 (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) rust_backend/crates/cast/src/media.rs:379 — rust_backend/crates/cast/src/media.rs:379-415 | rust_backend/crates/link/src/subsonic/media.rs:156-196 — 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 (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) lib/services/link/features/link_phone_library_sync.dart:357 — lib/services/link/features/link_phone_library_sync.dart:357-397 | lib/services/link/features/link_phone_library_sync.dart:399-446 — 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 (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) lib/screens/mornye_library_screen.dart:188 — lib/screens/mornye_library_screen.dart:188-231 | lib/screens/mornye_library_screen.dart:233-275 — 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 (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) lib/services/backup_service.dart:389 — lib/services/backup_service.dart:389-426 | lib/services/backup_service.dart:428-482 — 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 (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) lib/widgets/animation_utils.dart:268 — lib/widgets/animation_utils.dart:268-309 | lib/widgets/animation_utils.dart:403-448 — 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 copies of one member (3 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 37+ corresponding lines) lib/screens/home_tab_intro.dart:1051 — lib/screens/home_tab_intro.dart:1051-1088 | lib/screens/home_tab_intro.dart:1215-1251 | lib/screens/home_tab_intro.dart:1262-1299 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 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 (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) lib/screens/home_tab.dart:1135 — lib/screens/home_tab.dart:1135-1164 | lib/screens/library_tracks_folder_screen.dart:1609-1641 — 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 · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) rust_backend/crates/core/src/text.rs:3 — rust_backend/crates/core/src/text.rs:3-20 | rust_backend/crates/extensions/src/host.rs:261-279 | rust_backend/crates/extensions/src/redact.rs:68-87 — 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, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) lib/providers/extension_provider.dart:429 — lib/providers/extension_provider.dart:429-444 | lib/providers/extension_provider.dart:511-528 | lib/providers/extension_provider.dart:530-544 — 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 (4 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 21+ corresponding lines) lib/screens/settings/download_settings_page.dart:426 — lib/screens/settings/download_settings_page.dart:426-448 | lib/screens/settings/download_settings_page.dart:450-472 | lib/screens/settings/download_settings_page.dart:501-526 | lib/screens/settings/metadata_settings_page.dart:166-186 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 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, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:131 — android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:131-143 | android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:145-157 | android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:159-172 — 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 copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) lib/screens/repo/extension_details_screen.dart:573 — lib/screens/repo/extension_details_screen.dart:573-589 | lib/screens/repo/extension_details_screen.dart:591-607 | lib/screens/repo_tab.dart:636-652 | lib/screens/repo_tab.dart:654-673 — These 4 members are one piece of code written 4 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 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) lib/screens/repo/extension_details_screen.dart:556 — lib/screens/repo/extension_details_screen.dart:556-571 | lib/screens/settings/files_settings_page.dart:425-440 | lib/screens/settings/files_settings_page.dart:442-457 | lib/screens/settings/library_settings_page.dart:387-404 — 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 (5 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 15+ corresponding lines) lib/services/platform_bridge.dart:1323 — lib/services/platform_bridge.dart:1323-1337 | lib/services/platform_bridge.dart:1339-1355 | lib/services/platform_bridge.dart:1357-1375 | lib/services/platform_bridge.dart:1398-1412 | lib/services/platform_bridge.dart:1475-1491 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) lib/services/link/client/link_client_controller.dart:300 — lib/services/link/client/link_client_controller.dart:300-304 | lib/services/link/client/link_client_store.dart:25-29 | lib/services/network_storage_service.dart:407-411 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) lib/screens/downloaded_album_screen.dart:179 — lib/screens/downloaded_album_screen.dart:179-189 | lib/screens/home_tab.dart:1571-1580 | lib/screens/queue_tab.dart:464-473 — 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 (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) lib/widgets/desktop/desktop_mini_player.dart:286 — lib/widgets/desktop/desktop_mini_player.dart:286-291 | lib/widgets/player_lyrics.dart:132-138 | lib/widgets/player_lyrics_word_sweep.dart:87-93 — 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 · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) lib/services/library_queue_store.dart:521 — lib/services/library_queue_store.dart:521-586 | lib/services/library_queue_store.dart:735-770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/library_queue_store.dart:521` 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) lib/widgets/network_offline_actions.dart:244 — lib/widgets/network_offline_actions.dart:244-268 | lib/widgets/network_upload_actions.dart:169-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/network_offline_actions.dart: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. 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 (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) lib/providers/download_history_provider.dart:694 — lib/providers/download_history_provider.dart:694-716 | lib/providers/download_history_provider.dart:777-800 — both copies are in the same file, so extract the 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 `lib/providers/download_history_provider.dart:694` 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 lines × 2) · ×1
  • Duplicated block (20 lines × 2) lib/screens/downloaded_album_screen.dart:392 — lib/screens/downloaded_album_screen.dart:392-411 | lib/screens/local_album_screen.dart:377-396 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 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 `lib/screens/downloaded_album_screen.dart:392` 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 (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) lib/services/link/client/link_client_library.dart:117 — lib/services/link/client/link_client_library.dart:117-132 | lib/services/link/desktop/link_phone_library.dart:62-80 — before extracting anything, compare `lib/services/link/client/link_client_library.dart` and `lib/services/link/desktop/link_phone_library.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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 `lib/services/link/client/link_client_library.dart:117` 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 (13–19 lines × 2) · ×1
  • Duplicated block (13–19 lines × 2) lib/widgets/mornye_selection_pill.dart:246 — lib/widgets/mornye_selection_pill.dart:246-264 | lib/widgets/mornye_selection_pill.dart:416-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/mornye_selection_pill.dart:246` 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) lib/screens/downloaded_album_screen.dart:872 — lib/screens/downloaded_album_screen.dart:872-888 | lib/screens/local_album_screen.dart:828-843 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 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 `lib/screens/downloaded_album_screen.dart:872` 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 `tracks` to `List<DownloadHistoryItem>` in one and `List<LocalLibraryItem>` 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, `lib/screens/local_album_screen.dart:826` calls `_selectedFlacEligibleItems`, `_queueSelectedAsFlac`, `_reEnrichSelected` and `lib/screens/downloaded_album_screen.dart:872` 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 (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) lib/screens/downloaded_album_screen.dart:426 — lib/screens/downloaded_album_screen.dart:426-441 | lib/screens/library_mix_screen.dart:286-301 | lib/screens/local_album_screen.dart:428-443 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 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 `lib/screens/downloaded_album_screen.dart:426` 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–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) lib/widgets/mornye_player_queue.dart:247 — lib/widgets/mornye_player_queue.dart:247-260 | lib/widgets/player_queue_sheet.dart:190-205 — 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 `lib/widgets/mornye_player_queue.dart:247` 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 (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) lib/screens/album_screen.dart:719 — lib/screens/album_screen.dart:719-733 | lib/screens/playlist_screen.dart:462-476 — 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 `lib/screens/album_screen.dart:719` 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 lines × 3) · ×1
  • Duplicated block (14 lines × 3) lib/screens/extension_collection_screens.dart:461 — lib/screens/extension_collection_screens.dart:461-474 | lib/screens/extension_collection_screens.dart:640-653 | lib/screens/extension_collection_screens.dart:779-792 — 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 `lib/screens/extension_collection_screens.dart:461` 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 (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) lib/providers/network_offline_provider.dart:151 — lib/providers/network_offline_provider.dart:151-163 | lib/providers/network_upload_provider.dart:71-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/network_offline_provider.dart:151` 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 × 2) · ×1
  • Duplicated block (13 lines × 2) lib/screens/settings/lyrics_ai_translation_page.dart:532 — lib/screens/settings/lyrics_ai_translation_page.dart:532-544 | lib/screens/settings/lyrics_ai_translation_page.dart:653-667 — both copies are in the same file, so extract the 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 `lib/screens/settings/lyrics_ai_translation_page.dart:532` 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–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) lib/services/music_haptics.dart:238 — lib/services/music_haptics.dart:238-245 | lib/services/song_feature_analyzer.dart:53-64 — 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 `lib/services/music_haptics.dart:238` 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 lines × 3) · ×1
  • Duplicated block (11 lines × 3) lib/screens/home_tab_intro.dart:1051 — lib/screens/home_tab_intro.dart:1051-1061 | lib/screens/home_tab_intro.dart:1215-1225 | lib/screens/home_tab_intro.dart:1262-1272 — 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 `lib/screens/home_tab_intro.dart:1051` 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 (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) lib/screens/settings/library_settings_page.dart:273 — lib/screens/settings/library_settings_page.dart:273-283 | lib/screens/settings/library_settings_page.dart:315-325 | lib/widgets/mornye_player_favorite_button.dart:44-53 — 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 `lib/screens/settings/library_settings_page.dart:273` 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 (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) lib/widgets/audio_analysis_info_card.dart:14 — lib/widgets/audio_analysis_info_card.dart:14-22 | lib/widgets/audio_analysis_widget.dart:474-482 | lib/widgets/audio_analysis_widget.dart:518-526 — 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 `lib/widgets/audio_analysis_info_card.dart:14` 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 after the matched lines, `lib/widgets/audio_analysis_widget.dart:527` calls `Center` and `lib/widgets/audio_analysis_info_card.dart:23` 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) lib/screens/tutorial_screen.dart:417 — lib/screens/tutorial_screen.dart:417-424 | lib/screens/tutorial_screen.dart:563-570 | lib/widgets/download_service_picker.dart:622-629 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) lib/services/history_row_mapper.dart:114 — lib/services/history_row_mapper.dart:114-119 | lib/services/history_schema.dart:267-272 | lib/services/library_row_mapper.dart:59-64 | lib/services/library_schema.dart:364-369 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) lib/screens/downloaded_album_screen.dart:830 — lib/screens/downloaded_album_screen.dart:830-835 | lib/screens/library_mix_screen.dart:216-222 | lib/screens/local_album_screen.dart:785-791 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 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 before the matched lines, `lib/screens/downloaded_album_screen.dart:829` calls `_selectedUnifiedItems` and `lib/screens/library_mix_screen.dart:215` 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 (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) lib/services/app_orientation.dart:68 — lib/services/app_orientation.dart:68-72 | lib/services/app_orientation.dart:74-78 | lib/services/app_orientation.dart:80-84 | lib/services/shell_navigation_service.dart:330-334 — 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 × 3) · ×1
  • Duplicated block (5 lines × 3) lib/widgets/desktop/desktop_player_bar.dart:416 — lib/widgets/desktop/desktop_player_bar.dart:416-420 | lib/widgets/desktop/desktop_player_bar.dart:547-551 | lib/widgets/mini_player.dart:480-484 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×1
  • Duplicated block (10–14 lines × 2) rust_backend/crates/core/src/isrc/native_files.rs:29 — rust_backend/crates/core/src/isrc/native_files.rs:29-38 | rust_backend/crates/extensions/src/files/index.rs:29-42 — 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 `rust_backend/crates/core/src/isrc/native_files.rs:29` 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 (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) rust_backend/crates/extensions/src/backend/downloads.rs:131 — rust_backend/crates/extensions/src/backend/downloads.rs:131-145 | rust_backend/crates/extensions/src/backend/provider_metadata.rs:293-305 | rust_backend/crates/extensions/src/lyrics.rs:122-134 — before extracting anything, compare `rust_backend/crates/extensions/src/backend/provider_metadata.rs` and `rust_backend/crates/extensions/src/lyrics.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 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 `rust_backend/crates/extensions/src/backend/downloads.rs: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.
D4 · Code Duplication · Duplicated block (6–10 lines × 2) · ×1
  • Duplicated block (6–10 lines × 2) rust_backend/crates/extensions/src/manager/postprocess.rs:148 — rust_backend/crates/extensions/src/manager/postprocess.rs:148-157 | rust_backend/crates/extensions/src/manager/providers.rs:127-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 `rust_backend/crates/extensions/src/manager/postprocess.rs:148` 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 (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) rust_backend/crates/extensions/src/backend/cover.rs:345 — rust_backend/crates/extensions/src/backend/cover.rs:345-352 | rust_backend/crates/extensions/src/backend/cover.rs:539-546 | rust_backend/crates/extensions/src/backend/library.rs:44-51 | rust_backend/crates/extensions/src/backend/library.rs:284-291 | rust_backend/crates/extensions/src/backend/tags.rs:49-56 | rust_backend/crates/extensions/src/backend/tags.rs:85-92 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (3–5 lines × 3) · ×1
  • Duplicated block (3–5 lines × 3) rust_backend/crates/providers/src/musicbrainz.rs:241 — rust_backend/crates/providers/src/musicbrainz.rs:241-243 | rust_backend/crates/providers/src/resolver/availability/cache.rs:266-270 | rust_backend/crates/providers/src/resolver/service.rs:193-197 — 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 `rust_backend/crates/providers/src/musicbrainz.rs:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_backend/crates/providers/src/resolver/availability/cache.rs:271` calls `drop`, `shutdown` and `rust_backend/crates/providers/src/resolver/service.rs:198` 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 · Unstable project mornye-mobile · ×1
  • Unstable project mornye-mobile — mornye-mobile has instability 0.83 with 1 dependents.
X14 · Bypassable address classification · IP classification is bypassable through an IPv4-in-IPv6 embedding · ×1
  • IP classification is bypassable through an IPv4-in-IPv6 embedding lib/services/local_network_access.dart:84 — This function unwraps IPv4-MAPPED IPv6 (`[10] == 0xff`, line 86) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 84 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright.
X2 · Cancellation propagation · Function without a CancelToken · ×1
  • Function without a CancelToken: _requestStoragePermission lib/screens/setup_screen.dart:260 — `_requestStoragePermission` calls `audio.request(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
Minor — 53 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate lib/widgets/app_loading_indicator.dart:26 — `!MediaQuery.disableAnimationsOf(context) && TickerMode.valuesOf(context).enabled` appears character-identically in 4 files — lib/widgets/app_loading_indicator.dart, lib/widgets/expressive_seek_track.dart, lib/widgets/now_playing_indicator.dart, lib/widgets/overflow_marquee.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 lib/screens/setup_screen.dart:768 — `!_isLoading && _isStepCompleted(_currentStep)` appears character-identically in 2 files — lib/screens/setup_screen.dart, lib/screens/setup_steps.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 lib/services/link/client/link_client_library.dart:113 — `!_ref.mounted || source == null || !source.enabled` appears character-identically in 2 files — lib/services/link/client/link_client_library.dart, lib/services/link/desktop/link_phone_library.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 lib/services/metadata_cover_resources.dart:101 — `!await file.exists() || await file.length() == 0` appears character-identically in 2 files — lib/services/metadata_cover_resources.dart, lib/services/motion_artwork_store.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 lib/services/network_library_scanner_subsonic.dart:89 — `!complete && file != null && await file.exists()` appears character-identically in 2 files — lib/services/network_library_scanner_subsonic.dart, lib/services/network_library_scanner_virtual.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 lib/screens/downloaded_album_screen.dart:180 — `!mounted || _embeddedCoverRefreshScheduled` appears character-identically in 3 files — lib/screens/downloaded_album_screen.dart, lib/screens/home_tab.dart, lib/screens/queue_tab.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 lib/screens/local_album_screen.dart:117 — `!mounted || generation != _loadGeneration` appears character-identically in 2 files — lib/screens/local_album_screen.dart, lib/widgets/audio_info_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 lib/screens/track_metadata_screen.dart:374 — `!mounted || generation != _metadataLoadGeneration || sourcePath != cleanFilePath` appears character-identically in 2 files — lib/screens/track_metadata_screen.dart, lib/screens/track_metadata_screen_cover.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 lib/providers/download_queue_provider_paths.dart:508 — `!settings.separateSingles && settings.folderOrganization == 'custom'` appears character-identically in 3 files — lib/providers/download_queue_provider_paths.dart, lib/providers/download_queue_provider_reorganize.dart, lib/screens/settings/files_settings_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 lib/services/automix_effect_renderer.dart:160 — `!success || generation != _generation || !await output.exists()` appears character-identically in 2 files — lib/services/automix_effect_renderer.dart, lib/services/music_haptics.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 lib/services/link/desktop/link_player.dart:304 — `AudioServiceRepeatMode.all || AudioServiceRepeatMode.group` appears character-identically in 3 files — lib/services/link/desktop/link_player.dart, lib/services/link/features/link_phone_player.dart, lib/services/link/link_mirrored_playback.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 lib/services/music_player_automix.dart:113 — `Duration(seconds: 1) && _attempt != '${handler._playRequestGeneration}:${handler._sessionQueueRevision}'` appears character-identically in 2 files — lib/services/music_player_automix.dart, lib/services/music_player_gapless.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 lib/screens/listening_rewind_slides.dart:464 — `MediaQuery.disableAnimationsOf(context) || !TickerMode.valuesOf(context).enabled` appears character-identically in 2 files — lib/screens/listening_rewind_slides.dart, lib/widgets/animation_utils.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 lib/services/cover_download_service.dart:53 — `Platform.isAndroid && settings.storageMode == 'saf'` appears character-identically in 2 files — lib/services/cover_download_service.dart, lib/services/link/features/link_save_offline.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 lib/screens/settings/playback_settings_page.dart:458 — `Platform.isAndroid || Platform.isIOS || isDesktopPlatform` appears character-identically in 3 files — lib/screens/settings/playback_settings_page.dart, lib/services/music_player_service.dart, lib/services/platform_bridge.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 lib/services/cover_download_service.dart:76 — `Platform.isIOS && settings.downloadDirectoryBookmark.isNotEmpty` appears character-identically in 2 files — lib/services/cover_download_service.dart, lib/services/link/features/link_save_offline.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 lib/screens/setup_screen.dart:734 — `_notificationPermissionGranted || _notificationPermissionSkipped` appears character-identically in 2 files — lib/screens/setup_screen.dart, lib/screens/setup_steps.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 lib/providers/download_queue_provider.dart:1225 — `_queueStartupPending || !_queueStorageReady` appears character-identically in 2 files — lib/providers/download_queue_provider.dart, lib/providers/download_queue_provider_reorganize.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 lib/screens/track_metadata_edit_autofill.dart:771 — `_saving || _fetching || _fetchingMusicBrainz` appears character-identically in 2 files — lib/screens/track_metadata_edit_autofill.dart, lib/screens/track_metadata_edit_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 lib/screens/artist_screen.dart:272 — `_topTracks == null || _topTracks!.isEmpty` appears character-identically in 2 files — lib/screens/artist_screen.dart, lib/screens/artist_screen_widgets.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 lib/screens/artist_screen.dart:614 — `a.albumType == 'single' || a.albumType == 'ep'` appears character-identically in 2 files — lib/screens/artist_screen.dart, lib/screens/artist_screen_discography.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 lib/controllers/clickable_metadata.dart:270 — `artistName != null && artistName.isNotEmpty` appears character-identically in 2 files — lib/controllers/clickable_metadata.dart, lib/screens/album_screen.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 lib/screens/album_screen.dart:268 — `audioTraits != null && audioTraits.isNotEmpty` appears character-identically in 2 files — lib/screens/album_screen.dart, lib/screens/extension_collection_screens.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 lib/utils/audio_quality_badge_policy.dart:97 — `bitDepth != null && bitDepth > 0 && sampleRate != null && sampleRate > 0` appears character-identically in 2 files — lib/utils/audio_quality_badge_policy.dart, lib/utils/string_utils.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 lib/screens/now_playing_screen.dart:434 — `box is! RenderBox || !box.attached || !box.hasSize` appears character-identically in 3 files — lib/screens/now_playing_screen.dart, lib/widgets/desktop/context_menu.dart, lib/widgets/mini_player.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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×8
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:804 — `parseNativeWorkerRunId` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:995 — `nativeWorkerConcurrency` swallows every exception into `1` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1008 — `nativeRequestProviderKey` swallows every exception into `"default"` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1018 — `nativeRequestProviderConcurrency` swallows every exception into `3` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/DownloadServiceSnapshot.kt:211 — `readNativeWorkerRunIdFromSnapshotFile` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/DownloadServiceSnapshot.kt:375 — `pollNativeWorkerProgress` swallows every exception into `emptySet()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/ImpellerCompatibility.kt:136 — `getGpuRenderer` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch lib/screens/settings/cache_management_page.dart:136 — `_getTrackCacheSizeSafe` turns every thrown error into `0` — 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.
X7 · Silent fallback defaults · Silent fallback default on Err · ×7
  • Silent fallback default on Err rust_backend/crates/core/src/isrc/native_files.rs:58 — `read` turns every `Err` into `Ok(String::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 rust_backend/crates/core/src/lyrics/matching.rs:197 — `clock_duration` turns every `Err` into `0.0` — 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 rust_backend/crates/extensions/src/backend/health.rs:178 — `fallback_status` turns every `Err` into `"unknown".into()` — 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 rust_backend/crates/extensions/src/files/index.rs:57 — `read` turns every `Err` into `Ok(String::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 rust_backend/crates/extensions/src/download/chunked.rs:355 — `total_length` turns every `Err` into `-1` — 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 rust_backend/crates/mobile/src/native_lyrics/text.rs:58 — `duration` turns every `Err` into `0` — 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 rust_backend/crates/mobile/src/native_lyrics/text.rs:145 — `romanization_words` 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.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×2
  • Hand-rolled JSON/XML parsing via regex rust_backend/crates/mobile/src/native_lyrics_translation.rs:13 — 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 Rust code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/services/lyrics_ai_client.dart:675 — 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 Dart code already uses a real parser in the same package; use it here too.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 4 of 19 project(s) overshoot their size bounds, lowering Project Cohesion to 5.8/10. The most over is `(repository root)` (250683 LoC, 1262 module-visible types across 27 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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 4/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `macos`, `rust_backend/crates/bindgen`, `rust_backend/crates/cast`, `rust_backend/crates/network`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
X2 · Cancellation propagation · Not all functions that make a request accept a CancelToken · ×1
  • Not all functions that make a request accept a CancelToken — Only 0/1 functions that make a cancellable request (Dio, AbortableRequest) accept a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a screen navigated away from, a disposed widget, a superseded search. Take a `CancelToken? cancelToken` and hand it to the request as `cancelToken:` (or hold one and cancel it in `dispose`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure lib/services/link/client/link_client_store.dart:65 — `_read` answers `[]` when `FormatException` is thrown, with no log or rethrow — a malformed value silently becomes that default. Log the input or fail validation. 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.
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand rust_backend/crates/extensions/src/logging.rs:120 — `lowercase.contains("warning")` can never decide this `||` — every value satisfying `lowercase.contains("warning")` also satisfies `lowercase.contains("warn")`, 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.

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-e31d6b23607747a0a5a76945d3f73f23/history.json --exit-code 0 --source .1artifacts/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-e31d6b23607747a0a5a76945d3f73f23/tree.json --exit-code 0 --source .0artifacts/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 --exclude rust_backend/vendor --exclude third_party/audio_service .9artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .2artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
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 2 file(s) — `android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt`, `ios/Runner/LinkNowPlayingBridge.swift` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1cdc2-7612-7ac9-8139-beb04f7b8154 · 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