Public report of spotiflacapp/SpotiFLAC-Mobile, published 23 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog 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, 23 October 2026, 13:02 UTC · Survey ID cd_93d2a523ea054ccc9a965a33acc55f1b

spotiflacapp/SpotiFLAC-Mobile

Measured 23 October 2026, 12:47 UTC, at code version fb4945b

No regression since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 66out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 4 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: 273,224 lines of product code in 19 projects, tests not counted · Estimated rebuild effort: about 2.9 person-years · Weakest lens: Code Health, 61

Findings by how serious they are

13 critical 1619 serious 53 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
23 October 2026, 12:47 UTC

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

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

67of 71 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
1670of 1685 findings point to an exact file and line, so you can open each one in the code. The other 15 concern the repository as a whole, such as missing documentation.
71dimensions across 7 lenses, read from 273,224 lines of product code in 19 projects.
Chapters

Executive summary

spotiflacapp/SpotiFLAC-Mobile scores 66 out of 100 and is rated Adequate, while four of its seven lenses score higher still: Domain Modelling at 100, rated Exemplary, Architecture at 85 and Performance at 79, both rated Strong, and Security and Compliance at 76, rated Adequate.

The score is lower than those four because the weakest lens counts most, and here that is Code Health, which scores 61 and is rated Adequate. Its Cognitive Complexity dimension scores 2 out of 10, and until that reaches 4, Code Health can't be rated higher than Adequate. The first actions are to resolve the 1 No ADRs found finding(s) in ADR Quality and to thread a CancelToken through functions that make requests, so the work stops when its caller gives up. The weakest lenses score close to each other, so improving any of them moves the score.

13 findings are critical: six in Change Coupling, six in Static Analysis (SAST) and one in Secrets (history).

Watchdog couldn't measure 12 dimensions in this code, among them Code Coverage, Test Reliability and Dependency Hygiene, so they are left out of the score. The product code is 273,224 lines, which would take an estimated 2.9 person-years, around €420,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 61 · counts for 46%Maturity 64 · counts for 25%Production Readiness 65 · counts for 14%Security and Compliance 76 · counts for 8%Performance 79 · counts for 4%Architecture 85 · counts for 2%Domain Modelling 100 · counts for 1%

The weakest lenses score close to each other, so improving any of them moves the score.

Code composition: what the lines of code are
Product code 69%Tests 31%
New since the last survey: 591 findings

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

  • Cyclomatic Complexity · RustCoreBackendApplicationKt.dispatchApplication (cyclomatic 92) android/app/src/rust/kotlin/com/zarz/mornye/RustCoreBackendApplication.kt
  • Cyclomatic Complexity · MainActivity.configureFlutterEngine (cyclomatic 85) android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt
  • Cyclomatic Complexity · NetworkLibraryScanner._scan (cyclomatic 69) lib/services/network_library_scanner.dart
  • Cyclomatic Complexity · MainActivitySafScanKt.scanSafTree (cyclomatic 64) REDACTED
  • Cyclomatic Complexity · MainActivitySafScanKt.scanSafTreeIncremental (cyclomatic 52) REDACTED
  • Cyclomatic Complexity · NativeFinalizerMediaKt.embedBasicMetadata (cyclomatic 52) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt
  • Cyclomatic Complexity · SafFileInspectionKt.inspectSafFiles (cyclomatic 52) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt
  • Cyclomatic Complexity · mornye_core::media::hires::check_file (cyclomatic 47) rust_backend/crates/core/src/media/hires.rs
  • Cyclomatic Complexity · mornye_extensions::download::download (cyclomatic 47) rust_backend/crates/extensions/src/download.rs
  • Cyclomatic Complexity · AppDelegate.invokeOsMethod (cyclomatic 39) ios/Runner/AppDelegate.swift
  • Cyclomatic Complexity · _MiniPlayerBodyState.build (cyclomatic 36) lib/widgets/mini_player.dart
  • Cyclomatic Complexity · _RewindSlide._content (cyclomatic 35) lib/screens/listening_rewind_slides.dart
  • Cyclomatic Complexity · _AudioFacts._output (cyclomatic 35) lib/widgets/audio_info_sheet.dart
  • Cyclomatic Complexity · _TrackTableRowViewState.build (cyclomatic 34) lib/widgets/desktop/track_table.dart
  • Cyclomatic Complexity · NativeDownloadFinalizer.finalize (cyclomatic 33) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt
  • Cyclomatic Complexity · DownloadService.processConcurrentNativeRequest (cyclomatic 32) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt
  • Cyclomatic Complexity · _AccountForm.parse (cyclomatic 31) lib/controllers/extension_action_forms.dart
  • Cyclomatic Complexity · SafDownloadHandler.handleSafLocked (cyclomatic 30) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt
  • Cyclomatic Complexity · AudioMetadataMapper.convertToM4aTags (cyclomatic 26) lib/services/audio_metadata_mapper.dart
  • Cyclomatic Complexity · _TimedLyricSweepPainter.paint (cyclomatic 26) lib/widgets/player_lyrics_word_sweep.dart
  • Cyclomatic Complexity · _LibraryHeroCard.build (cyclomatic 25) lib/screens/settings/library_settings_page_widgets.dart
  • Cyclomatic Complexity · AudioplayersPlaybackDeck.resume (cyclomatic 25) lib/services/music_playback_deck.dart
  • Cyclomatic Complexity · TrackCard._buildCard (cyclomatic 25) lib/widgets/track_card.dart
  • Cyclomatic Complexity · _RenderPinnedSectionList.performLayout (cyclomatic 24) lib/widgets/pinned_section_sliver_list.dart
  • Cyclomatic Complexity · mornye_mobile::native_lyrics::lrc::parse_lrc (cyclomatic 24) rust_backend/crates/mobile/src/native_lyrics/lrc.rs
  • Cyclomatic Complexity · AutoMixPlan.create (cyclomatic 23) lib/services/automix_analysis.dart
  • Cyclomatic Complexity · NativeHistoryStore.buildPathMatchKeys (cyclomatic 23) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt
  • Cyclomatic Complexity · MprisPlayerObject.handleMethodCall (cyclomatic 22) lib/services/media_session_mpris.dart
  • Cyclomatic Complexity · MusicHapticsAnalyzer.analyze (cyclomatic 22) lib/services/music_haptics.dart
  • Cyclomatic Complexity · AlbumDetailHeader._buildAppBar (cyclomatic 22) lib/widgets/album_detail_header.dart
  • Cyclomatic Complexity · _ExpressivePlaybackTransportState.build (cyclomatic 22) lib/widgets/expressive_playback_transport.dart
  • Cyclomatic Complexity · PlayerWidgetProvider.render (cyclomatic 22) android/app/src/main/kotlin/com/zarz/mornye/PlayerWidgetProvider.kt
  • Cyclomatic Complexity · _CategoryRow.build (cyclomatic 21) lib/screens/settings/settings_tab.dart
  • Cyclomatic Complexity · _SetupScreenState._selectDirectory (cyclomatic 21) lib/screens/setup_screen.dart
  • Cyclomatic Complexity · AudioplayersPlaybackDeck.setFileSource (cyclomatic 21) lib/services/music_playback_deck.dart
  • Cyclomatic Complexity · _DesktopListScopeState._handleKey (cyclomatic 21) lib/widgets/desktop/desktop_selection.dart
  • Cyclomatic Complexity · DownloadQueueWidgetProvider.render (cyclomatic 21) android/app/src/main/kotlin/com/zarz/mornye/DownloadQueueWidgetProvider.kt
  • Cyclomatic Complexity · mornye_mobile::native_lyrics::ttml::parse_ttml (cyclomatic 21) rust_backend/crates/mobile/src/native_lyrics/ttml.rs
  • Cyclomatic Complexity · _LibrarySourceSettingsItem.build (cyclomatic 20) lib/screens/settings/library_settings_page_widgets.dart
  • Cyclomatic Complexity · _LogSummaryCard._analyzeLogs (cyclomatic 20) lib/screens/settings/log_screen_widgets.dart
  • Cyclomatic Complexity · _SettingsTabState._buildCategoryList (cyclomatic 20) lib/screens/settings/settings_tab.dart
  • Cyclomatic Complexity · AutoplayPreferenceModel.decode (cyclomatic 20) lib/services/autoplay_personalization.dart
  • Cyclomatic Complexity · MusicPlayerHandler.applySettings (cyclomatic 20) lib/services/music_player_service.dart
  • Cyclomatic Complexity · SubsonicClient.list (cyclomatic 20) lib/services/network_storage_subsonic.dart
  • Cyclomatic Complexity · PlatformBridge._ensureBackendEventHandler (cyclomatic 20) lib/services/platform_bridge.dart
  • Cyclomatic Complexity · _PlaybackSeekSliderState.build (cyclomatic 20) lib/widgets/playback_seek_slider.dart
  • Cyclomatic Complexity · DownloadServiceSnapshotKt.writeNativeWorkerSnapshot (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/DownloadServiceSnapshot.kt
  • Cyclomatic Complexity · SafTreeListingKt.querySafChildrenOrThrow (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt
  • Cyclomatic Complexity · UsbBitPerfectPlugin.onMethodCall (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/UsbBitPerfectPlugin.kt
  • Cyclomatic Complexity · UsbDirectPlayback.command (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/UsbDirectPlayback.kt
  • Cyclomatic Complexity · FilePath::open_native_read (cyclomatic 20) rust_backend/crates/extensions/src/files.rs
  • Cyclomatic Complexity · DownloadProgressSample.applyTo (cyclomatic 19) lib/providers/download_progress.dart
  • Cyclomatic Complexity · AudioAnalysisRunner._getMediaInfo (cyclomatic 19) lib/services/audio_analysis_runner.dart
  • Cyclomatic Complexity · _MusicAutoplay._fill (cyclomatic 19) lib/services/music_player_autoplay.dart
  • Cyclomatic Complexity · AppContentCard.build (cyclomatic 19) lib/widgets/app_content_card.dart
  • Cyclomatic Complexity · SettingsGroup.build (cyclomatic 19) lib/widgets/settings_group.dart
  • Cyclomatic Complexity · NativeFinalizerDecryptKt.finalizeDecryption (cyclomatic 19) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerDecrypt.kt
  • Cyclomatic Complexity · NativeFinalizerMetadataKt.refreshFinalAudioQualityMetadata (cyclomatic 19) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMetadata.kt
  • Cyclomatic Complexity · Vm::call (cyclomatic 19) rust_backend/crates/extensions/src/runtime/vm.rs
  • Cyclomatic Complexity · mornye_mobile::native_lyrics::credits::with_credits (cyclomatic 19) rust_backend/crates/mobile/src/native_lyrics/credits.rs
  • Cyclomatic Complexity · SettingsNotifier._runMigrations (cyclomatic 18) lib/providers/settings_provider.dart
  • Cyclomatic Complexity · AutoplayPreferenceModel._features (cyclomatic 18) lib/services/autoplay_personalization.dart
  • Cyclomatic Complexity · AutoplayPersonalization.finish (cyclomatic 18) lib/services/autoplay_personalization.dart
  • Cyclomatic Complexity · FolderPathTemplate.segments (cyclomatic 18) lib/services/folder_path_template.dart
  • Cyclomatic Complexity · HistorySchema.upgrade (cyclomatic 18) lib/services/history_schema.dart
  • Cyclomatic Complexity · ListeningRewind.compute (cyclomatic 18) lib/services/listening_rewind.dart
  • Cyclomatic Complexity · AudioplayersPlaybackDeck._syncEqualizer (cyclomatic 18) lib/services/music_playback_deck.dart
  • Cyclomatic Complexity · NetworkStorageService.list (cyclomatic 18) lib/services/network_storage_service.dart
  • Cyclomatic Complexity · PlayableMedia.toMediaItem (cyclomatic 18) lib/services/playable_media.dart
  • Cyclomatic Complexity · UpdateChecker.checkForUpdate (cyclomatic 18) lib/services/update_checker.dart
  • Cyclomatic Complexity · AppSheetOption.build (cyclomatic 18) lib/widgets/app_bottom_sheet.dart
  • Cyclomatic Complexity · _AudioFacts._source (cyclomatic 18) lib/widgets/audio_info_sheet.dart
  • Cyclomatic Complexity · _AudioFacts._processing (cyclomatic 18) lib/widgets/audio_info_sheet.dart
  • Cyclomatic Complexity · DownloadService.buildNotification (cyclomatic 18) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt
  • Cyclomatic Complexity · WavSource::open (cyclomatic 18) rust_backend/crates/core/src/media/hires.rs
  • Cyclomatic Complexity · _ConcertDetailScreenState._materialPage (cyclomatic 17) lib/screens/concert_detail_screen.dart
  • Cyclomatic Complexity · _SettingItemState._invokeAction (cyclomatic 17) lib/screens/settings/extension_detail_page_widgets.dart
  • Cyclomatic Complexity · _LibrarySettingsPageState._pickLibraryFolder (cyclomatic 17) lib/screens/settings/library_settings_page.dart
  • Cyclomatic Complexity · _ScanProgressTile.build (cyclomatic 17) lib/screens/settings/library_settings_page_widgets.dart
  • Cyclomatic Complexity · _SettingsTabState._buildList (cyclomatic 17) lib/screens/settings/settings_tab.dart
  • Cyclomatic Complexity · _SetupScreenState._requestStoragePermission (cyclomatic 17) lib/screens/setup_screen.dart
  • Cyclomatic Complexity · DesktopUpdater.download (cyclomatic 17) lib/services/desktop_updater.dart
  • Cyclomatic Complexity · DownloadQueuePersistence._enqueue (cyclomatic 17) lib/services/download_queue_persistence.dart
  • Cyclomatic Complexity · LocalNetworkAccess._isLocalAddress (cyclomatic 17) lib/services/local_network_access.dart
  • Cyclomatic Complexity · PlayableMedia.toJson (cyclomatic 17) lib/services/playable_media.dart
  • Cyclomatic Complexity · LogBuffer.exportWithDeviceInfo (cyclomatic 17) lib/utils/logger.dart
  • Cyclomatic Complexity · AppIconButton.build (cyclomatic 17) lib/widgets/app_icon_button.dart
  • Cyclomatic Complexity · DesktopSidebar.build (cyclomatic 17) lib/widgets/desktop/desktop_navigation.dart
  • Cyclomatic Complexity · _MornyeArtistSurfaceState.build (cyclomatic 17) lib/widgets/mornye_artist_header.dart
  • Cyclomatic Complexity · DownloadService.onStartCommand (cyclomatic 17) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt
  • Cyclomatic Complexity · mornye_core::lyrics::payloads::format_apple_payload (cyclomatic 17) rust_backend/crates/core/src/lyrics/payloads.rs
  • Cyclomatic Complexity · ExtensionNotifier.initialize (cyclomatic 16) lib/providers/extension_provider.dart
  • Cyclomatic Complexity · _DownloadedAlbumScreenState._buildAppBar (cyclomatic 16) lib/screens/downloaded_album_screen.dart
  • Cyclomatic Complexity · AutoMixAnalyzer.analyzeTransition (cyclomatic 16) lib/services/automix_analyzer.dart
  • Cyclomatic Complexity · AutoMixEffectRenderer.render (cyclomatic 16) lib/services/automix_effect_renderer.dart
  • Cyclomatic Complexity · MusicPlayerHandler._refreshPlaybackAutomation (cyclomatic 16) lib/services/music_player_service.dart
  • Cyclomatic Complexity · LyricTimelineIndex.activeIndices (cyclomatic 16) lib/utils/lyrics_timeline.dart
  • Cyclomatic Complexity · _AppCrashBannerState.build (cyclomatic 16) lib/widgets/app_crash_banner.dart
  • Cyclomatic Complexity · LibraryTrackSelectionBar.build (cyclomatic 16) lib/widgets/library_track_selection_bar.dart
  • Cyclomatic Complexity · MornyeLevelSlider.build (cyclomatic 16) lib/widgets/mornye_level_slider.dart

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

Fixed since the last survey: 679 findings

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

  • Cyclomatic Complexity · MainActivity.configureFlutterEngine (cyclomatic 178) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivity.kt
  • Cyclomatic Complexity · RustCoreBackend.invokeApplication (cyclomatic 96) android/app/src/rust/kotlin/com/zarz/spotiflac/SelectedCoreBackend.kt
  • Cyclomatic Complexity · LocalLibraryNotifier._runScan (cyclomatic 92) lib/providers/local_library_provider.dart
  • Cyclomatic Complexity · MainActivitySafScanKt.scanSafTree (cyclomatic 65) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cyclomatic Complexity · MainActivitySafScanKt.inspectSafFiles (cyclomatic 52) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cyclomatic Complexity · MainActivitySafScanKt.scanSafTreeIncremental (cyclomatic 52) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cyclomatic Complexity · NativeFinalizerMediaKt.embedBasicMetadata (cyclomatic 51) android/app/src/main/kotlin/com/zarz/spotiflac/NativeFinalizerMedia.kt
  • Cyclomatic Complexity · _EditMetadataSheetState._fetchAutoFillPreview (cyclomatic 48) lib/screens/track_metadata_edit_sheet.dart
  • Cyclomatic Complexity · spotiflac_core::media::hires::check_file (cyclomatic 47) rust_backend/crates/core/src/media/hires/mod.rs
  • Cyclomatic Complexity · spotiflac_extensions::download::download (cyclomatic 47) rust_backend/crates/extensions/src/download/mod.rs
  • Cyclomatic Complexity · AppDelegate.invokeGoMethod (cyclomatic 40) ios/Runner/AppDelegate.swift
  • Cyclomatic Complexity · NetworkLibraryScanner.scan (cyclomatic 38) lib/services/network_library_scanner.dart
  • Cyclomatic Complexity · _MiniPlayerState.build (cyclomatic 35) lib/widgets/mini_player.dart
  • Cyclomatic Complexity · SafDownloadHandler.handleSafLocked (cyclomatic 35) android/app/src/main/kotlin/com/zarz/spotiflac/SafDownloadHandler.kt
  • Cyclomatic Complexity · _ArtistScreenState._fetchAndQueueAlbums (cyclomatic 34) lib/screens/artist_screen.dart
  • Cyclomatic Complexity · DownloadService.processConcurrentNativeRequest (cyclomatic 32) android/app/src/main/kotlin/com/zarz/spotiflac/DownloadService.kt
  • Cyclomatic Complexity · _AccountForm.parse (cyclomatic 31) lib/utils/extension_action_forms.dart
  • Cyclomatic Complexity · NativeDownloadFinalizer.finalize (cyclomatic 29) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cyclomatic Complexity · UsbPcmPlayback.prepare (cyclomatic 27) android/app/src/main/kotlin/com/zarz/spotiflac/UsbBitPerfectPlugin.kt
  • Cyclomatic Complexity · _LibraryHeroCard.build (cyclomatic 25) lib/screens/settings/library_settings_page.dart
  • Cyclomatic Complexity · MusicPlaybackDeck.resume (cyclomatic 24) lib/services/music_playback_deck.dart
  • Cyclomatic Complexity · spotiflac_mobile::native_lyrics::parse_lrc (cyclomatic 24) rust_backend/crates/mobile/src/native_lyrics.rs
  • Cyclomatic Complexity · _EditMetadataSheetState._resolveImageExtension (cyclomatic 23) lib/screens/track_metadata_edit_sheet.dart
  • Cyclomatic Complexity · NativeHistoryStore.buildPathMatchKeys (cyclomatic 23) android/app/src/main/kotlin/com/zarz/spotiflac/NativeHistoryStore.kt
  • Cyclomatic Complexity · DeezerClient::search_all (cyclomatic 23) rust_backend/crates/providers/src/deezer/search.rs
  • Cyclomatic Complexity · _EditMetadataSheetState._applyAutoFillPreview (cyclomatic 22) lib/screens/track_metadata_edit_sheet.dart
  • Cyclomatic Complexity · MusicPlaybackDeck.setSource (cyclomatic 21) lib/services/music_playback_deck.dart
  • Cyclomatic Complexity · spotiflac_mobile::native_lyrics::parse_ttml (cyclomatic 21) rust_backend/crates/mobile/src/native_lyrics.rs
  • Cyclomatic Complexity · _LogSummaryCard._analyzeLogs (cyclomatic 20) lib/screens/settings/log_screen.dart
  • Cyclomatic Complexity · _EditMetadataSheetState._buildAutoFillSection (cyclomatic 20) lib/screens/track_metadata_edit_sheet.dart
  • Cyclomatic Complexity · DownloadServiceSnapshotKt.writeNativeWorkerSnapshot (cyclomatic 20) android/app/src/main/kotlin/com/zarz/spotiflac/DownloadServiceSnapshot.kt
  • Cyclomatic Complexity · MainActivitySafScanKt.querySafChildrenOrThrow (cyclomatic 20) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cyclomatic Complexity · UsbBitPerfectPlugin.onMethodCall (cyclomatic 20) android/app/src/main/kotlin/com/zarz/spotiflac/UsbBitPerfectPlugin.kt
  • Cyclomatic Complexity · UsbDirectPlayback.command (cyclomatic 20) android/app/src/main/kotlin/com/zarz/spotiflac/UsbDirectPlayback.kt
  • Cyclomatic Complexity · DownloadProgressSample.applyTo (cyclomatic 19) lib/services/download_progress.dart
  • Cyclomatic Complexity · _AudioAnalysisCardState._getMediaInfo (cyclomatic 19) lib/widgets/audio_analysis_widget.dart
  • Cyclomatic Complexity · MornyeContextMenu.build (cyclomatic 19) lib/widgets/mornye_context_menu.dart
  • Cyclomatic Complexity · NativeDownloadFinalizer.finalizeDecryption (cyclomatic 19) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cyclomatic Complexity · NativeDownloadFinalizer.refreshFinalAudioQualityMetadata (cyclomatic 19) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cyclomatic Complexity · Vm::call (cyclomatic 19) rust_backend/crates/extensions/src/runtime.rs
  • Cyclomatic Complexity · spotiflac_mobile::native_lyrics::with_credits (cyclomatic 19) rust_backend/crates/mobile/src/native_lyrics.rs
  • Cyclomatic Complexity · LibraryCollectionsNotifier.restoreFromBackup (cyclomatic 18) lib/providers/library_collections_provider.dart
  • Cyclomatic Complexity · LocalLibraryNotifier._checkSourceAvailability (cyclomatic 18) lib/providers/local_library_provider.dart
  • Cyclomatic Complexity · _MainShellState._repairSafAccessIfNeeded (cyclomatic 18) lib/screens/main_shell.dart
  • Cyclomatic Complexity · _SettingsTabState.build (cyclomatic 18) lib/screens/settings/settings_tab.dart
  • Cyclomatic Complexity · _EditMetadataSheetState._buildCoverEditor (cyclomatic 18) lib/screens/track_metadata_edit_sheet.dart
  • Cyclomatic Complexity · HistoryDatabase._upgradeDB (cyclomatic 18) lib/services/history_database.dart
  • Cyclomatic Complexity · PlayableMedia.toMediaItem (cyclomatic 18) lib/services/music_player_service.dart
  • Cyclomatic Complexity · _TimedLyricSweepPainter.paint (cyclomatic 18) lib/widgets/player_lyrics.dart
  • Cyclomatic Complexity · DownloadService.buildNotification (cyclomatic 18) android/app/src/main/kotlin/com/zarz/spotiflac/DownloadService.kt
  • Cyclomatic Complexity · PlayerWidgetProvider.update (cyclomatic 18) android/app/src/main/kotlin/com/zarz/spotiflac/PlayerWidgetProvider.kt
  • Cyclomatic Complexity · WavSource::open (cyclomatic 18) rust_backend/crates/core/src/media/hires/mod.rs
  • Cyclomatic Complexity · _SettingItemState._invokeAction (cyclomatic 17) lib/screens/settings/extension_detail_page.dart
  • Cyclomatic Complexity · _LibrarySourceSettingsItem.build (cyclomatic 17) lib/screens/settings/library_settings_page.dart
  • Cyclomatic Complexity · _ScanProgressTile.build (cyclomatic 17) lib/screens/settings/library_settings_page.dart
  • Cyclomatic Complexity · PlayableMedia.toJson (cyclomatic 17) lib/services/music_player_service.dart
  • Cyclomatic Complexity · DownloadService.onStartCommand (cyclomatic 17) android/app/src/main/kotlin/com/zarz/spotiflac/DownloadService.kt
  • Cyclomatic Complexity · LocalLibraryNotifier._replaceFromFullScanStream (cyclomatic 16) lib/providers/local_library_provider.dart
  • Cyclomatic Complexity · MornyeTheme._build (cyclomatic 16) lib/theme/mornye_theme.dart
  • Cyclomatic Complexity · NativeDownloadFinalizer.writeAlbumReplayGain (cyclomatic 16) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cyclomatic Complexity · NativeDownloadFinalizer.finalizeContainerConversion (cyclomatic 16) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cyclomatic Complexity · spotiflac_core::tags::containers::flac_inner (cyclomatic 16) rust_backend/crates/core/src/tags/containers.rs
  • Cyclomatic Complexity · spotiflac_extensions::runtime::run_worker (cyclomatic 16) rust_backend/crates/extensions/src/runtime.rs
  • Cognitive Complexity · MainActivity.configureFlutterEngine (cognitive 243) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivity.kt
  • Cognitive Complexity · LocalLibraryNotifier._runScan (cognitive 221) lib/providers/local_library_provider.dart
  • Cognitive Complexity · MainActivitySafScanKt.inspectSafFiles (cognitive 131) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cognitive Complexity · MainActivitySafScanKt.scanSafTree (cognitive 119) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cognitive Complexity · NetworkLibraryScanner.scan (cognitive 114) lib/services/network_library_scanner.dart
  • Cognitive Complexity · MainActivitySafScanKt.scanSafTreeIncremental (cognitive 113) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cognitive Complexity · spotiflac_extensions::download::download (cognitive 91) rust_backend/crates/extensions/src/download/mod.rs
  • Cognitive Complexity · _EditMetadataSheetState._fetchAutoFillPreview (cognitive 85) lib/screens/track_metadata_edit_sheet.dart
  • Cognitive Complexity · NativeFinalizerMediaKt.embedBasicMetadata (cognitive 82) android/app/src/main/kotlin/com/zarz/spotiflac/NativeFinalizerMedia.kt
  • Cognitive Complexity · SafDownloadHandler.handleSafLocked (cognitive 74) android/app/src/main/kotlin/com/zarz/spotiflac/SafDownloadHandler.kt
  • Cognitive Complexity · DownloadService.processConcurrentNativeRequest (cognitive 65) android/app/src/main/kotlin/com/zarz/spotiflac/DownloadService.kt
  • Cognitive Complexity · spotiflac_core::media::hires::check_file (cognitive 58) rust_backend/crates/core/src/media/hires/mod.rs
  • Cognitive Complexity · RustCoreBackend.invokeApplication (cognitive 51) android/app/src/rust/kotlin/com/zarz/spotiflac/SelectedCoreBackend.kt
  • Cognitive Complexity · DsdFile.readFrames (cognitive 50) android/app/src/main/kotlin/com/zarz/spotiflac/DsdFile.kt
  • Cognitive Complexity · spotiflac_mobile::native_lyrics::parse_lrc (cognitive 50) rust_backend/crates/mobile/src/native_lyrics.rs
  • Cognitive Complexity · NativeDownloadFinalizer.finalize (cognitive 45) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cognitive Complexity · _ArtistScreenState._fetchAndQueueAlbums (cognitive 44) lib/screens/artist_screen.dart
  • Cognitive Complexity · _EditMetadataSheetState._applyAutoFillPreview (cognitive 44) lib/screens/track_metadata_edit_sheet.dart
  • Cognitive Complexity · MusicPlaybackDeck.setSource (cognitive 43) lib/services/music_playback_deck.dart
  • Cognitive Complexity · spotiflac_mobile::native_lyrics::parse_ttml (cognitive 43) rust_backend/crates/mobile/src/native_lyrics.rs
  • Cognitive Complexity · UsbPcmPlayback.prepare (cognitive 42) android/app/src/main/kotlin/com/zarz/spotiflac/UsbBitPerfectPlugin.kt
  • Cognitive Complexity · _SettingItemState._invokeAction (cognitive 38) lib/screens/settings/extension_detail_page.dart
  • Cognitive Complexity · _SettingsTabState.build (cognitive 37) lib/screens/settings/settings_tab.dart
  • Cognitive Complexity · _EditMetadataSheetState._buildAutoFillSection (cognitive 37) lib/screens/track_metadata_edit_sheet.dart
  • Cognitive Complexity · _MiniPlayerState.build (cognitive 37) lib/widgets/mini_player.dart
  • Cognitive Complexity · MainActivitySafScanKt.querySafChildrenOrThrow (cognitive 37) android/app/src/main/kotlin/com/zarz/spotiflac/MainActivitySafScan.kt
  • Cognitive Complexity · PlayerWidgetProvider.update (cognitive 37) android/app/src/main/kotlin/com/zarz/spotiflac/PlayerWidgetProvider.kt
  • Cognitive Complexity · LogBuffer._fetchGoLogs (cognitive 36) lib/utils/logger.dart
  • Cognitive Complexity · NativeDownloadFinalizer.writeAlbumReplayGain (cognitive 36) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cognitive Complexity · _AccountForm.parse (cognitive 35) lib/utils/extension_action_forms.dart
  • Cognitive Complexity · spotiflac_mobile::native_lyrics::xml_source (cognitive 35) rust_backend/crates/mobile/src/native_lyrics.rs
  • Cognitive Complexity · _MainShellState._repairSafAccessIfNeeded (cognitive 34) lib/screens/main_shell.dart
  • Cognitive Complexity · LocalLibraryNotifier._checkSourceAvailability (cognitive 33) lib/providers/local_library_provider.dart
  • Cognitive Complexity · _LibraryHeroCard.build (cognitive 33) lib/screens/settings/library_settings_page.dart
  • Cognitive Complexity · NativeDownloadFinalizer.finalizeDecryption (cognitive 33) android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt
  • Cognitive Complexity · LocalLibraryNotifier._backfillLegacyFileModTimes (cognitive 32) lib/providers/local_library_provider.dart
  • Cognitive Complexity · Vm::call (cognitive 32) rust_backend/crates/extensions/src/runtime.rs
Rebuild cost: about €420,000 · Estimate
Cost to rebuild€140,000 to €710,000, for 2,351 to 7,457 hours of work, about 2.9 person-years for 1 to 6 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: 273,224 lines of product code

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

Top priorities

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

1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 3 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 3 points · Medium effort · Cancellation propagation
3
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.
Raises the score by about 2 points · Medium effort · Architecture documentation

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 €420,000 to build again, about 2.9 person-years of work. Its weakest lens is Code Health, at 61 (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 3 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.2 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 582,419 lines over the last 90 days, which is about 2,362,033 lines a year. At that pace, the extra work comes to an estimated 261.1 to 1566.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; 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 — a layering smell or cycle. A clean layered graph 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-bindgen mornye-bindgen mornye-core mornye-core mornye-desktop mornye-desktop mornye-mobile mornye-mobile mornye-desktop->mornye-mobile mornye-extensions mornye-extensions mornye-extensions->mornye-core mornye-network mornye-network mornye-extensions->mornye-network mornye-providers mornye-providers mornye-extensions->mornye-providers mornye-mobile->mornye-core mornye-mobile->mornye-extensions mornye-mobile->mornye-network mornye-providers->mornye-core mornye-providers->mornye-network mornye_audio mornye_audio mornye_flac mornye_flac mornye_audio->mornye_flac

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.

681 modules, with 1106 dependencies between them. 16 loops run through 78 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 641 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.file_type2 cap_primitives.fs.follow_symlinks3 cap_primitives.fs.permissions4 cap_primitives.time.instant5 com.zarz.mornye6 mornye_core.app_version7 mornye_core.json8 rustix.backend.libc.fs.types9 rustix.clockid10 rustix.maybe_polyfill.no_std.os.fd.owned11 rustix.pid12 rustix.timespec13 rustix.ugid14 cap_primitives.fs.open_options15 mornye_core.cancellation16 mornye_providers.deezer.cache17 mornye_providers.lyrics.service18 rustix.net.types19 mornye_core.downloads20 mornye_desktop.runtime21 mornye_extensions.auth22 mornye_extensions.files23 mornye_extensions.manifest24 rustix.net.socket_addr_any25 mornye_core.resolver26 mornye_network.client27 mornye_extensions.backend.cover28 rustix.backend.linux_raw.reg29 mornye_providers.musicbrainz30 mornye_providers.resolver.service31 mornye_providers.resolver.availability.cache32 mornye_extensions.backend33 mornye_extensions.runtime.control34 rustix.backend.libc.thread.syscalls35 rustix.backend.linux_raw.thread.syscalls36 mornye_extensions.runtime37 mornye_extensions.environment38 mornye_extensions.manager39 mornye_desktop.backend40 mornye_desktop.dispatch
1 cap_primitives.fs.file_type
2 cap_primitives.fs.follow_symlinks
3 cap_primitives.fs.permissions
4 cap_primitives.time.instant
5 com.zarz.mornye
6 mornye_core.app_version
7 mornye_core.json
8 rustix.backend.libc.fs.types
9 rustix.clockid
10 rustix.maybe_polyfill.no_std.os.fd.owned
11 rustix.pid
12 rustix.timespec
13 rustix.ugid
14 cap_primitives.fs.open_options1
15 mornye_core.cancellation2
16 mornye_providers.deezer.cache21
17 mornye_providers.lyrics.service1
18 rustix.net.types12
19 mornye_core.downloads11
20 mornye_desktop.runtime11
21 mornye_extensions.auth11
22 mornye_extensions.files1
23 mornye_extensions.manifest21
24 rustix.net.socket_addr_any1
25 mornye_core.resolver131
26 mornye_network.client1
27 mornye_extensions.backend.cover11112
28 rustix.backend.linux_raw.reg9111241
29 mornye_providers.musicbrainz2111
30 mornye_providers.resolver.service11111
31 mornye_providers.resolver.availability.cache1111
32 mornye_extensions.backend1111111111111
33 mornye_extensions.runtime.control1
34 rustix.backend.libc.thread.syscalls111121
35 rustix.backend.linux_raw.thread.syscalls111121
36 mornye_extensions.runtime113211211
37 mornye_extensions.environment21211111113
38 mornye_extensions.manager111142
39 mornye_desktop.backend314
40 mornye_desktop.dispatch1121
Uses a module listed above itPart of a loopThe module itself
1 cap_primitives.fs.file_type2 cap_primitives.fs.follow_symlinks3 cap_primitives.fs.permissions4 cap_primitives.time.instant5 com.zarz.mornye6 mornye_core.app_version7 mornye_core.json8 rustix.backend.libc.fs.types9 rustix.clockid10 rustix.maybe_polyfill.no_std.os.fd.owned11 rustix.pid12 rustix.timespec13 rustix.ugid14 cap_primitives.fs.open_options15 mornye_core.cancellation16 mornye_providers.deezer.cache17 mornye_providers.lyrics.service18 rustix.net.types19 mornye_core.downloads20 mornye_desktop.runtime21 mornye_extensions.auth22 mornye_extensions.files23 mornye_extensions.manifest24 rustix.net.socket_addr_any25 mornye_core.resolver26 mornye_network.client27 mornye_extensions.backend.cover28 rustix.backend.linux_raw.reg29 mornye_providers.musicbrainz30 mornye_providers.resolver.service31 mornye_providers.resolver.availability.cache32 mornye_extensions.backend33 mornye_extensions.runtime.control34 rustix.backend.libc.thread.syscalls35 rustix.backend.linux_raw.thread.syscalls36 mornye_extensions.runtime37 mornye_extensions.environment38 mornye_extensions.manager39 mornye_desktop.backend40 mornye_desktop.dispatchcap_primitives.fs.file_type1cap_primitives.fs.follow_symlinks2cap_primitives.fs.permissions3cap_primitives.time.instant4com.zarz.mornye5mornye_core.app_version6mornye_core.json7rustix.backend.libc.fs.types8rustix.clockid9rustix.maybe_polyfill.no_std.os.fd.owned10rustix.pid11rustix.timespec12rustix.ugid13cap_primitives.fs.open_options14mornye_core.cancellation15mornye_providers.deezer.cache16mornye_providers.lyrics.service17rustix.net.types18mornye_core.downloads19mornye_desktop.runtime20mornye_extensions.auth21mornye_extensions.files22mornye_extensions.manifest23rustix.net.socket_addr_any24mornye_core.resolver25mornye_network.client26mornye_extensions.backend.cover27rustix.backend.linux_raw.reg28mornye_providers.musicbrainz29mornye_providers.resolver.service30mornye_providers.resolver.availability.cache31mornye_extensions.backend32mornye_extensions.runtime.control33rustix.backend.libc.thread.syscalls34rustix.backend.linux_raw.thread.syscalls35mornye_extensions.runtime36mornye_extensions.environment37mornye_extensions.manager38mornye_desktop.backend39mornye_desktop.dispatch40122111211111112111311111129111241211111111111111111111111111111121111121113211211212111111131111423141121+641 more modules (most-connected shown)

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

At a glance — Architecture · 85% · Strong ·

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

At a glance — Readiness · 65% · Adequate ·

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

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

At a glance — Performance · 79% · 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 Failures9Medium
A07:2025 — Authentication Failures2High / Critical

Roadmap

First, implement cancellation propagation by threading CancelTokens through request functions to ensure work stops when callers give up. Next, address the 284 swallowed exceptions and resolve the single missing Architecture Decision Record to improve code reliability and documentation. Finally, reduce cognitive complexity by refactoring the 43 most complex functions, starting with the highest-scoring bodies, to make the codebase easier to understand and maintain.

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.+2.6 ptsLowADR Quality
Thread a CancelToken through functions that make requests, so the work stops when its caller gives up.+2.6 ptsMediumCancellation propagation
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.+2.3 ptsMediumArchitecture documentation
Swallowed exception (caught, then discarded)+2.2 ptsMediumException handling
Bring the 43 bodies over 60 down to 60 or less in Cognitive Complexity — start with _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cognitive 278), NetworkLibraryScanner._scan (cognitive 224), _MusicAutoMix._start (cognitive 165).+1.6 ptsHighCognitive Complexity
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+1.4 ptsMediumDR & Backup
Resolve the 126 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.3 ptsHighGod Classes
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+1.3 ptsMediumDocumentation (README)

File quality

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

FileScoreBandWorst signal
lib/providers/download_queue_provider.dart2.5SlopChange Coupling: Boundary-crossing change coupling: download_queue_provider.dart ↔ csv_import_service.dart
lib/screens/downloaded_album_screen.dart3.5SlopChange Coupling: Boundary-crossing change coupling: downloaded_album_screen.dart ↔ batch_convert_sheet.dart
lib/screens/queue_tab.dart3.6SlopChange Coupling: Boundary-crossing change coupling: queue_tab.dart ↔ batch_convert_sheet.dart
lib/providers/download_queue_state.dart4.8MixedCyclomatic Complexity: DownloadQueueLookup.withoutIndex (cyclomatic 20)
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
lib/screens/local_album_screen.dart5.2MixedChange Coupling: Boundary-crossing change coupling: local_album_screen.dart ↔ batch_convert_sheet.dart
lib/screens/home_tab.dart5.5MixedCyclomatic Complexity: _HomeTabState.build (cyclomatic 101)
lib/widgets/player_lyrics.dart5.5MixedCyclomatic Complexity: _SyncedLyricsViewState._buildLyrics (cyclomatic 82)
lib/screens/settings/library_settings_page.dart5.5MixedCyclomatic Complexity: _LibrarySettingsPageState.build (cyclomatic 37)
lib/screens/album_screen.dart5.5MixedCyclomatic Complexity: _AlbumScreenState._buildAppBar (cyclomatic 30)
lib/services/library_collections_database.dart5.5MixedCyclomatic Complexity: LibraryCollectionsDatabase.replaceDatabaseFromBackup (cyclomatic 19)
lib/services/backup_service.dart5.5MixedCyclomatic Complexity: BackupService._parseArchive (cyclomatic 35)
lib/providers/extension_provider.dart5.5MixedCyclomatic Complexity: ExtensionNotifier.restoreFromBackup (cyclomatic 18)
lib/providers/track_provider.dart5.5MixedCyclomatic Complexity: TrackNotifier.fetchFromUrl (cyclomatic 38)
lib/services/history_database.dart5.5MixedCognitive Complexity: HistoryDatabase.findExistingTracks (cognitive 23)
lib/services/app_state_database.dart5.6MixedCyclomatic Complexity: AppStateDatabase.migrateRecentAccessFromSharedPreferences (cyclomatic 19)
lib/models/settings.dart5.6MixedGod Classes: MethodTooLong: AppSettings.copyWith
lib/screens/track_metadata_screen.dart5.6MixedCyclomatic Complexity: _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cyclomatic 154)
lib/screens/mornye_library_screen.dart5.6MixedCyclomatic Complexity: _MornyeLibraryScreenState.build (cyclomatic 28)

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

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

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

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

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 67 of 71 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 71 dimensions across the health lenses
D1D2D3D4D5D6D9D13D14D15D19D20D21D22D26D28D29D30D34D35D36D43D44AX1AX10AX3AX5AX6AX8AX9DM4DM5GD1IC1M1M2M3M4P1P10P2P3P4P5P6PF1PF2PF3X1X12X13X14X15X16X17X18X19X2X20X21X22X23X24X25X26X27X28X29X3X30X5

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, 1670 of 1685 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

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

Every finding is locatable in findings.md. Run 01a168cd-4fbd-7ca9-8af1-854075af7a07.

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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.kt, .dart, .rs) 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 (JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or 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`) 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 (JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or 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`) 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.kt, .dart, .rs) 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 6 Maven/Gradle manifest(s) were read, stating a version for 19 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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/core/src/lyrics/payloads.rs, rust_backend/crates/extensions/src/manifest.rs, rust_backend/crates/core/src/downloads.rs, rust_backend/crates/core/src/lyrics/lrclib.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 (12 contributor(s) across 3528 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 11 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.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt` 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.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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. Watchdog then boots 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These 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.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 244 further occurrence(s) are not listed individually; the score already reflects all 284.

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

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

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

Dimensions

D1 · Cyclomatic 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

331 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile at 154. A further 19 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. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: rust_backend/crates/core/src/downloads.rs (DownloadRequest::update at 108), rust_backend/crates/core/src/metadata/deezer/catalog.rs (FullAlbum::update at 32), rust_backend/crates/core/src/metadata/deezer.rs (Track::update at 28), lib/screens/track_metadata_edit_sheet.dart (_EditMetadataSheetState._fieldLabel at 22), android/app/src/main/kotlin/com/zarz/mornye/AudioRouteInfo.kt (AudioRouteInfo.typeName at 21), and 5 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

mornye_core::tags::write::id3::read_frames (cyclomatic 58) · ×34rust_backend/crates/core/src/tags/write/id3.rs:211
mornye_extensions::download::chunked::download (cyclomatic 51) · ×11rust_backend/crates/extensions/src/download/chunked.rs:14
mornye_mobile::usb_audio::descriptors::parse (cyclomatic 40) · ×11rust_backend/crates/mobile/src/usb_audio/descriptors.rs:49
Backend::plan_download (cyclomatic 49) · ×6rust_backend/crates/extensions/src/backend/downloads.rs:168
(anonymous)::filenameMetadata::visit (cyclomatic 36) · ×4rust_backend/crates/extensions/src/prelude.js:566

+ 259 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.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

577 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:211
mornye_extensions::download::chunked::download (cognitive 96) · ×25rust_backend/crates/extensions/src/download/chunked.rs:14
mornye_mobile::usb_audio::descriptors::parse (cognitive 74) · ×21rust_backend/crates/mobile/src/usb_audio/descriptors.rs:49
Backend::plan_download (cognitive 86) · ×15rust_backend/crates/extensions/src/backend/downloads.rs:168
ExtensionManager::provider_operation_value (cognitive 76) · ×4rust_backend/crates/extensions/src/manager/providers.rs:206

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

What to do

  1. Bring the 43 bodies over 60 down to 60 or less in Cognitive Complexity — start with _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cognitive 278), NetworkLibraryScanner._scan (cognitive 224), _MusicAutoMix._start (cognitive 165). — 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 43 together lifts Cognitive Complexity from 2.0 to about 3.8/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God 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

317 god class(es) detected.

MethodTooLong: _QueueTabState.build · ×126lib/screens/queue_tab.dart:491
FileTooLong: services/platform_bridge.dart · ×88lib/services/platform_bridge.dart
ClassTooLong: PlatformBridge · ×54lib/services/platform_bridge.dart:69
TooManyMethods: PlatformBridge · ×26lib/services/platform_bridge.dart:69
FunctionTooLong: mornye_extensions::download::chunked::download · ×22rust_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 126 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 (126 warning-level).
  2. Resolve the 88 FileTooLong 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 (88 warning-level).
  3. Resolve the 54 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 (54 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

146 duplicated block group(s) detected. A further 5 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (10 lines × 2) · ×16lib/providers/track_provider.dart:412
Duplicated block (7 lines × 2) · ×16lib/models/extension.dart:266
Duplicated block (8 lines × 2) · ×13lib/models/settings.dart:491
Duplicated block (6 lines × 2) · ×10lib/models/extension.dart:123
Duplicated block (5 lines × 2) · ×10lib/models/extension.dart:719

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

What to do

  1. Resolve the 16 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), track_provider.dart, album_screen.dart. — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 16 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with extension.dart, album_screen.dart, artist_screen.dart. — One of this dimension's main actionable groups (16 warning-level).
  3. Resolve the 13 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with settings.dart, download_history_provider.dart, main_shell.dart. — One of this dimension's main actionable groups (13 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling9.2 / 10Stronggated by 2 serious findings✓ 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 9.2 / 10 · rule-coverage 100% · ceiling Prevented

19 production modules (Gradle+Cargo+SwiftPM+pub+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 2 module(s) off the main sequence, with abstractness counted on 8 of the 19 (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

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. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

29 of 478 classes have LCOM4 above 3.

Low cohesion: LibraryCollectionsDatabase (LCOM4 24) · ×29lib/services/library_collections_database.dart:69

What to do

  1. Resolve the 29 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 (29 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

537 test methods: 490 unit, 47 integration, 0 BDD, 0 e2e. The Rust suite contributes 479 `#[test]` function(s) across 123 file(s) declaring at least one; its unit/integration split is Cargo's own — 11 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 40 test function(s) across 4 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.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 207 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 18 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.2 / 10Stronggated by 149 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.2 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: lib/screens/now_playing_screen.dart (90×84=7560); android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt (79×85=6715); lib/screens/home_tab.dart (58×101=5858) Repeated repair below the complexity floor: lib/providers/download_queue_provider_native_worker.dart (19 of 36 changes were fixes); lib/screens/home_tab_explore.dart (11 of 20 changes were fixes); lib/widgets/audio_quality_badges.dart (5 of 8 changes were fixes)

Hotspot: lib/screens/now_playing_screen.dart · ×142lib/screens/now_playing_screen.dart:253
Repeated repair: lib/providers/download_queue_provider_native_worker.dart · ×7lib/providers/download_queue_provider_native_worker.dart:29

What to do

  1. Resolve the 142 Hotspot finding(s) in Churn × Complexity Hotspots — start with downloads.rs (2), now_playing_screen.dart, MainActivity.kt. — One of this dimension's main actionable groups (142 warning-level).
  2. Resolve the 7 Repeated repair finding(s) in Churn × Complexity Hotspots — start with download_queue_provider_native_worker.dart, home_tab_explore.dart, audio_quality_badges.dart. — One of this dimension's main actionable groups (7 warning-level).

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

D19 · Documentation QualityExemplary◐ Sampled · advisory

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

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

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

The repository's READMEs are strong for their directories: the third_party/mornye_discord/README is a focused Android/iOS bridge to Discord's Social SDK with build setup, security rationale, and staged-SDK handling; test/fixtures/network_tls/README describes public test fixtures without production credentials; ios/Runner/Assets.xcassets/LaunchImage.imageset/README explains how to customize the launch screen. The rust_backend/crates/mobile/src/usb_audio/README is a deep device-driver guide for Android USB host transport, covering ownership, playback guarantees, UAC1 verification, and replay-gain bypassing; it is clipped mid-sentence before any of its listed sections (DSD, DAP PCM hi-res, Reference and dependencies) are shown. The docs/artist_concerts.md README covers metadata extensions, concert metadata structure, time-zone handling, optional fields, and a badge that opens the schedule with artist identity — all present in the clipped outline. The only unclipped document is the player_widgets.md home-screen widget guide, which is clipped mid-sentence but its outline sections (Adding and customizing; Native integration) are visible. (10 of 18 sampled documents could not be assessed: 1 of 2 evaluation groups failed.)

✓ 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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyStronggated by 2 serious findings◐ Sampled · advisory

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

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

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

2 API inconsistencies across a 400-member sample of 606 exposed types.

Inconsistent naming and parameter types for bulk cancellation operations. CancellationRegistry uses 'cancel_many' with a generic iterator, while DownloadState uses 'cancel_many' with a slice reference. More importantly, DownloadState duplicates the single-item cancel logic found in CancellationRegistry but with different naming conventions for the bulk variant (though both use 'cancel_many', the underlying types differ). However, the primary inconsistency is between CancellationRegistry and DownloadState regarding the single-item method: CancellationRegistry uses 'cancel' while DownloadState also uses 'cancel'. This is actually consistent. The real issue is the parameter type inconsistency for the bulk method: `impl IntoIterator<Item = &str>` vs `&[String]`. While functionally similar, the API surface exposes different abstractions for the same intent.
Inconsistent naming for bulk operations. The single-item method is 'reset_if_idle', but the bulk method is 'reset_many_if_idle'. While descriptive, this breaks the pattern seen in 'cancel' vs 'cancel_many'. It is inconsistent with the 'cancel' naming convention established in the same type.

What to do

  1. Resolve the 1 Inconsistent naming and parameter types for bulk cancellation… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Inconsistent naming for bulk operations. The single-item method is… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion6.5 / 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, LLM-independent.

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

3 of 17 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 Vulnerabilities8.9 / 10Strong✓ 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.

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

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
  2. 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).
  3. Resolve the 2 Medium vulnerability 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 778 of the 970 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 6 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: album_screen.dart↔playlist_screen.dart 74%; queue_tab.dart↔batch_convert_sheet.dart 70%; downloaded_album_screen.dart↔local_album_screen.dart 69%

Boundary-crossing change coupling: queue_tab.dart ↔ batch_convert_sheet.dart · ×6lib/screens/queue_tab.dart:1
Change coupling: album_screen.dart ↔ playlist_screen.dart · ×5lib/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 6 Boundary-crossing change coupling finding(s) in Change Coupling — start with download_queue_provider.dart (2), queue_tab.dart, MainActivity.kt. — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 5 Change coupling finding(s) in Change Coupling — start with album_screen.dart, downloaded_album_screen.dart, MainActivitySafIo.kt. — One of this dimension's main actionable groups (5 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. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-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 19 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 dependencies10.0 / 10Exemplary✓ 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.

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.

AX6 · Interface segregation6.0 / 10Adequate✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

  • `ServiceListener` declares 37 abstract methods: `onAddQueueItem`, `onAddQueueItemAt`, `onAdjustVolume`, `onClick`, `onClose`, `onCustomAction`, `onDestroy`, `onFastForward`, `onLoadChildren`, `onLoadItem`, `onPause`, `onPlay`, `onPlayFromMediaId`, `onPlayFromSearch`, `onPlayFromUri`, `onPlayMediaItem`, `onPrepare`, `onPrepareFromMediaId`, `onPrepareFromSearch`, `onPrepareFromUri`, `onRemoveQueueItem`, `onRemoveQueueItemAt`, `onRewind`, `onSearch`, `onSeekTo`, `onSetCaptioningEnabled`, `onSetPlaybackSpeed`, `onSetRating`, `onSetRating`, `onSetRepeatMode`, `onSetShuffleMode`, `onSetVolumeTo`, `onSkipToNext`, `onSkipToPrevious`, `onSkipToQueueItem`, `onStop`, `onTaskRemoved`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 37 declarations carry 36 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 36 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — third_party/audio_service/android/src/main/java/com/ryanheise/audioservice/AudioService.java:1177

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

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

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

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

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

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

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

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

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

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

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

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)6.4 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 8 of 10 project(s) that lack one — worth up to 1.6 pts.
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 repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy9.9 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • scripts/README_ios_ffmpeg_capabilities.md names `scripts/setup_ios.sh`, but no file or folder `scripts/setup_ios.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — scripts/README_ios_ffmpeg_capabilities.md:9

What to do

  • Reconcile the README with reality: scripts/README_ios_ffmpeg_capabilities.md names `scripts/setup_ios.sh`, but no file or folder `scripts/setup_ios.sh` exists.
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 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.7 / 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/7 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/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.

PF2 · Allocation hygiene6.6 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 255 use(s) across 214,554 production line(s) (~1.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Dart: on hot paths, hold numbers in dart:typed_data lists (Int32List, Float64List …) instead of boxed List<int>/List<double>, read through views (sublistView, buffer.asInt32List, asByteData) instead of copying, make lists that never grow growable: false, compute in the SIMD types (Float32x4List …), and build bytes with BytesBuilder(copy: false).
  • Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
  • Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
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 the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

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 classification5.5 / 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 68) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 66 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:66

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.

  • `customSearchWithExtension` is public, takes a document from its caller (line 2088) and hands it to `_canonicalizeJsonLike`, which calls itself at line 546 (`_canonicalizeJsonLike`) with a piece of `value` (and at line 550) — 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:546
  • `coverUrl` is public, takes a document from its caller (line 514) and hands it to `fromValue`, which calls itself at line 522 (`fromValue`) with a piece of `value` (and at line 528) — 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:522

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.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

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

What to do

  • Thread a CancelToken through functions that make requests, so the work stops when its caller gives up.
X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

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.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

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.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

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.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

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

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

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

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

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

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

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

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

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

X3 · Exception handling4.8 / 10Weak✓ 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.

  • `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×19) — android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:192, android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:202, android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:207, …
  • 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. (×20) — android/app/src/main/kotlin/com/zarz/mornye/SafScanCheckpoint.kt:47, android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:73, android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:315, …
  • `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:502

What to do

  • Swallowed exception (caught, then discarded)
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 Health61%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture85%StrongSolid.
Maturity64%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness65%AdequateAcceptable, with room to improve.
Security76%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplaryStrongest area.
Performance79%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.

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X10 Duplicated predicate — 25 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 — 51 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.
  • AC7 A11y enforcement — 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)
  • 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 — ~123539 lines of test source are present (.kt, .dart, .rs) 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 19 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.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • 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) — 1 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.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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 — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
  • DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — 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, Python, 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
  • 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.
  • 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.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 13 finding(s)
D35 · Change Coupling · Boundary-crossing change coupling · ×6
  • 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 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) — 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: 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 62% of the time (51 of the 82 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 51 shared commits counted here, the most recent 3 are `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`); `867371cb` feat(native): add cancellable data workers and streamed file hashing (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: download_queue_provider.dart ↔ csv_import_service.dart lib/providers/download_queue_provider.dart:1 — `lib/providers/download_queue_provider.dart` (context providers) and `lib/services/csv_import_service.dart` (context services) 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 `3d366d21` perf: optimize providers, throttle polling, queued settings save, rem…; `6388f3a5` perf: optimize providers, caching, and reduce rebuilds; `621582cf` refactor: additional code cleanup — run `git show` on any of them.
  • Boundary-crossing change coupling: local_album_screen.dart ↔ batch_convert_sheet.dart lib/screens/local_album_screen.dart:1 — `lib/screens/local_album_screen.dart` (context screens) and `lib/widgets/batch_convert_sheet.dart` (context widgets) 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 `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: downloaded_album_screen.dart ↔ batch_convert_sheet.dart lib/screens/downloaded_album_screen.dart:1 — `lib/screens/downloaded_album_screen.dart` (context screens) and `lib/widgets/batch_convert_sheet.dart` (context widgets) 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 `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: download_queue_provider.dart ↔ app_state_database.dart lib/providers/download_queue_provider.dart:1 — `lib/providers/download_queue_provider.dart` (context providers) and `lib/services/app_state_database.dart` (context services) 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 `51943442` refactor(downloads): separate persistence, progress and feedback; `45d9bbd7` perf: harden download and persistence lifecycle; `c9114fef` fix(android): sanitize restored installation state — run `git show` on any of them.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
Serious — 1619 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×142
  • Hotspot: lib/screens/now_playing_screen.dart lib/screens/now_playing_screen.dart:253 — lib/screens/now_playing_screen.dart changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in _NowPlayingScreenState._buildPlayer at line 253. 34 of those changes were fix/bug commits, and the other 56 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt:420 — android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in MainActivity.configureFlutterEngine at line 420. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/screens/home_tab.dart lib/screens/home_tab.dart:758 — lib/screens/home_tab.dart changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in _HomeTabState.build at line 758. 16 of those changes were fix/bug commits, and the other 42 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: lib/screens/queue_tab.dart lib/screens/queue_tab.dart:491 — lib/screens/queue_tab.dart changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in _QueueTabState.build at line 491. 23 of those changes were fix/bug commits, and the other 51 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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:618 — lib/providers/download_queue_provider_single_item.dart changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in _DownloadRun._handleDownloadSuccess at line 618. 19 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/music_player_service.dart lib/services/music_player_service.dart:1391 — lib/services/music_player_service.dart changed 61 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in MusicPlayerHandler._loadIndex at line 1391. 20 of those changes were fix/bug commits, and the other 41 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/main_shell.dart lib/screens/main_shell.dart:789 — lib/screens/main_shell.dart changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in _MainShellState.build at line 789. 11 of those changes were fix/bug commits, and the other 42 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: REDACTED REDACTED:120 — REDACTED changed 30 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: ios/Runner/AppDelegate.swift ios/Runner/AppDelegate.swift:479 — ios/Runner/AppDelegate.swift changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in AppDelegate.invokeOsMethod at line 479. 9 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: ios/Runner/CoreBackend.swift ios/Runner/CoreBackend.swift:643 — ios/Runner/CoreBackend.swift changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in RustCoreBackend.invokeApplication at line 643. 2 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: lib/screens/settings/library_settings_page.dart lib/screens/settings/library_settings_page.dart:551 — lib/screens/settings/library_settings_page.dart changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in _LibrarySettingsPageState.build at line 551. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: lib/services/platform_bridge.dart lib/services/platform_bridge.dart:303 — lib/services/platform_bridge.dart changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in PlatformBridge._ensureBackendEventHandler at line 303. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/widgets/player_lyrics.dart lib/widgets/player_lyrics.dart:856 — lib/widgets/player_lyrics.dart changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in _SyncedLyricsViewState._buildLyrics at line 856. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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:213 — lib/widgets/mornye_chrome.dart changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in MornyeGlass.build at line 213. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: 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 39 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/screens/artist_screen.dart lib/screens/artist_screen.dart:625 — lib/screens/artist_screen.dart changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in _ArtistScreenState._buildPage at line 625. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/screens/album_screen.dart lib/screens/album_screen.dart:521 — lib/screens/album_screen.dart changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in _AlbumScreenState._buildAppBar at line 521. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00:00' --full-history --no-merges -- lib/screens/album_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/playback_settings_page.dart lib/screens/settings/playback_settings_page.dart:81 — lib/screens/settings/playback_settings_page.dart changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in _PlaybackSettingsPageState.build at line 81. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/services/library_database.dart lib/services/library_database.dart:755 — lib/services/library_database.dart changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in LibraryDatabase.updateAudioMetadata at line 755. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/services/music_player_automix.dart lib/services/music_player_automix.dart:228 — lib/services/music_player_automix.dart changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in _MusicAutoMix._start at line 228. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt:238 — android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in NativeFinalizerMediaKt.embedBasicMetadata at line 238. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00:00' --full-history --no-merges -- android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.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/providers/settings_provider.dart lib/providers/settings_provider.dart:289 — lib/providers/settings_provider.dart changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in SettingsNotifier._runMigrations at line 289. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/services/network_library_scanner.dart lib/services/network_library_scanner.dart:91 — lib/services/network_library_scanner.dart changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in NetworkLibraryScanner._scan at line 91. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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.
  • Hotspot: lib/screens/library_tracks_folder_screen.dart lib/screens/library_tracks_folder_screen.dart:254 — lib/screens/library_tracks_folder_screen.dart changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in _LibraryTracksFolderScreenState.build at line 254. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/widgets/mini_player.dart lib/widgets/mini_player.dart:131 — lib/widgets/mini_player.dart changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in _MiniPlayerBodyState.build at line 131. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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.
  • + 117 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×126
  • MethodTooLong: _QueueTabState.build lib/screens/queue_tab.dart:491 — MethodTooLong — build runs 417 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 317 over it, 4.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _NowPlayingScreenState._buildPlayer lib/screens/now_playing_screen.dart:253 — MethodTooLong — _buildPlayer runs 350 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ExtensionDetailPageState.build lib/screens/settings/extension_detail_page.dart:83 — MethodTooLong — build runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.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: 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:80 — MethodTooLong — build runs 293 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 193 over it, 2.93× 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:856 — MethodTooLong — _buildLyrics runs 291 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 191 over it, 2.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _LibrarySettingsPageState.build lib/screens/settings/library_settings_page.dart:551 — MethodTooLong — build runs 287 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 187 over it, 2.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _MainShellState.build lib/screens/main_shell.dart:789 — MethodTooLong — build runs 286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 186 over it, 2.86× 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:648 — MethodTooLong — download_attempt runs 284 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 184 over it, 2.84× 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:91 — MethodTooLong — _scan runs 261 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 161 over it, 2.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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: _BatchConvertSheetState.build lib/widgets/batch_convert_sheet.dart:83 — MethodTooLong — build 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: AppSettings.copyWith lib/models/settings.dart:317 — MethodTooLong — copyWith runs 251 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RustCoreBackendApplicationKt.dispatchApplication android/app/src/rust/kotlin/com/zarz/mornye/RustCoreBackendApplication.kt:9 — MethodTooLong — dispatchApplication runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _FilesSettingsPageState.build lib/screens/settings/files_settings_page.dart:128 — MethodTooLong — build runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _TrackOptionsSheet.build lib/widgets/track_collection_quick_actions.dart:250 — 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: _MornyeLibraryScreenState.build lib/screens/mornye_library_screen.dart:307 — MethodTooLong — build runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DownloadService.processConcurrentNativeRequest android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1064 — 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:241 — 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: _CacheManagementPageState.build lib/screens/settings/cache_management_page.dart:360 — MethodTooLong — build runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _DownloadSettingsPageState.build lib/screens/settings/download_settings_page.dart:28 — MethodTooLong — build runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× 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:291 — MethodTooLong — build runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _EqualizerScreenState._buildPage lib/screens/equalizer_screen.dart:207 — MethodTooLong — _buildPage runs 218 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _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: RustCoreBackend.invokeApplication ios/Runner/CoreBackend.swift:643 — MethodTooLong — invokeApplication runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 101 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×88
  • FileTooLong: services/platform_bridge.dart lib/services/platform_bridge.dart — FileTooLong — 1957 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: PlatformBridge (69-2881). The bar is 500 significant lines; this is 1457 over it, 3.91× 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/music_player_service.dart lib/services/music_player_service.dart — FileTooLong — 1578 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: MusicPlayerHandler (109-2093). The bar is 500 significant lines; this is 1078 over it, 3.16× 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 — 1412 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: _DownloadRun (74-1884). The bar is 500 significant lines; this is 912 over it, 2.82× 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 — 1288 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: DownloadService (46-1742). The bar is 500 significant lines; this is 788 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: providers/download_queue_provider_native_worker.dart lib/providers/download_queue_provider_native_worker.dart — FileTooLong — 1218 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 718 over it, 2.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: widgets/player_lyrics.dart lib/widgets/player_lyrics.dart — FileTooLong — 1142 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: _SyncedLyricsViewState (95-1278). The bar is 500 significant lines; this is 642 over it, 2.28× 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 — 1064 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 564 over it, 2.13× 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 — 1019 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: _NowPlayingScreenState (98-1349). The bar is 500 significant lines; this is 519 over it, 2.04× 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 — 1015 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 515 over it, 2.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: screens/home_tab.dart lib/screens/home_tab.dart — FileTooLong — 1007 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: _HomeTabState (113-1443). The bar is 500 significant lines; this is 507 over it, 2.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: widgets/animation_utils.dart lib/widgets/animation_utils.dart — FileTooLong — 997 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 497 over it, 1.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: screens/library_tracks_folder_screen.dart lib/screens/library_tracks_folder_screen.dart — FileTooLong — 985 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: _LibraryTracksFolderScreenState (75-1037). The bar is 500 significant lines; this is 485 over it, 1.97× 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_history_provider.dart lib/providers/download_history_provider.dart — FileTooLong — 944 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: DownloadHistoryNotifier (86-1148). The bar is 500 significant lines; this is 444 over it, 1.89× 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_collections_database.dart lib/services/library_collections_database.dart — FileTooLong — 932 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: LibraryCollectionsDatabase (69-1118). The bar is 500 significant lines; this is 432 over it, 1.86× 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 — 898 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: _MainShellState (109-1200). The bar is 500 significant lines; this is 398 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: screens/network_storage_screen.dart lib/screens/network_storage_screen.dart — FileTooLong — 887 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 387 over it, 1.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: desktop/desktop_navigation.dart lib/widgets/desktop/desktop_navigation.dart — FileTooLong — 832 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 332 over it, 1.66× 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 — 823 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-1071). The bar is 500 significant lines; this is 323 over it, 1.65× 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.dart lib/screens/queue_tab.dart — FileTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: _QueueTabState (131-1164). The bar is 500 significant lines; this is 318 over it, 1.64× 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: settings/settings_tab.dart lib/screens/settings/settings_tab.dart — FileTooLong — 796 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: _SettingsTabState (98-878). The bar is 500 significant lines; this is 296 over it, 1.59× 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/repo_tab.dart lib/screens/repo_tab.dart — FileTooLong — 793 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: _RepoTabState (38-702). The bar is 500 significant lines; this is 293 over it, 1.59× 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/album_screen.dart lib/screens/album_screen.dart — FileTooLong — 792 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: _AlbumScreenState (94-1020). The bar is 500 significant lines; this is 292 over it, 1.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/home_tab_explore.dart lib/screens/home_tab_explore.dart — FileTooLong — 788 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 288 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: services/network_storage_service.dart lib/services/network_storage_service.dart — FileTooLong — 786 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: NetworkStorageService (225-992). The bar is 500 significant lines; this is 286 over it, 1.57× 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/downloaded_embedded_cover_resolver.dart lib/services/downloaded_embedded_cover_resolver.dart — FileTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: DownloadedEmbeddedCoverResolver (67-1078). The bar is 500 significant lines; this is 284 over it, 1.57× 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.
  • + 63 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:211 — 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 68) rust_backend/crates/core/src/tags/write/riff.rs:5 — mornye_core::tags::write::riff::edit has cognitive complexity 68 (threshold 15). Drivers by points: if/else 37 (57 pts), boolean chains 7, match/switch 1 (3 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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:304 — 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:39 — 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:494 — 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:231 — 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:462 — 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 · ClassTooLong · ×54
  • ClassTooLong: PlatformBridge lib/services/platform_bridge.dart:69 — ClassTooLong — 1906 significant lines (blank, comment-only and punctuation-only lines excluded), 219 methods. The bar is 400 significant lines; this is 1506 over it, 4.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MusicPlayerHandler lib/services/music_player_service.dart:109 — ClassTooLong — 1498 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 400 significant lines; this is 1098 over it, 3.75× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _DownloadRun lib/providers/download_queue_provider_single_item.dart:70 — ClassTooLong — 1363 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 963 over it, 3.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DownloadService android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:46 — ClassTooLong — 1252 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 852 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:113 — ClassTooLong — 954 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 554 over it, 2.39× 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:98 — ClassTooLong — 945 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 545 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: _SyncedLyricsViewState lib/widgets/player_lyrics.dart:95 — ClassTooLong — 915 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 515 over it, 2.29× 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:69 — ClassTooLong — 802 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 402 over it, 2.01× 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:86 — ClassTooLong — 792 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 392 over it, 1.98× 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:109 — ClassTooLong — 758 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 358 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _QueueTabState lib/screens/queue_tab.dart:131 — ClassTooLong — 753 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 353 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: DownloadedEmbeddedCoverResolver lib/services/downloaded_embedded_cover_resolver.dart:62 — ClassTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 340 over it, 1.85× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _AlbumScreenState lib/screens/album_screen.dart:94 — ClassTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 310 over it, 1.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LibraryDatabase lib/services/library_database.dart:29 — ClassTooLong — 709 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 309 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _LibraryTracksFolderScreenState lib/screens/library_tracks_folder_screen.dart:75 — ClassTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 300 over it, 1.75× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SettingsNotifier lib/providers/settings_provider.dart:102 — ClassTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded), 125 methods. The bar is 400 significant lines; this is 283 over it, 1.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SettingsSearchCatalog lib/utils/settings_search_catalog.dart:51 — ClassTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 252 over it, 1.63× 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:39 — ClassTooLong — 650 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 250 over it, 1.63× 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:43 — ClassTooLong — 641 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 241 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.
  • ClassTooLong: _DownloadedAlbumScreenState lib/screens/downloaded_album_screen.dart:70 — ClassTooLong — 628 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 228 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: _LocalAlbumScreenState lib/screens/local_album_screen.dart:72 — ClassTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 198 over it, 1.50× 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: _SetupScreenState lib/screens/setup_screen.dart:52 — ClassTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 195 over it, 1.49× 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:225 — ClassTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 194 over it, 1.49× 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: _ConcertDetailScreenState lib/screens/concert_detail_screen.dart:44 — ClassTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 183 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _ArtistScreenState lib/screens/artist_screen.dart:165 — ClassTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 182 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 29 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:211 — 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::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:123 — 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::tags::write::riff::edit (cyclomatic 38) rust_backend/crates/core/src/tags/write/riff.rs:5 — mornye_core::tags::write::riff::edit 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.
  • 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:304 — 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:39 — 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:494 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×29
  • Low cohesion: LibraryCollectionsDatabase (LCOM4 24) lib/services/library_collections_database.dart:69 — LibraryCollectionsDatabase's methods fall into 24 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 24 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 22) lib/services/library_database.dart:29 — LibraryDatabase's methods fall into 22 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 22 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 17) lib/services/app_state_database.dart:28 — AppStateDatabase's methods fall into 17 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 17 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 16) lib/services/history_database.dart:96 — HistoryDatabase's methods fall into 16 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 16 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 7) lib/providers/download_queue_provider.dart:109 — DownloadQueueNotifier'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: RepoNotifier (LCOM4 7) lib/providers/repo_provider.dart:193 — RepoNotifier'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: _HomeTabState (LCOM4 7) lib/screens/home_tab.dart:113 — _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: _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: _LibrarySettingsPageState (LCOM4 6) lib/screens/settings/library_settings_page.dart:39 — _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:154 — _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: _DesktopShortcutsState (LCOM4 6) lib/widgets/desktop/desktop_shortcuts.dart:44 — _DesktopShortcutsState'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: ExtensionNotifier (LCOM4 5) lib/providers/extension_provider.dart:31 — ExtensionNotifier'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: MusicPlayerController (LCOM4 5) lib/providers/music_player_provider.dart:312 — MusicPlayerController'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: 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: BackupBundle (LCOM4 5) lib/services/backup_service.dart:77 — BackupBundle'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:25 — 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: _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: _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.
  • Low cohesion: _QueueTabState (LCOM4 4) lib/screens/queue_tab.dart:131 — _QueueTabState'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: _EditMetadataSheetState (LCOM4 4) lib/screens/track_metadata_edit_sheet.dart:64 — _EditMetadataSheetState'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: FfiBackendTransport (LCOM4 4) lib/services/backend/ffi_backend_transport.dart:103 — FfiBackendTransport'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: PlaybackDependencies (LCOM4 4) lib/services/music_player_runtime.dart:31 — PlaybackDependencies'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.
  • + 4 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×26
  • TooManyMethods: PlatformBridge lib/services/platform_bridge.dart:69 — TooManyMethods — 219 methods. The bar is 30 methods; this is 189 over it, 7.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: SettingsNotifier lib/providers/settings_provider.dart:102 — TooManyMethods — 125 methods. The bar is 30 methods; this is 95 over it, 4.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: Backend rust_backend/crates/extensions/src/backend.rs:34 — TooManyMethods — 98 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 68 over it, 3.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MusicPlayerHandler lib/services/music_player_service.dart:109 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.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: 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 — 72 methods, declared across 5 files: src/manager.rs (30), src/tags.rs (18), src/metadata.rs (15), src/lyrics.rs (8), +1 more file(s). The bar is 30 methods; this is 42 over it, 2.40× 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:29 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RustCoreBackend android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt:63 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. Most of these members implement mornye.CoreBackend (37 of 53 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: LibraryCollectionsDatabase lib/services/library_collections_database.dart:69 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DownloadedEmbeddedCoverResolver lib/services/downloaded_embedded_cover_resolver.dart:62 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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:113 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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:79 — 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: DownloadHistoryNotifier lib/providers/download_history_provider.dart:86 — 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: MediaKitPlaybackDeck lib/services/media_kit_playback_deck.dart:137 — 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: HistoryDatabase lib/services/history_database.dart:96 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NotificationService lib/services/notification_service.dart:14 — 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: Backend rust_backend/crates/desktop/src/backend.rs:52 — 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: LibraryCollectionsNotifier lib/providers/library_collections_provider.dart:18 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _QueueTabState lib/screens/queue_tab.dart:131 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _SyncedLyricsViewState lib/widgets/player_lyrics.dart:95 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _LocalAlbumScreenState lib/screens/local_album_screen.dart:72 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _NowPlayingScreenState lib/screens/now_playing_screen.dart:98 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DesktopDiagnostics lib/services/desktop_diagnostics.dart:13 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 1 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 30) rust_backend/crates/extensions/src/runtime/vm.rs:13 — mornye_extensions::runtime::vm::run_worker has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 4 (11 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.
  • mornye_extensions::backend::downloads::metadata::download_metadata_fields (cognitive 25) rust_backend/crates/extensions/src/backend/downloads/metadata.rs:44 — 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::matching::probe_result (cognitive 24) rust_backend/crates/extensions/src/backend/downloads/matching.rs:11 — mornye_extensions::backend::downloads::matching::probe_result has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 1 (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::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::backend::downloads::result::success (cognitive 21) rust_backend/crates/extensions/src/backend/downloads/result.rs:10 — mornye_extensions::backend::downloads::result::success has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, 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.
  • 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::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:141 — 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:133 — 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:200 — 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.
D3 · God Classes · FunctionTooLong · ×22
  • 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_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_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::tags::write::riff::edit rust_backend/crates/core/src/tags/write/riff.rs:5 — FunctionTooLong — mornye_core::tags::write::riff::edit runs 147 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 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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:211 — 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_backup::import rust_backend/crates/mobile/src/native_backup.rs:418 — 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:39 — 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.
  • FunctionTooLong: mornye_mobile::native_listing::execute rust_backend/crates/mobile/src/native_listing.rs:8 — FunctionTooLong — mornye_mobile::native_listing::execute runs 104 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 4 over it, 1.04× 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.
D2 · Cognitive Complexity · mornye_mobile · ×21
  • 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_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:156 — 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_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_library::path_keys::build (cognitive 34) rust_backend/crates/mobile/src/native_library/path_keys.rs:206 — mornye_mobile::native_library::path_keys::build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 7, 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.
  • 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_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_listing::execute (cognitive 25) rust_backend/crates/mobile/src/native_listing.rs:8 — mornye_mobile::native_listing::execute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, loops 2 (4 pts), match/switch 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.
  • 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:418 — 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:170 — 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_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:51 — 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.
  • mornye_mobile::native_cache::unix::prune (cognitive 16) rust_backend/crates/mobile/src/native_cache/unix.rs:338 — mornye_mobile::native_cache::unix::prune has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×20
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:192 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:202 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:207 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:216 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:52 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:168 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:177 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:199 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:264 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:630 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:697 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafDocumentLookup.kt:22 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafCueScan.kt:132 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/SafCueLookup.kt:27 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:419 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:502 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt:217 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerFFmpeg.kt:29 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:432 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafTreePicker.kt:107 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
X3 · Exception handling · Swallowed exception (empty catch) · ×20
  • Swallowed exception (empty catch) android/app/src/main/kotlin/com/zarz/mornye/SafScanCheckpoint.kt:47 — 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) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:73 — 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) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:315 — 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) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:358 — 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) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:703 — 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) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:852 — 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) android/app/src/main/kotlin/com/zarz/mornye/SafBatchQueries.kt:71 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeMediaWorkspace.kt:34 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeMediaWorkspace.kt:51 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt: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) android/app/src/main/kotlin/com/zarz/mornye/NativeHistoryStore.kt:518 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMetadata.kt:217 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt:436 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerFFmpeg.kt:108 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerDecrypt.kt:150 — 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) android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:74 — 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) REDACTED:137 — 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) REDACTED:275 — 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) REDACTED:277 — 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) REDACTED:392 — 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.
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.
  • Duplicated block (10 lines × 2) lib/screens/album_screen.dart:413 — lib/screens/album_screen.dart:413-422 | lib/screens/artist_screen.dart:561-570 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/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:288 — lib/screens/downloaded_album_screen.dart:288-297 | lib/screens/local_album_screen.dart:304-313 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) lib/screens/settings/app_settings_page.dart:164 — lib/screens/settings/app_settings_page.dart:164-173 | lib/screens/settings/app_settings_page.dart:198-207 — both copies are in the same file, so extract the block into 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/screens/settings/library_settings_page.dart:297 — lib/screens/settings/library_settings_page.dart:297-307 | lib/widgets/mornye_player_favorite_button.dart:42-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) lib/screens/settings/lyrics_provider_priority_page.dart:318 — lib/screens/settings/lyrics_provider_priority_page.dart:318-327 | 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.
  • Duplicated block (10 lines × 2) lib/services/history_database.dart:673 — lib/services/history_database.dart:673-682 | lib/services/history_database.dart:730-739 — both copies are in the same file, so extract the block into 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/services/library_queue_store.dart:596 — lib/services/library_queue_store.dart:596-605 | lib/services/library_queue_store.dart:665-674 — both copies are in the same file, so extract the block into 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/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.
  • 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:107 — rust_backend/crates/core/src/tags/write/id3.rs:107-119 | 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.
  • Duplicated block (10 lines × 2) rust_backend/crates/providers/src/resolver/client.rs:110 — rust_backend/crates/providers/src/resolver/client.rs:110-119 | rust_backend/crates/providers/src/resolver/http.rs:151-160 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×16
  • Duplicated block (7 lines × 2) lib/models/extension.dart:266 — lib/models/extension.dart:266-272 | lib/models/extension.dart:287-293 — both copies are in the same file, so extract the block into 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/screens/album_screen.dart:971 — lib/screens/album_screen.dart:971-977 | lib/screens/playlist_screen.dart:584-590 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/screens/artist_screen.dart:328 — lib/screens/artist_screen.dart:328-334 | lib/screens/artist_screen.dart:377-384 — both copies are in the same file, so extract the block into 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/history_row_mapper.dart:74 — lib/services/history_row_mapper.dart:74-80 | lib/services/history_row_mapper.dart:96-102 — both copies are in the same file, so extract the block into 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.
  • 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/widgets/desktop/desktop_inspector.dart:431 — lib/widgets/desktop/desktop_inspector.dart:431-437 | lib/widgets/desktop/desktop_now_playing.dart:70-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • 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.
  • 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.
  • Duplicated block (7 lines × 2) rust_backend/crates/core/src/tags/containers.rs:177 — rust_backend/crates/core/src/tags/containers.rs:177-183 | rust_backend/crates/core/src/tags/write/id3.rs:215-221 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (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 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) rust_backend/crates/extensions/src/manager.rs:282 — rust_backend/crates/extensions/src/manager.rs:282-288 | rust_backend/crates/extensions/src/manager.rs:307-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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.
  • 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.
D2 · Cognitive Complexity · Backend · ×15
  • Backend::plan_download (cognitive 86) rust_backend/crates/extensions/src/backend/downloads.rs:168 — Backend::plan_download has cognitive complexity 86 (threshold 15). Drivers by points: if/else 38 (68 pts), boolean chains 10, match/switch 4 (7 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.
  • Backend::scan_library (cognitive 76) rust_backend/crates/extensions/src/backend/library/scan.rs:353 — 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 68) rust_backend/crates/extensions/src/backend/downloads.rs:648 — Backend::download_attempt has cognitive complexity 68 (threshold 15). Drivers by points: if/else 37 (48 pts), boolean chains 15, 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::reenrich_file (cognitive 54) rust_backend/crates/extensions/src/backend/reenrich.rs:18 — 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::resolve_reenrich_request (cognitive 54) rust_backend/crates/extensions/src/backend/reenrich.rs:212 — Backend::resolve_reenrich_request has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (42 pts), boolean chains 7, loops 1 (5 pts) (nesting depth added 32). 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::enrich_download_extended (cognitive 25) rust_backend/crates/extensions/src/backend/downloads.rs:999 — 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:298 — 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:314 — 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::cache_cover (cognitive 20) rust_backend/crates/extensions/src/backend/cover.rs:294 — Backend::cache_cover has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 1 (2 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.
  • 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:154 — 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:431 — 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:341 — 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) · ×13
  • Duplicated block (8 lines × 2) lib/models/settings.dart:491 — lib/models/settings.dart:491-501 | lib/providers/local_library_provider.dart:124-131 — 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) lib/providers/download_history_provider.dart:625 — lib/providers/download_history_provider.dart:625-632 | lib/providers/download_history_provider.dart:686-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.
  • Duplicated block (8 lines × 2) lib/screens/main_shell.dart:528 — lib/screens/main_shell.dart:528-535 | lib/screens/main_shell.dart:545-554 — both copies are in the same file, so extract the block into 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/widgets/animation_utils.dart:632 — lib/widgets/animation_utils.dart:632-639 | lib/widgets/material_player_backdrop.dart:61-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/screens/album_screen.dart:165 — lib/screens/album_screen.dart:165-172 | 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/widgets/expressive_seek_track.dart:43 — lib/widgets/expressive_seek_track.dart:43-50 | lib/widgets/now_playing_indicator.dart:43-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
  • 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:159-166 — 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/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.
  • Duplicated block (8 lines × 2) rust_backend/crates/providers/src/resolver/availability/cache.rs:215 — rust_backend/crates/providers/src/resolver/availability/cache.rs:215-222 | rust_backend/crates/providers/src/resolver/service.rs:136-143 — 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/core/src/metadata/deezer.rs:138 — rust_backend/crates/core/src/metadata/deezer.rs:138-145 | 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.
D1 · Cyclomatic Complexity · mornye_extensions · ×11
  • 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::backend::downloads::metadata::download_metadata_fields (cyclomatic 16) rust_backend/crates/extensions/src/backend/downloads/metadata.rs:44 — 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::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.
  • mornye_extensions::runtime::vm::run_worker (cyclomatic 16) rust_backend/crates/extensions/src/runtime/vm.rs:13 — mornye_extensions::runtime::vm::run_worker 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 · mornye_mobile · ×11
  • 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_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_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_library::path_keys::build (cyclomatic 21) rust_backend/crates/mobile/src/native_library/path_keys.rs:206 — mornye_mobile::native_library::path_keys::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.
  • 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_listing::execute (cyclomatic 20) rust_backend/crates/mobile/src/native_listing.rs:8 — mornye_mobile::native_listing::execute 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.
  • 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:156 — 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 (6 lines × 2) · ×10
  • Duplicated block (6 lines × 2) lib/models/extension.dart:123 — lib/models/extension.dart:123-128 | lib/providers/repo_provider.dart:84-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.
  • Duplicated block (6 lines × 2) lib/screens/downloaded_album_screen.dart:803 — lib/screens/downloaded_album_screen.dart:803-808 | lib/screens/local_album_screen.dart:765-771 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 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) lib/services/media_kit_playback_deck.dart:457 — lib/services/media_kit_playback_deck.dart:457-463 | lib/services/music_playback_deck.dart:147-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:126-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (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.
  • 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.
  • Duplicated block (6 lines × 2) rust_backend/crates/extensions/src/download.rs:330 — rust_backend/crates/extensions/src/download.rs:330-335 | rust_backend/crates/extensions/src/download/chunked.rs:196-201 — 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/providers/src/resolver/availability/cache.rs:101 — rust_backend/crates/providers/src/resolver/availability/cache.rs:101-106 | rust_backend/crates/providers/src/resolver/service.rs:84-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.
  • 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:141-148 — 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 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×10
  • Duplicated block (5 lines × 2) lib/models/extension.dart:719 — lib/models/extension.dart:719-723 | lib/models/extension.dart:754-758 — both copies are in the same file, so extract the block into 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) lib/screens/track_metadata_screen.dart:349 — lib/screens/track_metadata_screen.dart:349-353 | lib/screens/track_metadata_screen.dart:378-382 — both copies are in the same file, so extract the block into 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) lib/services/ffmpeg_conversion.dart:409 — lib/services/ffmpeg_conversion.dart:409-413 | lib/services/ffmpeg_conversion.dart:489-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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:192 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:192-196 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:219-223 — both copies are in the same file, so extract the block into 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.
  • Duplicated block (5 lines × 2) rust_backend/crates/extensions/src/download/segment_store.rs:213 — rust_backend/crates/extensions/src/download/segment_store.rs:213-217 | rust_backend/crates/extensions/src/download/store.rs:188-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) rust_backend/crates/mobile/src/native_cache/unix.rs:354 — rust_backend/crates/mobile/src/native_cache/unix.rs:354-358 | rust_backend/crates/mobile/src/native_collections.rs:114-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) 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:136 — rust_backend/crates/mobile/src/native_backup.rs:136-140 | 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×8
  • Duplicated block (9 lines × 2) lib/providers/download_history_provider.dart:613 — lib/providers/download_history_provider.dart:613-623 | lib/providers/download_queue_provider.dart:887-895 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) lib/screens/setup_screen.dart:299 — lib/screens/setup_screen.dart:299-307 | lib/screens/setup_screen.dart:421-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) lib/screens/tutorial_screen.dart:415 — lib/screens/tutorial_screen.dart:415-423 | lib/screens/tutorial_screen.dart:561-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) lib/services/library_row_mapper.dart:59 — lib/services/library_row_mapper.dart:59-67 | lib/services/library_schema.dart:318-326 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) lib/widgets/desktop/track_table.dart:546 — lib/widgets/desktop/track_table.dart:546-554 | lib/widgets/mornye_bottom_bar.dart:130-138 — 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) 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.
  • 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.
  • Duplicated block (9 lines × 2) rust_backend/crates/extensions/src/manifest.rs:107 — rust_backend/crates/extensions/src/manifest.rs:107-115 | rust_backend/crates/extensions/src/manifest.rs:123-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D15 · Churn × Complexity Hotspots · Repeated repair · ×7
  • Repeated repair: lib/providers/download_queue_provider_native_worker.dart lib/providers/download_queue_provider_native_worker.dart:29 — lib/providers/download_queue_provider_native_worker.dart changed 36 times in last 90 days and 19 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is _NativeWorkerRequestContext.withResolvedFolder at line 29), 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(downloads): recover native queues when their service dies”; “fix(downloads): preserve browser verification and queues across restarts”; “fix(downloads): finalize album ReplayGain after history is saved”; “fix(queue): preserve restored downloads during startup flush”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00:00' --full-history --no-merges -- lib/providers/download_queue_provider_native_worker.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/home_tab_explore.dart lib/screens/home_tab_explore.dart:798 — lib/screens/home_tab_explore.dart changed 20 times in last 90 days and 11 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 _ExploreSectionPage._typeLabel at line 798), 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): keep explore artwork square”; “fix(desktop): present Material song menus and sheets as desktop surfaces”; “fix(desktop): give every page the same full-pane width”; “fix(desktop): run Home's feed across the whole content pane”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00:00' --full-history --no-merges -- lib/screens/home_tab_explore.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/audio_quality_badges.dart lib/widgets/audio_quality_badges.dart:94 — lib/widgets/audio_quality_badges.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 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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/services/library_native_adapter.dart lib/services/library_native_adapter.dart:210 — lib/services/library_native_adapter.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 7 (its worst body is LibraryNativeAdapter._import at line 210), 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: lib/models/unified_library_item.dart lib/models/unified_library_item.dart:72 — lib/models/unified_library_item.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 7 (its worst body is UnifiedLibraryItem.fromLocalLibrary at line 72), 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: “refactor(layering): move model files to models and fix inverted imports”; “fix(playlists): serialize collection changes and isolate domain models”; “fix(library): retain Opus badges when bitrate is missing”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00:00' --full-history --no-merges -- lib/models/unified_library_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.
  • 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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: rust_backend/crates/mobile/src/library_metadata.rs rust_backend/crates/mobile/src/library_metadata.rs:51 — rust_backend/crates/mobile/src/library_metadata.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is mornye_mobile::library_metadata::read_library_metadata_from_descriptor at line 51), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 09:08:41 +00:00' --until='2026-10-23 09:08:41 +00: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.
D1 · Cyclomatic Complexity · Backend · ×6
  • Backend::plan_download (cyclomatic 49) rust_backend/crates/extensions/src/backend/downloads.rs:168 — Backend::plan_download 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.
  • Backend::download_attempt (cyclomatic 48) rust_backend/crates/extensions/src/backend/downloads.rs:648 — Backend::download_attempt has cyclomatic complexity 48 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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:353 — 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::reenrich_file (cyclomatic 26) rust_backend/crates/extensions/src/backend/reenrich.rs:18 — 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 23) rust_backend/crates/extensions/src/backend/reenrich.rs:212 — Backend::resolve_reenrich_request 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.
  • 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 · Duplicated block (15 lines × 2) · ×6
  • Duplicated block (15 lines × 2) lib/providers/download_history_provider.dart:596 — lib/providers/download_history_provider.dart:596-610 | lib/providers/download_queue_provider.dart:877-891 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) lib/screens/album_screen.dart:762 — lib/screens/album_screen.dart:762-776 | lib/screens/playlist_screen.dart:478-492 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) lib/screens/downloaded_album_screen.dart:354 — lib/screens/downloaded_album_screen.dart:354-368 | lib/screens/local_album_screen.dart:335-349 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 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 (15 lines × 2) lib/screens/settings/download_settings_page.dart:393 — lib/screens/settings/download_settings_page.dart:393-407 | lib/widgets/download_service_picker.dart:310-324 — before extracting anything, compare `lib/screens/settings/download_settings_page.dart` and `lib/widgets/download_service_picker.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) lib/services/library_queue_store.dart:43 — lib/services/library_queue_store.dart:43-57 | lib/services/library_queue_store.dart:225-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) lib/widgets/download_service_picker.dart:454 — lib/widgets/download_service_picker.dart:454-468 | lib/widgets/download_service_picker.dart:527-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×6
  • Duplicated block (14 lines × 2) lib/models/unified_library_item.dart:43 — lib/models/unified_library_item.dart:43-56 | lib/models/unified_library_item.dart:73-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) lib/screens/album_screen.dart:549 — lib/screens/album_screen.dart:549-562 | lib/screens/downloaded_album_screen.dart:372-385 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) lib/screens/settings/files_settings_page.dart:100 — lib/screens/settings/files_settings_page.dart:100-113 | lib/screens/settings/library_settings_page.dart:106-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) lib/screens/settings/library_settings_page.dart:450 — lib/screens/settings/library_settings_page.dart:450-463 | lib/screens/settings/library_settings_page.dart:526-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) lib/services/library_queue_store.dart:1016 — lib/services/library_queue_store.dart:1016-1029 | lib/services/library_queue_store.dart:1100-1113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) lib/widgets/selection_action_button.dart:24 — lib/widgets/selection_action_button.dart:24-37 | lib/widgets/settings_group.dart:972-985 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
D35 · Change Coupling · Change coupling · ×5
  • 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 74% of the time (57 of the 77 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 57 shared commits counted here, the most recent 3 are `ddb89791` feat(desktop): Apple Music style album, playlist and artist headers; `7b94fe17` feat(desktop): compact detail headers and denser song rows; `c654de57` feat(desktop): show detail screen songs as a sortable table — 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 69% of the time (50 of the 72 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 50 shared commits counted here, the most recent 3 are `6e137fcc` feat(material): mark the current track in catalog and search lists; `483aa5f5` feat(material): give desktop album and artist headers the artwork scheme; `8b062dc3` fix(desktop): keep a right-click selection to its menu — 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 (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). 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 9 shared commits counted here, the most recent 3 are `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`); `c69f2cef` perf(library): scan SAF CUE audio through live descriptors (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: NativeDownloadFinalizer.kt ↔ SafDownloadHandler.kt android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt:1 — `android/app/src/main/kotlin/com/zarz/mornye/NativeDownloadFinalizer.kt` and `android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 9 shared commits counted here, the most recent 3 are `92adce43` refactor(native): share errorJson and retire Go-era names in native c… (at that commit the files were still `android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt` and `android/app/src/main/kotlin/com/zarz/spotiflac/SafDownloadHandler.kt`); `c48406f5` fix(download): resolve missing album folders before publishing (at that commit the files were still `android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt` and `android/app/src/main/kotlin/com/zarz/spotiflac/SafDownloadHandler.kt`); `747dea88` fix(runtime): bound resources and quarantine stalled extensions (at that commit the files were still `android/app/src/main/kotlin/com/zarz/spotiflac/NativeDownloadFinalizer.kt` and `android/app/src/main/kotlin/com/zarz/spotiflac/SafDownloadHandler.kt`) — run `git show` on any of them.
  • Change coupling: mornye_library_screen.dart ↔ queue_tab_filter_widgets.dart lib/screens/mornye_library_screen.dart:1 — `lib/screens/mornye_library_screen.dart` and `lib/screens/queue_tab_filter_widgets.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 `87c92c8d` feat(desktop): add Library context menus, song table and hover play; `080df889` fix(library): recover missing local album artwork from audio; `1d53bf93` feat(rewind): add yearly highlights and seasonal library banners — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×5
  • Duplicated block (21 lines × 2) lib/screens/downloaded_album_screen.dart:405 — lib/screens/downloaded_album_screen.dart:405-425 | lib/screens/local_album_screen.dart:394-414 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) lib/screens/downloaded_album_screen.dart:833 — lib/screens/downloaded_album_screen.dart:833-853 | lib/screens/local_album_screen.dart:794-814 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) lib/screens/track_metadata_screen.dart:553 — lib/screens/track_metadata_screen.dart:553-573 | lib/screens/track_metadata_screen.dart:577-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) lib/services/library_queue_store.dart:1077 — lib/services/library_queue_store.dart:1077-1097 | lib/services/library_queue_store.dart:1149-1169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) 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 (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) lib/services/ffmpeg_support.dart:34 — lib/services/ffmpeg_support.dart:34-44 | lib/services/ffmpeg_support.dart:50-60 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) lib/services/history_database.dart:412 — lib/services/history_database.dart:412-422 | lib/services/history_database.dart:425-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) 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:105 — rust_backend/crates/core/src/tags/write/riff.rs:105-115 | rust_backend/crates/core/src/tags/write/riff.rs:169-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust_backend/crates/extensions/src/backend/cover.rs:368 — rust_backend/crates/extensions/src/backend/cover.rs:368-380 | rust_backend/crates/mobile/src/library_metadata.rs:78-88 — 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.
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 76) rust_backend/crates/extensions/src/manager/providers.rs:206 — ExtensionManager::provider_operation_value has cognitive complexity 76 (threshold 15). Drivers by points: if/else 29 (51 pts), loops 4 (12 pts), match/switch 5 (7 pts), boolean chains 6 (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 · (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.
D2 · Cognitive Complexity · SignedSessionClient · ×4
  • SignedSessionClient::signed_fetch (cognitive 52) rust_backend/crates/extensions/src/signed_session/fetch.rs:7 — SignedSessionClient::signed_fetch has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (43 pts), boolean chains 8, 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.
  • 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.
D1 · Cyclomatic Complexity · ExtensionManager · ×3
  • ExtensionManager::provider_operation_value (cyclomatic 65) rust_backend/crates/extensions/src/manager/providers.rs:206 — ExtensionManager::provider_operation_value has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • 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:491 — 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:417 — 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:618 — 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_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 · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) lib/screens/artist_screen_discography.dart:501 — lib/screens/artist_screen_discography.dart:501-519 | 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.
  • Duplicated block (19 lines × 2) lib/screens/downloaded_album_screen.dart:377 — lib/screens/downloaded_album_screen.dart:377-395 | lib/screens/local_album_screen.dart:349-367 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) lib/screens/settings/download_settings_page.dart:360 — lib/screens/settings/download_settings_page.dart:360-378 | lib/widgets/download_service_picker.dart:277-295 — before extracting anything, compare `lib/screens/settings/download_settings_page.dart` and `lib/widgets/download_service_picker.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 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:465 — lib/screens/artist_screen_discography.dart:465-482 | 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.
  • Duplicated block (18 lines × 2) lib/services/library_queue_store.dart:703 — lib/services/library_queue_store.dart:703-720 | lib/services/library_queue_store.dart:759-776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) lib/widgets/settings_group.dart:567 — lib/widgets/settings_group.dart:567-584 | lib/widgets/settings_group.dart:690-707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) lib/screens/settings/download_settings_page.dart:380 — lib/screens/settings/download_settings_page.dart:380-391 | lib/widgets/download_service_picker.dart:297-308 — before extracting anything, compare `lib/screens/settings/download_settings_page.dart` and `lib/widgets/download_service_picker.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) lib/services/library_ingestion_store.dart:160 — lib/services/library_ingestion_store.dart:160-171 | lib/services/library_ingestion_store.dart:345-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) lib/widgets/animation_utils.dart:917 — lib/widgets/animation_utils.dart:917-928 | lib/widgets/animation_utils.dart:995-1006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×3
  • Duplicated block (9–10 lines × 2) lib/services/app_orientation.dart:57 — lib/services/app_orientation.dart:57-65 | lib/services/shell_navigation_service.dart:222-231 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9–10 lines × 2) lib/services/library_collections_database.dart:205 — lib/services/library_collections_database.dart:205-213 | lib/services/library_collections_database.dart:218-227 — both copies are in the same file, so extract the block into 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:1587 — lib/services/music_player_service.dart:1587-1595 | lib/services/music_player_service.dart:1633-1642 — both copies are in the same file, so extract the 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:63 — 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 38) rust_backend/crates/extensions/src/manifest.rs:357 — ExtensionManifest::validate 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 · 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.
D2 · Cognitive Complexity · ExtensionManifest · ×2
  • ExtensionManifest::deserialize (cognitive 96) rust_backend/crates/extensions/src/manifest.rs:63 — 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 51) rust_backend/crates/extensions/src/manifest.rs:357 — ExtensionManifest::validate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 28 (40 pts), boolean chains 7, 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 · Request · ×2
  • Request::select (cognitive 32) rust_backend/crates/core/src/metadata/reenrich.rs:373 — 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 16) rust_backend/crates/core/src/metadata/reenrich.rs:166 — Request::apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, 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 · 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) lib/screens/settings/cache_management_page.dart:195 — lib/screens/settings/cache_management_page.dart:195-217 | lib/screens/settings/cache_management_page.dart:219-241 | lib/screens/settings/extension_detail_page.dart:566-599 | lib/screens/settings/library_settings_page.dart:243-276 | lib/screens/settings/library_settings_page.dart:312-344 | lib/widgets/duplicate_review_sheet.dart:123-147 — 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.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust_backend/crates/extensions/src/backend/cover.rs:303 — rust_backend/crates/extensions/src/backend/cover.rs:303-394 | rust_backend/crates/extensions/src/backend/cover.rs:402-434 | rust_backend/crates/extensions/src/backend/library.rs:41-55 | rust_backend/crates/extensions/src/backend/library.rs:279-302 | 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 · Duplicated block (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) lib/screens/home_tab.dart:624 — lib/screens/home_tab.dart:624-645 | lib/screens/main_shell.dart:335-356 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (22 lines × 2) lib/screens/settings/extension_detail_page_widgets.dart:687 — lib/screens/settings/extension_detail_page_widgets.dart:687-708 | lib/screens/settings/extension_detail_page_widgets.dart:920-941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) lib/screens/settings/about_page.dart:454 — lib/screens/settings/about_page.dart:454-469 | lib/screens/settings/about_page.dart:732-747 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) lib/screens/settings/cache_management_page.dart:202 — lib/screens/settings/cache_management_page.dart:202-217 | lib/screens/settings/cache_management_page.dart:226-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) lib/widgets/desktop/desktop_mini_player.dart:125 — lib/widgets/desktop/desktop_mini_player.dart:125-139 | lib/widgets/desktop/desktop_now_playing.dart:94-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14–15 lines × 2) lib/widgets/settings_group.dart:504 — lib/widgets/settings_group.dart:504-517 | lib/widgets/settings_group.dart:639-653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) lib/screens/repo_tab.dart:253 — lib/screens/repo_tab.dart:253-266 | lib/screens/repo_tab.dart:273-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) lib/screens/settings/about_page.dart:276 — lib/screens/settings/about_page.dart:276-289 | lib/screens/settings/about_page.dart:583-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×2
  • Duplicated block (13 lines × 2) lib/services/library_schema.dart:241 — lib/services/library_schema.dart:241-253 | lib/services/library_schema.dart:256-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:232 — android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:232-244 | android/app/src/main/kotlin/com/zarz/mornye/MainActivitySafCalls.kt:266-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:232` 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 (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) lib/services/library_queue_store.dart:1230 — lib/services/library_queue_store.dart:1230-1240 | lib/services/library_queue_store.dart:1246-1255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) 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 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) lib/providers/extension_provider.dart:437 — lib/providers/extension_provider.dart:437-445 | lib/providers/extension_provider.dart:520-529 | lib/providers/extension_provider.dart:537-545 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9–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.
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 3 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 3 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/platform_bridge.dart:546 — `customSearchWithExtension` is public, takes a document from its caller (line 2088) and hands it to `_canonicalizeJsonLike`, which calls itself at line 546 (`_canonicalizeJsonLike`) with a piece of `value` (and at line 550) — 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.
  • Recursive walk over a caller-supplied document has no depth cap lib/services/metadata_autofill_service.dart:522 — `coverUrl` is public, takes a document from its caller (line 514) and hands it to `fromValue`, which calls itself at line 522 (`fromValue`) with a piece of `value` (and at line 528) — 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.
D1 · Cyclomatic Complexity · _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cyclomatic 154) · ×1
  • _TrackMetadataScreenState._refreshResolvedAudioMetadataFromFile (cyclomatic 154) lib/screens/track_metadata_screen.dart:302 — _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 101) · ×1
  • _HomeTabState.build (cyclomatic 101) lib/screens/home_tab.dart:758 — _HomeTabState.build has cyclomatic complexity 101 (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 · RustCoreBackendApplicationKt.dispatchApplication (cyclomatic 92) · ×1
  • RustCoreBackendApplicationKt.dispatchApplication (cyclomatic 92) android/app/src/rust/kotlin/com/zarz/mornye/RustCoreBackendApplication.kt:9 — RustCoreBackendApplicationKt.dispatchApplication has cyclomatic complexity 92 (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 91) · ×1
  • RustCoreBackend.invokeApplication (cyclomatic 91) ios/Runner/CoreBackend.swift:643 — RustCoreBackend.invokeApplication has cyclomatic complexity 91 (threshold 15). Of this number, 90 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 · MainActivity.configureFlutterEngine (cyclomatic 85) · ×1
  • MainActivity.configureFlutterEngine (cyclomatic 85) android/app/src/main/kotlin/com/zarz/mornye/MainActivity.kt:420 — MainActivity.configureFlutterEngine has cyclomatic complexity 85 (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 · _NowPlayingScreenState._buildPlayer (cyclomatic 84) · ×1
  • _NowPlayingScreenState._buildPlayer (cyclomatic 84) lib/screens/now_playing_screen.dart:253 — _NowPlayingScreenState._buildPlayer has cyclomatic complexity 84 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into 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._buildLyrics (cyclomatic 82) · ×1
  • _SyncedLyricsViewState._buildLyrics (cyclomatic 82) lib/widgets/player_lyrics.dart:856 — _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 · _DownloadRun._handleDownloadSuccess (cyclomatic 75) · ×1
  • _DownloadRun._handleDownloadSuccess (cyclomatic 75) lib/providers/download_queue_provider_single_item.dart:618 — _DownloadRun._handleDownloadSuccess 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 · DownloadMetadataEmbedding.embed (cyclomatic 75) · ×1
  • DownloadMetadataEmbedding.embed (cyclomatic 75) lib/services/download_metadata_embedding.dart:75 — 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:1544 — 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 · _QueueTabState.build (cyclomatic 74) · ×1
  • _QueueTabState.build (cyclomatic 74) lib/screens/queue_tab.dart:491 — _QueueTabState.build has cyclomatic complexity 74 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NetworkLibraryScanner._scan (cyclomatic 69) · ×1
  • NetworkLibraryScanner._scan (cyclomatic 69) lib/services/network_library_scanner.dart:91 — 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 · _MusicAutoMix._start (cyclomatic 67) · ×1
  • _MusicAutoMix._start (cyclomatic 67) lib/services/music_player_automix.dart:228 — _MusicAutoMix._start has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 · _NetworkStorageScreenState.build (cyclomatic 56) · ×1
  • _NetworkStorageScreenState.build (cyclomatic 56) lib/screens/network_storage_screen.dart:291 — _NetworkStorageScreenState.build has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MainActivitySafScanKt.scanSafTreeIncremental (cyclomatic 52) · ×1
  • MainActivitySafScanKt.scanSafTreeIncremental (cyclomatic 52) REDACTED:542 — MainActivitySafScanKt.scanSafTreeIncremental 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:238 — 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 · SafFileInspectionKt.inspectSafFiles (cyclomatic 52) · ×1
  • SafFileInspectionKt.inspectSafFiles (cyclomatic 52) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:89 — SafFileInspectionKt.inspectSafFiles 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 · MetadataAutofillService.enrich (cyclomatic 51) · ×1
  • MetadataAutofillService.enrich (cyclomatic 51) lib/services/metadata_autofill_service.dart:102 — MetadataAutofillService.enrich 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 · MornyePlayerLayout.build (cyclomatic 49) · ×1
  • MornyePlayerLayout.build (cyclomatic 49) lib/widgets/mornye_player_layout.dart:80 — 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 · _DownloadRun._applyFormatHandling (cyclomatic 45) · ×1
  • _DownloadRun._applyFormatHandling (cyclomatic 45) lib/providers/download_queue_provider_single_item.dart:951 — _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 · MornyeGlass.build (cyclomatic 45) · ×1
  • MornyeGlass.build (cyclomatic 45) lib/widgets/mornye_chrome.dart:213 — MornyeGlass.build has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _PlaybackSettingsPageState.build (cyclomatic 43) · ×1
  • _PlaybackSettingsPageState.build (cyclomatic 43) lib/screens/settings/playback_settings_page.dart:81 — _PlaybackSettingsPageState.build has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MusicPlayerHandler._loadIndex (cyclomatic 42) · ×1
  • MusicPlayerHandler._loadIndex (cyclomatic 42) lib/services/music_player_service.dart:1391 — MusicPlayerHandler._loadIndex 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 · RepoExtension · ×1
  • RepoExtension::deserialize (cyclomatic 40) rust_backend/crates/extensions/src/repository/model.rs:66 — RepoExtension::deserialize 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 · _MainShellState.build (cyclomatic 39) · ×1
  • _MainShellState.build (cyclomatic 39) lib/screens/main_shell.dart:789 — _MainShellState.build has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppDelegate.invokeOsMethod (cyclomatic 39) · ×1
  • AppDelegate.invokeOsMethod (cyclomatic 39) ios/Runner/AppDelegate.swift:479 — 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 · 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 · _LibrarySettingsPageState.build (cyclomatic 37) · ×1
  • _LibrarySettingsPageState.build (cyclomatic 37) lib/screens/settings/library_settings_page.dart:551 — _LibrarySettingsPageState.build has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlayerPlaybackControls.build (cyclomatic 37) · ×1
  • PlayerPlaybackControls.build (cyclomatic 37) lib/widgets/player_playback_controls.dart:52 — PlayerPlaybackControls.build has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LyricsParser._parseTtml (cyclomatic 36) · ×1
  • LyricsParser._parseTtml (cyclomatic 36) lib/utils/lyrics_parser.dart:616 — 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 · _MiniPlayerBodyState.build (cyclomatic 36) · ×1
  • _MiniPlayerBodyState.build (cyclomatic 36) lib/widgets/mini_player.dart:131 — _MiniPlayerBodyState.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:83 — _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:653 — 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 · _AudioFacts._output (cyclomatic 35) · ×1
  • _AudioFacts._output (cyclomatic 35) lib/widgets/audio_info_sheet.dart:553 — _AudioFacts._output 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:128 — _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 · _TrackTableRowViewState.build (cyclomatic 34) · ×1
  • _TrackTableRowViewState.build (cyclomatic 34) lib/widgets/desktop/track_table.dart:546 — _TrackTableRowViewState.build has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _LibrarySearchResultsState.build (cyclomatic 34) · ×1
  • _LibrarySearchResultsState.build (cyclomatic 34) lib/widgets/library_search_results.dart:600 — _LibrarySearchResultsState.build has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SyncedLyricsViewState._maybeAutoScroll (cyclomatic 34) · ×1
  • _SyncedLyricsViewState._maybeAutoScroll (cyclomatic 34) lib/widgets/player_lyrics.dart:735 — _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 · DownloadHistoryNotifier._inspectOrphanedEntries (cyclomatic 33) · ×1
  • DownloadHistoryNotifier._inspectOrphanedEntries (cyclomatic 33) lib/providers/download_history_provider.dart:733 — DownloadHistoryNotifier._inspectOrphanedEntries 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 · _ArtistScreenState._buildPage (cyclomatic 33) · ×1
  • _ArtistScreenState._buildPage (cyclomatic 33) lib/screens/artist_screen.dart:625 — _ArtistScreenState._buildPage 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 · _MusicAutoMix._prepare (cyclomatic 33) · ×1
  • _MusicAutoMix._prepare (cyclomatic 33) lib/services/music_player_automix.dart:100 — _MusicAutoMix._prepare 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 · (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:213 — 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 · DownloadService.processConcurrentNativeRequest (cyclomatic 32) · ×1
  • DownloadService.processConcurrentNativeRequest (cyclomatic 32) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1064 — 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 · ApkDownloader.downloadApk (cyclomatic 31) · ×1
  • ApkDownloader.downloadApk (cyclomatic 31) lib/services/apk_downloader.dart:23 — ApkDownloader.downloadApk 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 · 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 · SignedSessionClient · ×1
  • SignedSessionClient::signed_fetch (cyclomatic 31) rust_backend/crates/extensions/src/signed_session/fetch.rs:7 — SignedSessionClient::signed_fetch 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 · _AlbumScreenState._buildAppBar (cyclomatic 30) · ×1
  • _AlbumScreenState._buildAppBar (cyclomatic 30) lib/screens/album_screen.dart:521 — _AlbumScreenState._buildAppBar 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 · NetworkStorageService.parseListing (cyclomatic 30) · ×1
  • NetworkStorageService.parseListing (cyclomatic 30) lib/services/network_storage_service.dart:728 — NetworkStorageService.parseListing 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 · SafDownloadHandler.handleSafLocked (cyclomatic 30) · ×1
  • SafDownloadHandler.handleSafLocked (cyclomatic 30) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:93 — 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 · _NetworkConnectionFormState.build (cyclomatic 29) · ×1
  • _NetworkConnectionFormState.build (cyclomatic 29) lib/screens/network_storage_screen.dart:796 — _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 · NetworkStorageService._request (cyclomatic 29) · ×1
  • NetworkStorageService._request (cyclomatic 29) lib/services/network_storage_service.dart:464 — NetworkStorageService._request 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:329 — 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 · _MornyeLibraryScreenState.build (cyclomatic 28) · ×1
  • _MornyeLibraryScreenState.build (cyclomatic 28) lib/screens/mornye_library_screen.dart:307 — _MornyeLibraryScreenState.build has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibrarySearchStore.search (cyclomatic 27) · ×1
  • LibrarySearchStore.search (cyclomatic 27) lib/services/library_search.dart:121 — 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 · LocalTrackRedownloadService._scoreMatch (cyclomatic 27) · ×1
  • LocalTrackRedownloadService._scoreMatch (cyclomatic 27) lib/services/local_track_redownload_service.dart:136 — 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 · 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._extractCover (cyclomatic 26) · ×1
  • DownloadedEmbeddedCoverResolver._extractCover (cyclomatic 26) lib/services/downloaded_embedded_cover_resolver.dart:612 — DownloadedEmbeddedCoverResolver._extractCover 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 · 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:209 — 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 · LibraryQueueStore._queueAlbumUnionSql (cyclomatic 26) · ×1
  • LibraryQueueStore._queueAlbumUnionSql (cyclomatic 26) lib/services/library_queue_store.dart:528 — LibraryQueueStore._queueAlbumUnionSql 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 · LibraryQueueStore._appendQueueCommonFilters (cyclomatic 26) · ×1
  • LibraryQueueStore._appendQueueCommonFilters (cyclomatic 26) lib/services/library_queue_store.dart:839 — LibraryQueueStore._appendQueueCommonFilters 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 · _MornyeBottomBarState.build (cyclomatic 26) · ×1
  • _MornyeBottomBarState.build (cyclomatic 26) lib/widgets/mornye_bottom_bar.dart:130 — _MornyeBottomBarState.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:585 — _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 · (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 · PlayerMetadataController.load (cyclomatic 25) · ×1
  • PlayerMetadataController.load (cyclomatic 25) lib/controllers/player_metadata_controller.dart:103 — PlayerMetadataController.load 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:501 — _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 · _LibraryTracksFolderScreenState.build (cyclomatic 25) · ×1
  • _LibraryTracksFolderScreenState.build (cyclomatic 25) lib/screens/library_tracks_folder_screen.dart:254 — _LibraryTracksFolderScreenState.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 · _LibraryTracksFolderScreenState._buildAppBar (cyclomatic 25) · ×1
  • _LibraryTracksFolderScreenState._buildAppBar (cyclomatic 25) lib/screens/library_tracks_folder_screen.dart:652 — _LibraryTracksFolderScreenState._buildAppBar 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:128 — _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:325 — _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 · 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 · 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 · AudioplayersPlaybackDeck.resume (cyclomatic 25) · ×1
  • AudioplayersPlaybackDeck.resume (cyclomatic 25) lib/services/music_playback_deck.dart:429 — AudioplayersPlaybackDeck.resume 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 · _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 · TrackCard._buildCard (cyclomatic 25) · ×1
  • TrackCard._buildCard (cyclomatic 25) lib/widgets/track_card.dart:167 — TrackCard._buildCard 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:373 — 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 54) 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 · ExploreNotifier._restoreFromCache (cyclomatic 24) · ×1
  • ExploreNotifier._restoreFromCache (cyclomatic 24) lib/providers/explore_provider.dart:330 — ExploreNotifier._restoreFromCache 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 · _MainShellState._handleBackPress (cyclomatic 24) · ×1
  • _MainShellState._handleBackPress (cyclomatic 24) lib/screens/main_shell.dart:499 — _MainShellState._handleBackPress 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 · NetworkStorageService._serve (cyclomatic 24) · ×1
  • NetworkStorageService._serve (cyclomatic 24) lib/services/network_storage_service.dart:882 — NetworkStorageService._serve 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 · _UpdateDialogState.build (cyclomatic 24) · ×1
  • _UpdateDialogState.build (cyclomatic 24) lib/widgets/update_dialog.dart:241 — _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 · _CollectionTrackTile.build (cyclomatic 23) · ×1
  • _CollectionTrackTile.build (cyclomatic 23) lib/screens/library_tracks_folder_screen.dart:1064 — _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 · CsvImportService._bestCandidate (cyclomatic 23) · ×1
  • CsvImportService._bestCandidate (cyclomatic 23) lib/services/csv_import_service.dart:186 — 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 · LibraryDatabase.updateAudioMetadata (cyclomatic 23) · ×1
  • LibraryDatabase.updateAudioMetadata (cyclomatic 23) lib/services/library_database.dart:755 — 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 · _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:391 — _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:467 — 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 · Inner · ×1
  • Inner::search (cyclomatic 23) rust_backend/crates/providers/src/lyrics/service.rs:441 — Inner::search 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 · DownloadQueueNotifier._buildDownloadRequestPayload (cyclomatic 22) · ×1
  • DownloadQueueNotifier._buildDownloadRequestPayload (cyclomatic 22) lib/providers/download_queue_provider.dart:503 — 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 · _ExtensionItem.build (cyclomatic 22) · ×1
  • _ExtensionItem.build (cyclomatic 22) lib/screens/repo_tab.dart:938 — _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 · _CacheManagementPageState.build (cyclomatic 22) · ×1
  • _CacheManagementPageState.build (cyclomatic 22) lib/screens/settings/cache_management_page.dart:360 — _CacheManagementPageState.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 · CoverDownloadService.saveRemoteCover (cyclomatic 22) · ×1
  • CoverDownloadService.saveRemoteCover (cyclomatic 22) lib/services/cover_download_service.dart:19 — 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 · 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 · MetadataPersistenceService.save (cyclomatic 22) · ×1
  • MetadataPersistenceService.save (cyclomatic 22) lib/services/metadata_persistence_service.dart:73 — MetadataPersistenceService.save 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 · 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:321 — AlbumDetailHeader._buildAppBar 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 · _ExpressivePlaybackTransportState.build (cyclomatic 22) · ×1
  • _ExpressivePlaybackTransportState.build (cyclomatic 22) lib/widgets/expressive_playback_transport.dart:71 — _ExpressivePlaybackTransportState.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 · _TrackOptionsSheet.build (cyclomatic 22) · ×1
  • _TrackOptionsSheet.build (cyclomatic 22) lib/widgets/track_collection_quick_actions.dart:250 — _TrackOptionsSheet.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 · 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 · DownloadQueueNotifier._startQueueRestore (cyclomatic 21) · ×1
  • DownloadQueueNotifier._startQueueRestore (cyclomatic 21) lib/providers/download_queue_provider.dart:242 — 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 · PlaybackController.playTrackList (cyclomatic 21) · ×1
  • PlaybackController.playTrackList (cyclomatic 21) lib/providers/playback_provider.dart:166 — PlaybackController.playTrackList 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 · _LogScreenState.build (cyclomatic 21) · ×1
  • _LogScreenState.build (cyclomatic 21) lib/screens/settings/log_screen.dart:274 — _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:950 — _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:374 — _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:40 — 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 · AudioplayersPlaybackDeck.setFileSource (cyclomatic 21) · ×1
  • AudioplayersPlaybackDeck.setFileSource (cyclomatic 21) lib/services/music_playback_deck.dart:293 — 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 · MusicPlayerHandler._playInternal (cyclomatic 21) · ×1
  • MusicPlayerHandler._playInternal (cyclomatic 21) lib/services/music_player_service.dart:1745 — MusicPlayerHandler._playInternal 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 · ReplayGainService._writeLocalTags (cyclomatic 21) · ×1
  • ReplayGainService._writeLocalTags (cyclomatic 21) lib/services/replaygain_service.dart:134 — 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 · _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 · _SyncedLyricsViewState._scheduleNextLine (cyclomatic 21) · ×1
  • _SyncedLyricsViewState._scheduleNextLine (cyclomatic 21) lib/widgets/player_lyrics.dart:474 — _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 · 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 · check_backend_ios.audit (cyclomatic 21) · ×1
  • check_backend_ios.audit (cyclomatic 21) scripts/check_backend_ios.py:161 — check_backend_ios.audit 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 · 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._resolveTrackPaths (cyclomatic 20) · ×1
  • PlaybackController._resolveTrackPaths (cyclomatic 20) lib/providers/playback_provider.dart:286 — PlaybackController._resolveTrackPaths 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 · _LibrarySourceSettingsItem.build (cyclomatic 20) · ×1
  • _LibrarySourceSettingsItem.build (cyclomatic 20) lib/screens/settings/library_settings_page_widgets.dart:163 — _LibrarySourceSettingsItem.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 · _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:588 — _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 · AutoplayPreferenceModel.decode (cyclomatic 20) · ×1
  • AutoplayPreferenceModel.decode (cyclomatic 20) lib/services/autoplay_personalization.dart:168 — AutoplayPreferenceModel.decode 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 · MusicPlayerHandler.applySettings (cyclomatic 20) · ×1
  • MusicPlayerHandler.applySettings (cyclomatic 20) lib/services/music_player_service.dart:173 — MusicPlayerHandler.applySettings 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 · MusicPlayerHandler._listenToPlayer (cyclomatic 20) · ×1
  • MusicPlayerHandler._listenToPlayer (cyclomatic 20) lib/services/music_player_service.dart:436 — MusicPlayerHandler._listenToPlayer 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 · SubsonicClient.list (cyclomatic 20) · ×1
  • SubsonicClient.list (cyclomatic 20) lib/services/network_storage_subsonic.dart:295 — 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 · PlatformBridge._ensureBackendEventHandler (cyclomatic 20) · ×1
  • PlatformBridge._ensureBackendEventHandler (cyclomatic 20) lib/services/platform_bridge.dart:303 — PlatformBridge._ensureBackendEventHandler 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 · _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:137 — 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 · UsbDirectPlayback.command (cyclomatic 20) · ×1
  • UsbDirectPlayback.command (cyclomatic 20) android/app/src/main/kotlin/com/zarz/mornye/UsbDirectPlayback.kt:81 — UsbDirectPlayback.command 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:491 — 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 · ExtensionSetting · ×1
  • ExtensionSetting::deserialize (cyclomatic 20) rust_backend/crates/extensions/src/manifest.rs:63 — ExtensionSetting::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 · SignedSession · ×1
  • SignedSession::deserialize (cyclomatic 20) rust_backend/crates/extensions/src/manifest.rs:63 — 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:557 — 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 · _DownloadSettingsPageState.build (cyclomatic 19) · ×1
  • _DownloadSettingsPageState.build (cyclomatic 19) lib/screens/settings/download_settings_page.dart:28 — _DownloadSettingsPageState.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 · AppStateDatabase.migrateRecentAccessFromSharedPreferences (cyclomatic 19) · ×1
  • AppStateDatabase.migrateRecentAccessFromSharedPreferences (cyclomatic 19) lib/services/app_state_database.dart:227 — 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 · AudioAnalysisRunner._getMediaInfo (cyclomatic 19) · ×1
  • AudioAnalysisRunner._getMediaInfo (cyclomatic 19) lib/services/audio_analysis_runner.dart:420 — AudioAnalysisRunner._getMediaInfo 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:973 — 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 · _MusicAutoplay._fill (cyclomatic 19) · ×1
  • _MusicAutoplay._fill (cyclomatic 19) lib/services/music_player_autoplay.dart:234 — _MusicAutoplay._fill 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 · PlatformBridge._scanToNDJSONFile (cyclomatic 19) · ×1
  • PlatformBridge._scanToNDJSONFile (cyclomatic 19) lib/services/platform_bridge.dart:2445 — 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 · 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 · MornyePlayerQueue.build (cyclomatic 19) · ×1
  • MornyePlayerQueue.build (cyclomatic 19) lib/widgets/mornye_player_queue.dart:17 — MornyePlayerQueue.build 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 · SettingsGroup.build (cyclomatic 19) · ×1
  • SettingsGroup.build (cyclomatic 19) lib/widgets/settings_group.dart:246 — SettingsGroup.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 · 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:328 — 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 · _DownloadRun._embedSafNonM4a (cyclomatic 18) · ×1
  • _DownloadRun._embedSafNonM4a (cyclomatic 18) lib/providers/download_queue_provider_single_item.dart:1424 — _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:467 — 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:705 — 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:289 — 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 · AutoplayPreferenceModel._features (cyclomatic 18) · ×1
  • AutoplayPreferenceModel._features (cyclomatic 18) lib/services/autoplay_personalization.dart:53 — AutoplayPreferenceModel._features 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 · AutoplayPersonalization.finish (cyclomatic 18) · ×1
  • AutoplayPersonalization.finish (cyclomatic 18) lib/services/autoplay_personalization.dart:342 — AutoplayPersonalization.finish 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 · DownloadFileFinalizer.decrypt (cyclomatic 18) · ×1
  • DownloadFileFinalizer.decrypt (cyclomatic 18) lib/services/download_file_finalizer.dart:107 — 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:89 — 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 · LibraryCollectionsDatabase.migrateFromSharedPreferences (cyclomatic 18) · ×1
  • LibraryCollectionsDatabase.migrateFromSharedPreferences (cyclomatic 18) lib/services/library_collections_database.dart:171 — 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 · 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:154 — 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 · MusicPlayerHandler.reapplyNormalization (cyclomatic 18) · ×1
  • MusicPlayerHandler.reapplyNormalization (cyclomatic 18) lib/services/music_player_service.dart:925 — 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 · NetworkStorageService.list (cyclomatic 18) · ×1
  • NetworkStorageService.list (cyclomatic 18) lib/services/network_storage_service.dart:603 — NetworkStorageService.list 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 · PlayableMedia.toMediaItem (cyclomatic 18) · ×1
  • PlayableMedia.toMediaItem (cyclomatic 18) lib/services/playable_media.dart:110 — PlayableMedia.toMediaItem 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 · UpdateChecker.checkForUpdate (cyclomatic 18) · ×1
  • UpdateChecker.checkForUpdate (cyclomatic 18) lib/services/update_checker.dart:327 — 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:183 — 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:567 — 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:29 — 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:378 — _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 · _AudioFacts._processing (cyclomatic 18) · ×1
  • _AudioFacts._processing (cyclomatic 18) lib/widgets/audio_info_sheet.dart:483 — _AudioFacts._processing 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 · _BatchConvertSheetState.build (cyclomatic 18) · ×1
  • _BatchConvertSheetState.build (cyclomatic 18) lib/widgets/batch_convert_sheet.dart:83 — _BatchConvertSheetState.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 · _MornyeLandscapePlayerState.build (cyclomatic 18) · ×1
  • _MornyeLandscapePlayerState.build (cyclomatic 18) lib/widgets/mornye_landscape_player.dart:102 — _MornyeLandscapePlayerState.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 · _MotionHeaderBannerState._initialize (cyclomatic 18) · ×1
  • _MotionHeaderBannerState._initialize (cyclomatic 18) lib/widgets/motion_header_banner.dart:115 — _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 · DownloadService.buildNotification (cyclomatic 18) · ×1
  • DownloadService.buildNotification (cyclomatic 18) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1588 — 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:63 — 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:63 — 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:63 — 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:507 — 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:927 — 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:433 — _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:264 — 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 · _SettingItemState._invokeAction (cyclomatic 17) · ×1
  • _SettingItemState._invokeAction (cyclomatic 17) lib/screens/settings/extension_detail_page_widgets.dart:530 — _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:128 — _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:598 — _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:734 — _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 · _SetupScreenState._requestStoragePermission (cyclomatic 17) · ×1
  • _SetupScreenState._requestStoragePermission (cyclomatic 17) lib/screens/setup_screen.dart:230 — _SetupScreenState._requestStoragePermission 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 · AppStateDatabase.getPendingDownloadQueueRows (cyclomatic 17) · ×1
  • AppStateDatabase.getPendingDownloadQueueRows (cyclomatic 17) lib/services/app_state_database.dart:291 — 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:183 — 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 · 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:87 — 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:404 — 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._convertToLossless (cyclomatic 17) · ×1
  • FFmpegConversion._convertToLossless (cyclomatic 17) lib/services/ffmpeg_conversion.dart:356 — FFmpegConversion._convertToLossless 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 · FFmpegConversion._convertToPcm (cyclomatic 17) · ×1
  • FFmpegConversion._convertToPcm (cyclomatic 17) lib/services/ffmpeg_conversion.dart:437 — 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 · LibrarySchema.upgrade (cyclomatic 17) · ×1
  • LibrarySchema.upgrade (cyclomatic 17) lib/services/library_schema.dart:87 — LibrarySchema.upgrade 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 · LocalNetworkAccess._isLocalAddress (cyclomatic 17) · ×1
  • LocalNetworkAccess._isLocalAddress (cyclomatic 17) lib/services/local_network_access.dart:62 — 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 · PlayableMedia.toJson (cyclomatic 17) · ×1
  • PlayableMedia.toJson (cyclomatic 17) lib/services/playable_media.dart:46 — PlayableMedia.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 · LogBuffer.exportWithDeviceInfo (cyclomatic 17) · ×1
  • LogBuffer.exportWithDeviceInfo (cyclomatic 17) lib/utils/logger.dart:313 — LogBuffer.exportWithDeviceInfo 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 · AppIconButton.build (cyclomatic 17) · ×1
  • AppIconButton.build (cyclomatic 17) lib/widgets/app_icon_button.dart:102 — AppIconButton.build has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DesktopSidebar.build (cyclomatic 17) · ×1
  • DesktopSidebar.build (cyclomatic 17) lib/widgets/desktop/desktop_navigation.dart:853 — 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 · _ServiceChip.build (cyclomatic 17) · ×1
  • _ServiceChip.build (cyclomatic 17) lib/widgets/download_service_picker.dart:430 — _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 · _MornyeArtistSurfaceState.build (cyclomatic 17) · ×1
  • _MornyeArtistSurfaceState.build (cyclomatic 17) lib/widgets/mornye_artist_header.dart:43 — _MornyeArtistSurfaceState.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 · PlayerPlaybackModeButton.build (cyclomatic 17) · ×1
  • PlayerPlaybackModeButton.build (cyclomatic 17) lib/widgets/player_playback_controls.dart:316 — PlayerPlaybackModeButton.build has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · 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:264 — 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 · DownloadQueueNotifier.updateItemStatus (cyclomatic 16) · ×1
  • DownloadQueueNotifier.updateItemStatus (cyclomatic 16) lib/providers/download_queue_provider.dart:856 — 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:1590 — _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 · _DownloadedAlbumScreenState._buildAppBar (cyclomatic 16) · ×1
  • _DownloadedAlbumScreenState._buildAppBar (cyclomatic 16) lib/screens/downloaded_album_screen.dart:337 — _DownloadedAlbumScreenState._buildAppBar 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 · 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 · MusicPlayerHandler._refreshPlaybackAutomation (cyclomatic 16) · ×1
  • MusicPlayerHandler._refreshPlaybackAutomation (cyclomatic 16) lib/services/music_player_service.dart:586 — MusicPlayerHandler._refreshPlaybackAutomation 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 · 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 · LibraryTrackSelectionBar.build (cyclomatic 16) · ×1
  • LibraryTrackSelectionBar.build (cyclomatic 16) lib/widgets/library_track_selection_bar.dart:42 — LibraryTrackSelectionBar.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 · MornyeContextMenu._action (cyclomatic 16) · ×1
  • MornyeContextMenu._action (cyclomatic 16) lib/widgets/mornye_context_menu.dart:328 — MornyeContextMenu._action 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 · MornyeLevelSlider.build (cyclomatic 16) · ×1
  • MornyeLevelSlider.build (cyclomatic 16) lib/widgets/mornye_level_slider.dart:59 — MornyeLevelSlider.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:702 — _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:609 — 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:66 — 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 · 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 · NetworkPermissions · ×1
  • NetworkPermissions::validate (cyclomatic 16) rust_backend/crates/network/src/policy.rs:24 — NetworkPermissions::validate 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 · (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:302 — _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 224) · ×1
  • NetworkLibraryScanner._scan (cognitive 224) lib/services/network_library_scanner.dart:91 — NetworkLibraryScanner._scan has cognitive complexity 224 (threshold 15). Drivers by points: if/else 36 (141 pts), error handling 7 (27 pts), boolean chains 19, loops 5 (19 pts), ternaries 5 (18 pts) (nesting depth added 152). 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 165) · ×1
  • _MusicAutoMix._start (cognitive 165) lib/services/music_player_automix.dart:228 — _MusicAutoMix._start has cognitive complexity 165 (threshold 15). Drivers by points: if/else 38 (114 pts), ternaries 11 (31 pts), boolean chains 14, error handling 3 (6 pts) (nesting depth added 99). 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:75 — DownloadMetadataEmbedding.embed has cognitive complexity 163 (threshold 15). Drivers by points: if/else 30 (83 pts), boolean chains 30, error handling 9 (27 pts), ternaries 7 (23 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 131) · ×1
  • SafFileInspectionKt.inspectSafFiles (cognitive 131) android/app/src/main/kotlin/com/zarz/mornye/SafFileInspection.kt:89 — SafFileInspectionKt.inspectSafFiles has cognitive complexity 131 (threshold 15). Drivers by points: if/else 29 (76 pts), loops 14 (30 pts), error handling 6 (16 pts), boolean chains 9 (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 115) · ×1
  • MainActivitySafScanKt.scanSafTreeIncremental (cognitive 115) REDACTED:542 — MainActivitySafScanKt.scanSafTreeIncremental has cognitive complexity 115 (threshold 15). Drivers by points: if/else 38 (80 pts), loops 8 (15 pts), error handling 7 (14 pts), boolean chains 6 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncedLyricsViewState._buildLyrics (cognitive 108) · ×1
  • _SyncedLyricsViewState._buildLyrics (cognitive 108) lib/widgets/player_lyrics.dart:856 — _SyncedLyricsViewState._buildLyrics has cognitive complexity 108 (threshold 15). Drivers by points: ternaries 36 (54 pts), boolean chains 29, if/else 17 (22 pts), loops 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomeTabState.build (cognitive 102) · ×1
  • _HomeTabState.build (cognitive 102) lib/screens/home_tab.dart:758 — _HomeTabState.build has cognitive complexity 102 (threshold 15). Drivers by points: boolean chains 78, 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 · _NowPlayingScreenState._buildPlayer (cognitive 102) · ×1
  • _NowPlayingScreenState._buildPlayer (cognitive 102) lib/screens/now_playing_screen.dart:253 — _NowPlayingScreenState._buildPlayer has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 37 (51 pts), boolean chains 29, if/else 18 (22 pts) (nesting depth added 18). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · DownloadQueueNotifier._processQueueSingleFlight (cognitive 97) · ×1
  • DownloadQueueNotifier._processQueueSingleFlight (cognitive 97) lib/providers/download_queue_provider.dart:1544 — 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 95) · ×1
  • _DownloadRun._handleDownloadSuccess (cognitive 95) lib/providers/download_queue_provider_single_item.dart:618 — _DownloadRun._handleDownloadSuccess has cognitive complexity 95 (threshold 15). Drivers by points: if/else 27 (41 pts), boolean chains 34, 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 · LyricsParser._parseTtml (cognitive 92) · ×1
  • LyricsParser._parseTtml (cognitive 92) lib/utils/lyrics_parser.dart:616 — 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 · _NetworkStorageScreenState.build (cognitive 90) · ×1
  • _NetworkStorageScreenState.build (cognitive 90) lib/screens/network_storage_screen.dart:291 — _NetworkStorageScreenState.build has cognitive complexity 90 (threshold 15). Drivers by points: ternaries 27 (55 pts), if/else 13 (20 pts), boolean chains 15 (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.
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:238 — 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 · DownloadHistoryNotifier._inspectOrphanedEntries (cognitive 77) · ×1
  • DownloadHistoryNotifier._inspectOrphanedEntries (cognitive 77) lib/providers/download_history_provider.dart:733 — DownloadHistoryNotifier._inspectOrphanedEntries has cognitive complexity 77 (threshold 15). Drivers by points: if/else 15 (48 pts), loops 6 (12 pts), boolean chains 8, ternaries 2 (5 pts), error handling 2 (4 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 · _QueueTabState.build (cognitive 77) · ×1
  • _QueueTabState.build (cognitive 77) lib/screens/queue_tab.dart:491 — _QueueTabState.build has cognitive complexity 77 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 27, ternaries 17 (18 pts), match/switch 2 (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 · MetadataAutofillService.enrich (cognitive 75) · ×1
  • MetadataAutofillService.enrich (cognitive 75) lib/services/metadata_autofill_service.dart:102 — MetadataAutofillService.enrich has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 19, error handling 4 (9 pts), ternaries 7, 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 · BackupService._parseArchive (cognitive 73) · ×1
  • BackupService._parseArchive (cognitive 73) lib/services/backup_service.dart:653 — 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 · MusicPlayerHandler._loadIndex (cognitive 73) · ×1
  • MusicPlayerHandler._loadIndex (cognitive 73) lib/services/music_player_service.dart:1391 — MusicPlayerHandler._loadIndex has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (54 pts), error handling 5 (8 pts), ternaries 3 (6 pts), boolean chains 5 (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 · BackupService.writeBackupArchive (cognitive 72) · ×1
  • BackupService.writeBackupArchive (cognitive 72) lib/services/backup_service.dart:213 — 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 · _PlaybackSettingsPageState.build (cognitive 69) · ×1
  • _PlaybackSettingsPageState.build (cognitive 69) lib/screens/settings/playback_settings_page.dart:81 — _PlaybackSettingsPageState.build has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (39 pts), ternaries 7 (20 pts), boolean chains 6, match/switch 1 (3 pts), loops 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _DownloadRun._run (cognitive 67) · ×1
  • _DownloadRun._run (cognitive 67) lib/providers/download_queue_provider_single_item.dart:128 — _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 · _LibrarySearchResultsState.build (cognitive 67) · ×1
  • _LibrarySearchResultsState.build (cognitive 67) lib/widgets/library_search_results.dart:600 — _LibrarySearchResultsState.build has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 10 (30 pts), if/else 12 (24 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 34). 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 · LyricsParser._parseLrcOrPlain (cognitive 65) · ×1
  • LyricsParser._parseLrcOrPlain (cognitive 65) lib/utils/lyrics_parser.dart:329 — 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 · DownloadService.processConcurrentNativeRequest (cognitive 65) · ×1
  • DownloadService.processConcurrentNativeRequest (cognitive 65) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:1064 — 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 · PlayerPlaybackControls.build (cognitive 64) · ×1
  • PlayerPlaybackControls.build (cognitive 64) lib/widgets/player_playback_controls.dart:52 — PlayerPlaybackControls.build has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 23 (40 pts), if/else 15 (20 pts), boolean chains 4 (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 · RepoExtension · ×1
  • RepoExtension::deserialize (cognitive 64) rust_backend/crates/extensions/src/repository/model.rs:66 — RepoExtension::deserialize has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (38 pts), match/switch 19 (25 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SafDownloadHandler.handleSafLocked (cognitive 62) · ×1
  • SafDownloadHandler.handleSafLocked (cognitive 62) android/app/src/main/kotlin/com/zarz/mornye/SafDownloadHandler.kt:93 — 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 · MornyePlayerLayout.build (cognitive 61) · ×1
  • MornyePlayerLayout.build (cognitive 61) lib/widgets/mornye_player_layout.dart:80 — MornyePlayerLayout.build has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 27 (39 pts), boolean chains 14, if/else 5 (6 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MusicAutoMix._prepare (cognitive 60) · ×1
  • _MusicAutoMix._prepare (cognitive 60) lib/services/music_player_automix.dart:100 — _MusicAutoMix._prepare has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 7, ternaries 4 (6 pts), error handling 2 (5 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ApkDownloader.downloadApk (cognitive 59) · ×1
  • ApkDownloader.downloadApk (cognitive 59) lib/services/apk_downloader.dart:23 — ApkDownloader.downloadApk has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (44 pts), boolean chains 6, ternaries 2 (4 pts), error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _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 · _LibrarySettingsPageState.build (cognitive 57) · ×1
  • _LibrarySettingsPageState.build (cognitive 57) lib/screens/settings/library_settings_page.dart:551 — _LibrarySettingsPageState.build has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 23 (41 pts), boolean chains 8, if/else 5 (7 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SetupScreenState._selectDirectory (cognitive 56) · ×1
  • _SetupScreenState._selectDirectory (cognitive 56) lib/screens/setup_screen.dart:374 — _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:951 — _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 · DownloadedEmbeddedCoverResolver._extractCover (cognitive 54) · ×1
  • DownloadedEmbeddedCoverResolver._extractCover (cognitive 54) lib/services/downloaded_embedded_cover_resolver.dart:612 — DownloadedEmbeddedCoverResolver._extractCover has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (46 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkStorageService._serve (cognitive 54) · ×1
  • NetworkStorageService._serve (cognitive 54) lib/services/network_storage_service.dart:882 — NetworkStorageService._serve has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (26 pts), ternaries 4 (11 pts), error handling 5 (10 pts), boolean chains 4, loops 1 (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 · 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 · _AudioFacts._output (cognitive 53) · ×1
  • _AudioFacts._output (cognitive 53) lib/widgets/audio_info_sheet.dart:553 — _AudioFacts._output has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (34 pts), ternaries 4 (9 pts), boolean chains 8, loops 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 · 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 · _MiniPlayerBodyState.build (cognitive 50) · ×1
  • _MiniPlayerBodyState.build (cognitive 50) lib/widgets/mini_player.dart:131 — _MiniPlayerBodyState.build has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 24 (37 pts), if/else 7 (8 pts), boolean chains 5 (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 · 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 · RustCoreBackend.invokeApplication (cognitive 50) · ×1
  • RustCoreBackend.invokeApplication (cognitive 50) ios/Runner/CoreBackend.swift:643 — RustCoreBackend.invokeApplication has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (33 pts), ternaries 5 (11 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 21). Of this number, 49 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 · _MainShellState.build (cognitive 49) · ×1
  • _MainShellState.build (cognitive 49) lib/screens/main_shell.dart:789 — _MainShellState.build has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 14 (22 pts), if/else 16 (19 pts), boolean chains 7, 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 · _MornyeLibraryScreenState.build (cognitive 49) · ×1
  • _MornyeLibraryScreenState.build (cognitive 49) lib/screens/mornye_library_screen.dart:307 — _MornyeLibraryScreenState.build has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (34 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 · ExploreNotifier._restoreFromCache (cognitive 48) · ×1
  • ExploreNotifier._restoreFromCache (cognitive 48) lib/providers/explore_provider.dart:330 — ExploreNotifier._restoreFromCache has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (36 pts), ternaries 3 (6 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadedEmbeddedCoverResolver._drainPreviewValidations (cognitive 48) · ×1
  • DownloadedEmbeddedCoverResolver._drainPreviewValidations (cognitive 48) lib/services/downloaded_embedded_cover_resolver.dart:404 — 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 · Inner · ×1
  • Inner::search (cognitive 48) rust_backend/crates/providers/src/lyrics/service.rs:441 — Inner::search has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 2 (7 pts), loops 3 (4 pts), boolean chains 3 (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 · 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 20 (32 pts), error handling 3 (6 pts), match/switch 4 (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 · MornyeGlass.build (cognitive 45) · ×1
  • MornyeGlass.build (cognitive 45) lib/widgets/mornye_chrome.dart:213 — MornyeGlass.build has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 22 (23 pts), boolean chains 20, if/else 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AudioAnalysisCache.trim (cognitive 44) · ×1
  • AudioAnalysisCache.trim (cognitive 44) lib/services/audio_analysis_cache.dart:183 — 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 · NetworkStorageService.parseListing (cognitive 44) · ×1
  • NetworkStorageService.parseListing (cognitive 44) lib/services/network_storage_service.dart:728 — NetworkStorageService.parseListing has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 13, loops 3 (5 pts), error handling 1 (4 pts), 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 · PlaybackController.playTrackList (cognitive 43) · ×1
  • PlaybackController.playTrackList (cognitive 43) lib/providers/playback_provider.dart:166 — PlaybackController.playTrackList has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (32 pts), ternaries 2 (6 pts), loops 3 (5 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 · _SetupScreenState._requestStoragePermission (cognitive 43) · ×1
  • _SetupScreenState._requestStoragePermission (cognitive 43) lib/screens/setup_screen.dart:230 — _SetupScreenState._requestStoragePermission has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 1, 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 · 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 · AudioplayersPlaybackDeck.setFileSource (cognitive 43) · ×1
  • AudioplayersPlaybackDeck.setFileSource (cognitive 43) lib/services/music_playback_deck.dart:293 — 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 · _TimedLyricSweepPainter.paint (cognitive 43) · ×1
  • _TimedLyricSweepPainter.paint (cognitive 43) lib/widgets/player_lyrics_word_sweep.dart:585 — _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:507 — 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 · MetadataPersistenceService.save (cognitive 42) · ×1
  • MetadataPersistenceService.save (cognitive 42) lib/services/metadata_persistence_service.dart:73 — MetadataPersistenceService.save has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (21 pts), error handling 4 (9 pts), boolean chains 5, ternaries 2 (4 pts), loops 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 · 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 · _SyncedLyricsViewState._maybeAutoScroll (cognitive 42) · ×1
  • _SyncedLyricsViewState._maybeAutoScroll (cognitive 42) lib/widgets/player_lyrics.dart:735 — _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 · _ArtistScreenState._buildPage (cognitive 41) · ×1
  • _ArtistScreenState._buildPage (cognitive 41) lib/screens/artist_screen.dart:625 — _ArtistScreenState._buildPage has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 13, ternaries 4 (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 · CoverDownloadService.saveRemoteCover (cognitive 41) · ×1
  • CoverDownloadService.saveRemoteCover (cognitive 41) lib/services/cover_download_service.dart:19 — 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:327 — 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 · _TrackTableRowViewState.build (cognitive 41) · ×1
  • _TrackTableRowViewState.build (cognitive 41) lib/widgets/desktop/track_table.dart:546 — _TrackTableRowViewState.build has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 16 (23 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 · _LibrarySettingsPageState._pickLibraryFolder (cognitive 40) · ×1
  • _LibrarySettingsPageState._pickLibraryFolder (cognitive 40) lib/screens/settings/library_settings_page.dart:128 — _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 · _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 · _UpdateDialogState.build (cognitive 39) · ×1
  • _UpdateDialogState.build (cognitive 39) lib/widgets/update_dialog.dart:241 — _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 · _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:796 — _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:530 — _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 · LibraryQueueStore._queueAlbumUnionSql (cognitive 38) · ×1
  • LibraryQueueStore._queueAlbumUnionSql (cognitive 38) lib/services/library_queue_store.dart:528 — LibraryQueueStore._queueAlbumUnionSql has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 16 (29 pts), boolean chains 6, if/else 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 · _ExtensionDetailPageState.build (cognitive 37) · ×1
  • _ExtensionDetailPageState.build (cognitive 37) lib/screens/settings/extension_detail_page.dart:83 — _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:588 — _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._request (cognitive 37) · ×1
  • NetworkStorageService._request (cognitive 37) lib/services/network_storage_service.dart:464 — NetworkStorageService._request has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 11, error handling 3 (4 pts), loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SafTreeListingKt.querySafChildrenOrThrow (cognitive 37) · ×1
  • SafTreeListingKt.querySafChildrenOrThrow (cognitive 37) android/app/src/main/kotlin/com/zarz/mornye/SafTreeListing.kt:137 — 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 · _CacheManagementPageState.build (cognitive 36) · ×1
  • _CacheManagementPageState.build (cognitive 36) lib/screens/settings/cache_management_page.dart:360 — _CacheManagementPageState.build has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 12 (23 pts), if/else 5 (8 pts), boolean chains 5 (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 · LibraryCollectionsDatabase.replaceDatabaseFromBackup (cognitive 36) · ×1
  • LibraryCollectionsDatabase.replaceDatabaseFromBackup (cognitive 36) lib/services/library_collections_database.dart:973 — 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 · 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 · ExtensionSetting · ×1
  • ExtensionSetting::deserialize (cognitive 36) rust_backend/crates/extensions/src/manifest.rs:63 — ExtensionSetting::deserialize has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 9 (17 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 · _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 · PlayerMetadataController.load (cognitive 35) · ×1
  • PlayerMetadataController.load (cognitive 35) lib/controllers/player_metadata_controller.dart:103 — PlayerMetadataController.load has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 7, 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 · DownloadQueueNotifier._startQueueRestore (cognitive 35) · ×1
  • DownloadQueueNotifier._startQueueRestore (cognitive 35) lib/providers/download_queue_provider.dart:242 — 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:264 — 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:289 — 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 · _RepoTabState.build (cognitive 35) · ×1
  • _RepoTabState.build (cognitive 35) lib/screens/repo_tab.dart:67 — _RepoTabState.build has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SettingsTabState._buildList (cognitive 35) · ×1
  • _SettingsTabState._buildList (cognitive 35) lib/screens/settings/settings_tab.dart:734 — _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 · LibrarySearchStore.search (cognitive 35) · ×1
  • LibrarySearchStore.search (cognitive 35) lib/services/library_search.dart:121 — 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 · ExtensionNotifier.restoreFromBackup (cognitive 34) · ×1
  • ExtensionNotifier.restoreFromBackup (cognitive 34) lib/providers/extension_provider.dart:705 — 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:227 — 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 · SignedSession · ×1
  • SignedSession::deserialize (cognitive 34) rust_backend/crates/extensions/src/manifest.rs:63 — 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 · _LibraryHeroCard.build (cognitive 33) · ×1
  • _LibraryHeroCard.build (cognitive 33) lib/screens/settings/library_settings_page_widgets.dart:325 — _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 · AudioplayersPlaybackDeck.resume (cognitive 33) · ×1
  • AudioplayersPlaybackDeck.resume (cognitive 33) lib/services/music_playback_deck.dart:429 — AudioplayersPlaybackDeck.resume has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 9, 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 · _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 · 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:63 — 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:63 — 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 · PlaybackController._resolveTrackPaths (cognitive 32) · ×1
  • PlaybackController._resolveTrackPaths (cognitive 32) lib/providers/playback_provider.dart:286 — PlaybackController._resolveTrackPaths has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 6 (8 pts), boolean chains 3, ternaries 2 (3 pts), 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 · 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:171 — 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 · Vm · ×1
  • Vm::call (cognitive 32) rust_backend/crates/extensions/src/runtime/vm.rs:328 — 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 · LocalTrackRedownloadService._scoreMatch (cognitive 31) · ×1
  • LocalTrackRedownloadService._scoreMatch (cognitive 31) lib/services/local_track_redownload_service.dart:136 — 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:467 — 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:63 — 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 · AlbumDetailHeader._buildAppBar (cognitive 30) · ×1
  • AlbumDetailHeader._buildAppBar (cognitive 30) lib/widgets/album_detail_header.dart:321 — AlbumDetailHeader._buildAppBar has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 10 (16 pts), if/else 11 (12 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 · _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 · _AlbumScreenState._buildAppBar (cognitive 29) · ×1
  • _AlbumScreenState._buildAppBar (cognitive 29) lib/screens/album_screen.dart:521 — _AlbumScreenState._buildAppBar has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 21, boolean chains 7, if/else 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _FilesSettingsPageState.build (cognitive 29) · ×1
  • _FilesSettingsPageState.build (cognitive 29) lib/screens/settings/files_settings_page.dart:128 — _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:291 — 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 · NetworkStorageService.list (cognitive 29) · ×1
  • NetworkStorageService.list (cognitive 29) lib/services/network_storage_service.dart:603 — NetworkStorageService.list has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (3 pts), 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 · _MornyeBottomBarState.build (cognitive 29) · ×1
  • _MornyeBottomBarState.build (cognitive 29) lib/widgets/mornye_bottom_bar.dart:130 — _MornyeBottomBarState.build has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 23 (27 pts), boolean chains 1, 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 · 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 · (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 · (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 · RecentAccessNotifier._loadHistory (cognitive 28) · ×1
  • RecentAccessNotifier._loadHistory (cognitive 28) lib/providers/recent_access_provider.dart:141 — 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 · ContentUriPlaybackCache.resolve (cognitive 28) · ×1
  • ContentUriPlaybackCache.resolve (cognitive 28) lib/services/content_uri_playback_cache.dart:40 — 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 · 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 · _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 · TrackCard._buildCard (cognitive 28) · ×1
  • TrackCard._buildCard (cognitive 28) lib/widgets/track_card.dart:167 — TrackCard._buildCard has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 10, 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 · _TrackOptionsSheet.build (cognitive 28) · ×1
  • _TrackOptionsSheet.build (cognitive 28) lib/widgets/track_collection_quick_actions.dart:250 — _TrackOptionsSheet.build has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 12 (15 pts), if/else 9 (12 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · UsbDirectPlayback.command (cognitive 28) · ×1
  • UsbDirectPlayback.command (cognitive 28) android/app/src/main/kotlin/com/zarz/mornye/UsbDirectPlayback.kt:81 — UsbDirectPlayback.command has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), error handling 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_backend_ios.audit (cognitive 28) · ×1
  • check_backend_ios.audit (cognitive 28) scripts/check_backend_ios.py:161 — check_backend_ios.audit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 7, 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 · AppDelegate.invokeOsMethod (cognitive 28) · ×1
  • AppDelegate.invokeOsMethod (cognitive 28) ios/Runner/AppDelegate.swift:479 — 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:467 — 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 · _MainShellState._desktopDestinations (cognitive 27) · ×1
  • _MainShellState._desktopDestinations (cognitive 27) lib/screens/main_shell.dart:598 — _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 · 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:186 — 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:975 — 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 · MetadataAutofillService.resolveDetails (cognitive 27) · ×1
  • MetadataAutofillService.resolveDetails (cognitive 27) lib/services/metadata_autofill_service.dart:53 — MetadataAutofillService.resolveDetails has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (5 pts), ternaries 1 (4 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MusicAutoplay._fill (cognitive 27) · ×1
  • _MusicAutoplay._fill (cognitive 27) lib/services/music_player_autoplay.dart:234 — _MusicAutoplay._fill has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 10, error handling 2 (4 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 · 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 · _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:702 — _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 · 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:1590 — _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:501 — _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 · _LibraryTracksFolderScreenState.build (cognitive 26) · ×1
  • _LibraryTracksFolderScreenState.build (cognitive 26) lib/screens/library_tracks_folder_screen.dart:254 — _LibraryTracksFolderScreenState.build has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 5 (6 pts), loops 2 (4 pts), match/switch 4 (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 · _NowPlayingScreenState._showLyricsOptions (cognitive 26) · ×1
  • _NowPlayingScreenState._showLyricsOptions (cognitive 26) lib/screens/now_playing_screen.dart:905 — _NowPlayingScreenState._showLyricsOptions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (8 pts), loops 3 (6 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 · _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 · AutoplayPreferenceModel.decode (cognitive 26) · ×1
  • AutoplayPreferenceModel.decode (cognitive 26) lib/services/autoplay_personalization.dart:168 — AutoplayPreferenceModel.decode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 11, 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 · DownloadFileFinalizer.decrypt (cognitive 26) · ×1
  • DownloadFileFinalizer.decrypt (cognitive 26) lib/services/download_file_finalizer.dart:107 — 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 · DownloadFileFinalizer.autoConvert (cognitive 26) · ×1
  • DownloadFileFinalizer.autoConvert (cognitive 26) lib/services/download_file_finalizer.dart:187 — DownloadFileFinalizer.autoConvert has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 3, error handling 2, 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 · M3uPlaylistService.exportPathFor (cognitive 26) · ×1
  • M3uPlaylistService.exportPathFor (cognitive 26) lib/services/m3u_playlist_service.dart:119 — 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 · 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 · _DownloadRun._convertSafM4aToFlac (cognitive 25) · ×1
  • _DownloadRun._convertSafM4aToFlac (cognitive 25) lib/providers/download_queue_provider_single_item.dart:1209 — _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 · _LibraryTracksFolderScreenState._buildAppBar (cognitive 25) · ×1
  • _LibraryTracksFolderScreenState._buildAppBar (cognitive 25) lib/screens/library_tracks_folder_screen.dart:652 — _LibraryTracksFolderScreenState._buildAppBar has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10, boolean chains 8, if/else 6 (7 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 · _ExtensionDetailsScreenState._buildInfoCard (cognitive 25) · ×1
  • _ExtensionDetailsScreenState._buildInfoCard (cognitive 25) lib/screens/repo/extension_details_screen.dart:164 — _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 · _SetupScreenState._requestNotificationPermission (cognitive 25) · ×1
  • _SetupScreenState._requestNotificationPermission (cognitive 25) lib/screens/setup_screen.dart:315 — _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 · LibraryDatabase.updateAudioMetadata (cognitive 25) · ×1
  • LibraryDatabase.updateAudioMetadata (cognitive 25) lib/services/library_database.dart:755 — 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 · 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 · 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:295 — 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 · 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 · (anonymous).invokeVerified (cognitive 25) · ×1
  • (anonymous).invokeVerified (cognitive 25) rust_backend/crates/extensions/src/provider.js:309 — (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:927 — 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:1120 — 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 · _MainShellState._handleBackPress (cognitive 24) · ×1
  • _MainShellState._handleBackPress (cognitive 24) lib/screens/main_shell.dart:499 — _MainShellState._handleBackPress has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 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 · _SetupScreenState._completeSetup (cognitive 24) · ×1
  • _SetupScreenState._completeSetup (cognitive 24) lib/screens/setup_screen.dart:602 — _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:87 — 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:205 — 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 · AudioplayersPlaybackDeck._syncEqualizer (cognitive 24) · ×1
  • AudioplayersPlaybackDeck._syncEqualizer (cognitive 24) lib/services/music_playback_deck.dart:154 — 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 · MusicPlayerHandler._playInternal (cognitive 24) · ×1
  • MusicPlayerHandler._playInternal (cognitive 24) lib/services/music_player_service.dart:1745 — MusicPlayerHandler._playInternal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 10, 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 · SubsonicClient.catalog (cognitive 24) · ×1
  • SubsonicClient.catalog (cognitive 24) lib/services/network_storage_subsonic.dart:393 — SubsonicClient.catalog has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlatformBridge._ensureBackendEventHandler (cognitive 24) · ×1
  • PlatformBridge._ensureBackendEventHandler (cognitive 24) lib/services/platform_bridge.dart:303 — PlatformBridge._ensureBackendEventHandler has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (5 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:183 — 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 · _DownloadServicePickerState.build (cognitive 24) · ×1
  • _DownloadServicePickerState.build (cognitive 24) lib/widgets/download_service_picker.dart:148 — _DownloadServicePickerState.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (7 pts), loops 3 (5 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 · _ServiceChip.build (cognitive 24) · ×1
  • _ServiceChip.build (cognitive 24) lib/widgets/download_service_picker.dart:430 — _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 · SettingsGroup.build (cognitive 24) · ×1
  • SettingsGroup.build (cognitive 24) lib/widgets/settings_group.dart:246 — SettingsGroup.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5 (7 pts), boolean chains 6, loops 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 · Cover · ×1
  • Cover::cached (cognitive 24) rust_backend/crates/extensions/src/backend/cover.rs:85 — 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:503 — 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 · _ArtistScreenState._fetchDiscography (cognitive 23) · ×1
  • _ArtistScreenState._fetchDiscography (cognitive 23) lib/screens/artist_screen.dart:304 — _ArtistScreenState._fetchDiscography has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, 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 · _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:1064 — _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 · _NetworkConnectionFormState._save (cognitive 23) · ×1
  • _NetworkConnectionFormState._save (cognitive 23) lib/screens/network_storage_screen.dart:620 — _NetworkConnectionFormState._save has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (7 pts), boolean chains 4, 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 · AudioAnalysisRunner.runAnalysis (cognitive 23) · ×1
  • AudioAnalysisRunner.runAnalysis (cognitive 23) lib/services/audio_analysis_runner.dart:161 — 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:310 — 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:488 — 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 · M3uPlaylistService.parseM3u (cognitive 23) · ×1
  • M3uPlaylistService.parseM3u (cognitive 23) lib/services/m3u_playlist_service.dart:40 — M3uPlaylistService.parseM3u 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 · NetworkMetadataService._load (cognitive 23) · ×1
  • NetworkMetadataService._load (cognitive 23) lib/services/network_metadata_service.dart:104 — NetworkMetadataService._load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 3 (8 pts), boolean chains 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 · ReplayGainService._writeLocalTags (cognitive 23) · ×1
  • ReplayGainService._writeLocalTags (cognitive 23) lib/services/replaygain_service.dart:134 — 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 · WeeklyReleaseService.load (cognitive 23) · ×1
  • WeeklyReleaseService.load (cognitive 23) lib/services/weekly_releases.dart:96 — WeeklyReleaseService.load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (5 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HomeSearchSkeleton._sectionSkeleton (cognitive 23) · ×1
  • HomeSearchSkeleton._sectionSkeleton (cognitive 23) lib/widgets/animation_utils.dart:1144 — HomeSearchSkeleton._sectionSkeleton has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 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 · AppChoiceChip.build (cognitive 23) · ×1
  • AppChoiceChip.build (cognitive 23) lib/widgets/app_choice_chip.dart:29 — 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 · _ExpressivePlaybackTransportState.build (cognitive 23) · ×1
  • _ExpressivePlaybackTransportState.build (cognitive 23) lib/widgets/expressive_playback_transport.dart:71 — _ExpressivePlaybackTransportState.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9, 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 · _LibrarySearchResultsState._open (cognitive 23) · ×1
  • _LibrarySearchResultsState._open (cognitive 23) lib/widgets/library_search_results.dart:315 — _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:66 — 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 · 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:406 — 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:730 — 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 · _NetworkStorageScreenState._play (cognitive 22) · ×1
  • _NetworkStorageScreenState._play (cognitive 22) lib/screens/network_storage_screen.dart:217 — _NetworkStorageScreenState._play has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 4 (7 pts), loops 1 (2 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 · _QueueLibraryPageData.fromHistorySnapshot (cognitive 22) · ×1
  • _QueueLibraryPageData.fromHistorySnapshot (cognitive 22) lib/screens/queue_tab_helpers.dart:267 — _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 · DesktopDiagnostics._osCrashReportSince (cognitive 22) · ×1
  • DesktopDiagnostics._osCrashReportSince (cognitive 22) lib/services/desktop_diagnostics.dart:334 — 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:209 — 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 · LibrarySchema.upgrade (cognitive 22) · ×1
  • LibrarySchema.upgrade (cognitive 22) lib/services/library_schema.dart:87 — LibrarySchema.upgrade has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MusicAutoMix._alignIncoming (cognitive 22) · ×1
  • _MusicAutoMix._alignIncoming (cognitive 22) lib/services/music_player_automix.dart:517 — _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._configureAudioSession (cognitive 22) · ×1
  • MusicPlayerHandler._configureAudioSession (cognitive 22) lib/services/music_player_service.dart:525 — MusicPlayerHandler._configureAudioSession 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 · MusicPlayerHandler.customAction (cognitive 22) · ×1
  • MusicPlayerHandler.customAction (cognitive 22) lib/services/music_player_service.dart:792 — 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 · _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 · SettingsSegmentedChoice.build (cognitive 22) · ×1
  • SettingsSegmentedChoice.build (cognitive 22) lib/widgets/settings_group.dart:895 — 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:1588 — 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:63 — 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 · DownloadQueueNotifier._processQueue (cognitive 21) · ×1
  • DownloadQueueNotifier._processQueue (cognitive 21) lib/providers/download_queue_provider.dart:1499 — 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:1350 — _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:938 — _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 · _LibrarySourceSettingsItem.build (cognitive 21) · ×1
  • _LibrarySourceSettingsItem.build (cognitive 21) lib/screens/settings/library_settings_page_widgets.dart:163 — _LibrarySourceSettingsItem.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13, 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 · AppStateDatabase._writeQueueChanges (cognitive 21) · ×1
  • AppStateDatabase._writeQueueChanges (cognitive 21) lib/services/app_state_database.dart:466 — 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 · 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 · LibrarySchema.migrateIosContainerPaths (cognitive 21) · ×1
  • LibrarySchema.migrateIosContainerPaths (cognitive 21) lib/services/library_schema.dart:417 — LibrarySchema.migrateIosContainerPaths has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (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 · MediaKitPlaybackDeck._syncEqualizer (cognitive 21) · ×1
  • MediaKitPlaybackDeck._syncEqualizer (cognitive 21) lib/services/media_kit_playback_deck.dart:506 — 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 · PlatformBridge._scanToNDJSONFile (cognitive 21) · ×1
  • PlatformBridge._scanToNDJSONFile (cognitive 21) lib/services/platform_bridge.dart:2445 — 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:498 — 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 · HeaderCircleButton.build (cognitive 21) · ×1
  • HeaderCircleButton.build (cognitive 21) lib/widgets/album_detail_header.dart:832 — HeaderCircleButton.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 3 (4 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 · _AudioFacts._processing (cognitive 21) · ×1
  • _AudioFacts._processing (cognitive 21) lib/widgets/audio_info_sheet.dart:483 — _AudioFacts._processing has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 5 (7 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 · _BatchConvertSheetState.build (cognitive 21) · ×1
  • _BatchConvertSheetState.build (cognitive 21) lib/widgets/batch_convert_sheet.dart:83 — _BatchConvertSheetState.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 3 (6 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 · _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 · _MornyeGlassRim.paint (cognitive 21) · ×1
  • _MornyeGlassRim.paint (cognitive 21) lib/widgets/mornye_chrome.dart:402 — _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:115 — _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:474 — _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:474 — 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:560 — _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 · SafCueScanKt.extractCueAudioFileName (cognitive 21) · ×1
  • SafCueScanKt.extractCueAudioFileName (cognitive 21) android/app/src/main/kotlin/com/zarz/mornye/SafCueScan.kt:13 — SafCueScanKt.extractCueAudioFileName has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 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 · 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 · 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:405 — 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:1424 — _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:547 — 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:83 — 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:601 — 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 · _NowPlayingScreenState._goToCurrentAlbum (cognitive 20) · ×1
  • _NowPlayingScreenState._goToCurrentAlbum (cognitive 20) lib/screens/now_playing_screen.dart:1268 — _NowPlayingScreenState._goToCurrentAlbum has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (8 pts), 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 · _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 · _DownloadSettingsPageState.build (cognitive 20) · ×1
  • _DownloadSettingsPageState.build (cognitive 20) lib/screens/settings/download_settings_page.dart:28 — _DownloadSettingsPageState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 7, if/else 3, 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 · _ExtensionsPageState._installExtension (cognitive 20) · ×1
  • _ExtensionsPageState._installExtension (cognitive 20) lib/screens/settings/extensions_page.dart:245 — _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 · _CategoryRow.build (cognitive 20) · ×1
  • _CategoryRow.build (cognitive 20) lib/screens/settings/settings_tab.dart:950 — _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:67 — 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 · AudioAnalysisRunner._getMediaInfo (cognitive 20) · ×1
  • AudioAnalysisRunner._getMediaInfo (cognitive 20) lib/services/audio_analysis_runner.dart:420 — AudioAnalysisRunner._getMediaInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, ternaries 2, 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.
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 · AutoplayPreferenceModel._features (cognitive 20) · ×1
  • AutoplayPreferenceModel._features (cognitive 20) lib/services/autoplay_personalization.dart:53 — AutoplayPreferenceModel._features has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 5 (6 pts), boolean chains 3, 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.
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:488 — 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 · FFmpegProbe._readAudioProperties (cognitive 20) · ×1
  • FFmpegProbe._readAudioProperties (cognitive 20) lib/services/ffmpeg_probe.dart:86 — 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 · HistorySchema.upgrade (cognitive 20) · ×1
  • HistorySchema.upgrade (cognitive 20) lib/services/history_schema.dart:89 — HistorySchema.upgrade has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (20 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 · MusicPlayerHandler._listenToPlayer (cognitive 20) · ×1
  • MusicPlayerHandler._listenToPlayer (cognitive 20) lib/services/music_player_service.dart:436 — MusicPlayerHandler._listenToPlayer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9 (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 · PlatformBridge._restorePersistentCache (cognitive 20) · ×1
  • PlatformBridge._restorePersistentCache (cognitive 20) lib/services/platform_bridge.dart:576 — 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:198 — 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 · _MaterialContextMenuState.build (cognitive 20) · ×1
  • _MaterialContextMenuState.build (cognitive 20) lib/widgets/desktop/context_menu.dart:276 — _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:853 — 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 · LibraryTrackSelectionBar.build (cognitive 20) · ×1
  • LibraryTrackSelectionBar.build (cognitive 20) lib/widgets/library_track_selection_bar.dart:42 — LibraryTrackSelectionBar.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 5, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MornyeContextMenu.build (cognitive 20) · ×1
  • MornyeContextMenu.build (cognitive 20) lib/widgets/mornye_context_menu.dart:250 — 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 · DownloadService.startNativeWorker (cognitive 20) · ×1
  • DownloadService.startNativeWorker (cognitive 20) android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:670 — 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:63 — 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:628 — _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 · _TrackItemWithStatus._handleTap (cognitive 19) · ×1
  • _TrackItemWithStatus._handleTap (cognitive 19) lib/screens/home_tab_widgets.dart:352 — _TrackItemWithStatus._handleTap 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:309 — _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:335 — _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:160 — _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:274 — _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 · AutoplayPersonalization.finish (cognitive 19) · ×1
  • AutoplayPersonalization.finish (cognitive 19) lib/services/autoplay_personalization.dart:342 — AutoplayPersonalization.finish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, 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 · ExtensionStorageService._migrateDirectory (cognitive 19) · ×1
  • ExtensionStorageService._migrateDirectory (cognitive 19) lib/services/extension_storage_service.dart:117 — 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 · MusicPlayerHandler.applySettings (cognitive 19) · ×1
  • MusicPlayerHandler.applySettings (cognitive 19) lib/services/music_player_service.dart:173 — MusicPlayerHandler.applySettings has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 6. 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:1599 — MusicPlayerHandler._loadNetworkMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (4 pts), 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 · MusicPlayerHandler._ensureDurationKnown (cognitive 19) · ×1
  • MusicPlayerHandler._ensureDurationKnown (cognitive 19) lib/services/music_player_service.dart:1649 — 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:66 — 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:567 — 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:378 — _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 · _LibrarySearchResultsState._row (cognitive 19) · ×1
  • _LibrarySearchResultsState._row (cognitive 19) lib/widgets/library_search_results.dart:391 — _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 · _MornyeLandscapePlayerState.build (cognitive 19) · ×1
  • _MornyeLandscapePlayerState.build (cognitive 19) lib/widgets/mornye_landscape_player.dart:102 — _MornyeLandscapePlayerState.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (15 pts), if/else 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SettingsSwitchItem.build (cognitive 19) · ×1
  • SettingsSwitchItem.build (cognitive 19) lib/widgets/settings_group.dart:609 — 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 · NativeFinalizerContainerKt.finalizeAutoConversion (cognitive 19) · ×1
  • NativeFinalizerContainerKt.finalizeAutoConversion (cognitive 19) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerContainer.kt:10 — NativeFinalizerContainerKt.finalizeAutoConversion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · check_backend_apk.check_backend_markers (cognitive 19) · ×1
  • check_backend_apk.check_backend_markers (cognitive 19) scripts/check_backend_apk.py:98 — check_backend_apk.check_backend_markers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 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 · NetworkPermissions · ×1
  • NetworkPermissions::validate (cognitive 19) rust_backend/crates/network/src/policy.rs:24 — NetworkPermissions::validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 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 · DownloadHistoryNotifier.updateAudioMetadataForItem (cognitive 18) · ×1
  • DownloadHistoryNotifier.updateAudioMetadataForItem (cognitive 18) lib/providers/download_history_provider.dart:557 — 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:1548 — _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:1813 — _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:637 — 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:465 — _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:620 — _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 · 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:598 — _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 · AudioAnalysisRunner._runFullStreamLevelAnalysis (cognitive 18) · ×1
  • AudioAnalysisRunner._runFullStreamLevelAnalysis (cognitive 18) lib/services/audio_analysis_runner.dart:581 — 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 · 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 · FFmpegConversion._convertToLossless (cognitive 18) · ×1
  • FFmpegConversion._convertToLossless (cognitive 18) lib/services/ffmpeg_conversion.dart:356 — FFmpegConversion._convertToLossless has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 7, 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 · LibraryCollectionsDatabase._projectCollectionReadDatabase (cognitive 18) · ×1
  • LibraryCollectionsDatabase._projectCollectionReadDatabase (cognitive 18) lib/services/library_collections_database.dart:520 — 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 · LocalNetworkAccess._isLocalAddress (cognitive 18) · ×1
  • LocalNetworkAccess._isLocalAddress (cognitive 18) lib/services/local_network_access.dart:62 — 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 · MusicPlayerHandler.reapplyNormalization (cognitive 18) · ×1
  • MusicPlayerHandler.reapplyNormalization (cognitive 18) lib/services/music_player_service.dart:925 — 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 · UpdateChecker._fetchReleasesBody (cognitive 18) · ×1
  • UpdateChecker._fetchReleasesBody (cognitive 18) lib/services/update_checker.dart:258 — UpdateChecker._fetchReleasesBody has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (3 pts), ternaries 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 · _TrackInfoHeaderState.build (cognitive 18) · ×1
  • _TrackInfoHeaderState.build (cognitive 18) lib/widgets/download_service_picker.dart:706 — _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 · _MenuLayout.getPositionForChild (cognitive 18) · ×1
  • _MenuLayout.getPositionForChild (cognitive 18) lib/widgets/mornye_context_menu.dart:120 — _MenuLayout.getPositionForChild has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (14 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 · _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 · _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 · MainActivityMetadataCallsKt.handleReEnrichFile (cognitive 18) · ×1
  • MainActivityMetadataCallsKt.handleReEnrichFile (cognitive 18) android/app/src/main/kotlin/com/zarz/mornye/MainActivityMetadataCalls.kt:224 — 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 · NativeFinalizerContainerKt.finalizeContainerConversion (cognitive 18) · ×1
  • NativeFinalizerContainerKt.finalizeContainerConversion (cognitive 18) android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerContainer.kt:93 — 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:11 — 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 · check_backend_ios.check_main_arches (cognitive 18) · ×1
  • check_backend_ios.check_main_arches (cognitive 18) scripts/check_backend_ios.py:95 — check_backend_ios.check_main_arches has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 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 · AppDelegate.handleMethodCall (cognitive 18) · ×1
  • AppDelegate.handleMethodCall (cognitive 18) ios/Runner/AppDelegate.swift:264 — 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:347 — 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:75 — 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:433 — _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:254 — 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:447 — _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 · LyricsSettingsPage.build (cognitive 17) · ×1
  • LyricsSettingsPage.build (cognitive 17) lib/screens/settings/lyrics_settings_page.dart:21 — LyricsSettingsPage.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 3, if/else 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CsvImportService._parseCsv (cognitive 17) · ×1
  • CsvImportService._parseCsv (cognitive 17) lib/services/csv_import_service.dart:238 — 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 · 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._refreshPlaybackAutomation (cognitive 17) · ×1
  • MusicPlayerHandler._refreshPlaybackAutomation (cognitive 17) lib/services/music_player_service.dart:586 — MusicPlayerHandler._refreshPlaybackAutomation 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 · PlayableMedia.toMediaItem (cognitive 17) · ×1
  • PlayableMedia.toMediaItem (cognitive 17) lib/services/playable_media.dart:110 — PlayableMedia.toMediaItem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PlaylistCoverStore.normalize (cognitive 17) · ×1
  • PlaylistCoverStore.normalize (cognitive 17) lib/services/playlist_cover_store.dart:34 — 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 · 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:313 — 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 · _LibraryFastScrollerState.build (cognitive 17) · ×1
  • _LibraryFastScrollerState.build (cognitive 17) lib/widgets/library_fast_scroller.dart:209 — _LibraryFastScrollerState.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (12 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 · _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 · SettingsInfoCard.build (cognitive 17) · ×1
  • SettingsInfoCard.build (cognitive 17) lib/widgets/settings_group.dart:1017 — 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:78 — _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:169 — _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:67 — 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:85 — 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 · MainActivityProgressStreamsKt.startDownloadProgressStream (cognitive 17) · ×1
  • MainActivityProgressStreamsKt.startDownloadProgressStream (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/MainActivityProgressStreams.kt:65 — MainActivityProgressStreamsKt.startDownloadProgressStream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, 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 · UsbPcmPlayback.prepare (cognitive 17) · ×1
  • UsbPcmPlayback.prepare (cognitive 17) android/app/src/main/kotlin/com/zarz/mornye/UsbBitPerfectPlugin.kt:199 — 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:135 — 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 · RustCoreBackend.readAudioMetadata (cognitive 17) · ×1
  • RustCoreBackend.readAudioMetadata (cognitive 17) android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt:266 — RustCoreBackend.readAudioMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · prepare_discord_sdk.prepare (cognitive 17) · ×1
  • prepare_discord_sdk.prepare (cognitive 17) scripts/prepare_discord_sdk.py:89 — prepare_discord_sdk.prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 1 (3 pts), loops 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 · ExtensionPermissions · ×1
  • ExtensionPermissions::deserialize (cognitive 17) rust_backend/crates/extensions/src/manifest.rs:63 — 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:994 — 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:1399 — 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:727 — _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:198 — _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 · _EditMetadataSheetState._showEditorOptionPicker (cognitive 16) · ×1
  • _EditMetadataSheetState._showEditorOptionPicker (cognitive 16) lib/screens/track_metadata_edit_sheet.dart:92 — _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:657 — _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 · CoverDownloadService.detectCoverFileFormat (cognitive 16) · ×1
  • CoverDownloadService.detectCoverFileFormat (cognitive 16) lib/services/cover_download_service.dart:115 — 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:351 — 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:437 — 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 · HistoryDatabase.updateFilePath (cognitive 16) · ×1
  • HistoryDatabase.updateFilePath (cognitive 16) lib/services/history_database.dart:657 — HistoryDatabase.updateFilePath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 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 · 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:413 — 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 · MusicPlayerRuntime._initialize (cognitive 16) · ×1
  • MusicPlayerRuntime._initialize (cognitive 16) lib/services/music_player_runtime.dart:260 — MusicPlayerRuntime._initialize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, 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 · MusicPlayerHandler.restoreIosNowPlaying (cognitive 16) · ×1
  • MusicPlayerHandler.restoreIosNowPlaying (cognitive 16) lib/services/music_player_service.dart:410 — 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.restoreSession (cognitive 16) · ×1
  • MusicPlayerHandler.restoreSession (cognitive 16) lib/services/music_player_service.dart:1107 — MusicPlayerHandler.restoreSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 1 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MusicPlayerHandler.onSourceDeleted (cognitive 16) · ×1
  • MusicPlayerHandler.onSourceDeleted (cognitive 16) lib/services/music_player_service.dart:1995 — MusicPlayerHandler.onSourceDeleted has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, 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 · PlayableMedia.toJson (cognitive 16) · ×1
  • PlayableMedia.toJson (cognitive 16) lib/services/playable_media.dart:46 — PlayableMedia.toJson has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, 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 · 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:456 — 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 · _MornyeArtistSurfaceState.build (cognitive 16) · ×1
  • _MornyeArtistSurfaceState.build (cognitive 16) lib/widgets/mornye_artist_header.dart:43 — _MornyeArtistSurfaceState.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11, boolean chains 3, 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 · _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 · TrackMatching · ×1
  • TrackMatching::deserialize (cognitive 16) rust_backend/crates/extensions/src/manifest.rs:63 — 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.
D22 · Internal API Consistency · Inconsistent naming and parameter types for bulk cancellation operations. CancellationRegistry uses 'cancel_many' with a generic iterator, while DownloadState uses 'cancel_many' with a slice reference. More importantly, DownloadState duplicates the single-item cancel logic found in CancellationRegistry but with different naming conventions for the bulk variant (though both use 'cancel_many', the underlying types differ). However, the primary inconsistency is between CancellationRegistry and DownloadState regarding the single-item method · ×1
  • Inconsistent naming and parameter types for bulk cancellation operations. CancellationRegistry uses 'cancel_many' with a generic iterator, while DownloadState uses 'cancel_many' with a slice reference. More importantly, DownloadState duplicates the single-item cancel logic found in CancellationRegistry but with different naming conventions for the bulk variant (though both use 'cancel_many', the underlying types differ). However, the primary inconsistency is between CancellationRegistry and DownloadState regarding the single-item method: CancellationRegistry uses 'cancel' while DownloadState also uses 'cancel'. This is actually consistent. The real issue is the parameter type inconsistency for the bulk method: `impl IntoIterator<Item = &str>` vs `&[String]`. While functionally similar, the API surface exposes different abstractions for the same intent. — Standardize the bulk cancellation signature across both types to use a consistent iterator trait or slice reference, e.g., `cancel_many(ids: &[&str])` or `cancel_many(ids: impl IntoIterator<Item = &str>)` for both. (signatures: CancellationRegistry.cancel(id: str): Result | CancellationRegistry.cancel_many(ids: impl IntoIterator<Item = &str>): Result | DownloadState.cancel(id: str): Result | DownloadState.cancel_many(ids: &[String]): Result)
D22 · Internal API Consistency · Inconsistent naming for bulk operations. The single-item method is 'reset_if_idle', but the bulk method is 'reset_many_if_idle'. While descriptive, this breaks the pattern seen in 'cancel' vs 'cancel_many'. It is inconsistent with the 'cancel' naming convention established in the same type. · ×1
  • Inconsistent naming for bulk operations. The single-item method is 'reset_if_idle', but the bulk method is 'reset_many_if_idle'. While descriptive, this breaks the pattern seen in 'cancel' vs 'cancel_many'. It is inconsistent with the 'cancel' naming convention established in the same type. — Rename 'reset_many_if_idle' to 'reset_if_idle_many' or 'reset_many_if_idle' to 'reset_if_idle' (if overloading is supported) or simply ensure the bulk naming convention matches the 'cancel' pattern (e.g., 'cancel_many' vs 'cancel'). Given 'cancel' uses 'cancel_many', 'reset' should likely use 'reset_many' or 'reset_if_idle_many' for consistency. Actually, 'cancel_many' is the bulk form of 'cancel'. So 'reset_if_idle_many' would be the bulk form of 'reset_if_idle'. The current name 'reset_many_if_idle' is slightly awkward. A better unification would be to use 'reset_if_idle' and 'reset_if_idle_many'. (signatures: CancellationRegistry.reset_if_idle(id: str): Result | CancellationRegistry.reset_many_if_idle(ids: impl IntoIterator<Item = &str>): Result)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFields · ×1
  • 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.
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 · Near-duplicate member pair (61 shared lines) · ×1
  • Near-duplicate member pair (61 shared lines) lib/services/library_queue_store.dart:1015 — lib/services/library_queue_store.dart:1015-1097 | lib/services/library_queue_store.dart:1099-1169 — These two members are variants of one another: 61 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) lib/models/download_history.dart:165 — lib/models/download_history.dart:165-240 | lib/models/download_item.dart:83-133 | lib/models/equalizer_settings.dart:97-125 | lib/models/extension.dart:183-236 | lib/models/settings.dart:317-570 | lib/models/track.dart:159-225 | lib/theme/app_tokens.dart:206-285 — These 7 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 7 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 7 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-133 | lib/services/history_schema.dart:291-323 | lib/services/library_row_mapper.dart:37-68 | lib/services/library_schema.dart:298-332 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) lib/screens/downloaded_album_screen.dart:858 — lib/screens/downloaded_album_screen.dart:858-906 | lib/screens/local_album_screen.dart:826-874 — before extracting anything, compare `lib/screens/downloaded_album_screen.dart` and `lib/screens/local_album_screen.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) lib/services/library_queue_store.dart:463 — lib/services/library_queue_store.dart:463-526 | lib/services/library_queue_store.dart:665-700 — both copies are in the same file, so extract the 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 (31–34 lines × 2) · ×1
  • Duplicated block (31–34 lines × 2) lib/services/library_queue_store.dart:722 — lib/services/library_queue_store.dart:722-752 | lib/services/library_queue_store.dart:778-811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) lib/services/library_queue_store.dart:1036 — lib/services/library_queue_store.dart:1036-1062 | lib/services/library_queue_store.dart:1121-1146 — both copies are in the same file, so extract the 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) lib/providers/download_history_provider.dart:580 — lib/providers/download_history_provider.dart:580-602 | lib/providers/download_history_provider.dart:662-684 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) lib/widgets/mornye_player_queue.dart:194 — lib/widgets/mornye_player_queue.dart:194-207 | 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.
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.
D4 · Code Duplication · Duplicated block (8–13 lines × 2) · ×1
  • Duplicated block (8–13 lines × 2) lib/models/settings.dart:495 — lib/models/settings.dart:495-507 | lib/providers/repo_provider.dart:153-160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) lib/models/download_item.dart:122 — lib/models/download_item.dart:122-131 | lib/models/settings.dart:427-436 | lib/models/settings.dart:510-520 — before extracting anything, compare `lib/models/download_item.dart` and `lib/models/settings.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.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) lib/screens/settings/cache_management_page.dart:201 — lib/screens/settings/cache_management_page.dart:201-210 | lib/screens/settings/cache_management_page.dart:225-234 | lib/screens/settings/extension_detail_page.dart:573-582 | lib/screens/settings/library_settings_page.dart:249-258 | lib/screens/settings/library_settings_page.dart:318-327 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) lib/screens/settings/library_settings_page.dart:252 — lib/screens/settings/library_settings_page.dart:252-261 | lib/screens/settings/library_settings_page.dart:321-330 | lib/widgets/duplicate_review_sheet.dart:131-140 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) lib/models/download_history.dart:230 — lib/models/download_history.dart:230-240 | lib/models/download_item.dart:123-133 | lib/models/extension.dart:228-236 | lib/models/settings.dart:560-570 | lib/models/track.dart:217-225 | lib/theme/app_tokens.dart:277-285 — before extracting anything, compare `lib/models/download_item.dart` and `lib/models/settings.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.
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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) lib/services/apk_downloader.dart:215 — lib/services/apk_downloader.dart:215-222 | lib/services/backup_service.dart:524-532 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) lib/models/download_history.dart:230 — lib/models/download_history.dart:230-239 | lib/models/download_item.dart:123-132 | lib/models/equalizer_settings.dart:118-125 | lib/models/extension.dart:228-235 | lib/models/settings.dart:560-569 | lib/models/track.dart:217-224 | lib/theme/app_tokens.dart:277-284 — before extracting anything, compare `lib/models/download_item.dart` and `lib/models/settings.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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) lib/screens/tutorial_screen.dart:416 — lib/screens/tutorial_screen.dart:416-423 | lib/screens/tutorial_screen.dart:562-569 | lib/widgets/download_service_picker.dart:642-649 — 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 (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) lib/services/history_row_mapper.dart:123 — lib/services/history_row_mapper.dart:123-130 | lib/services/history_schema.dart:277-283 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) lib/services/history_row_mapper.dart:113 — lib/services/history_row_mapper.dart:113-118 | lib/services/history_schema.dart:310-315 | lib/services/library_row_mapper.dart:59-64 | lib/services/library_schema.dart:318-323 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) lib/widgets/desktop/desktop_player_bar.dart:380 — lib/widgets/desktop/desktop_player_bar.dart:380-384 | lib/widgets/desktop/desktop_player_bar.dart:491-495 | lib/widgets/mini_player.dart:384-388 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) rust_backend/crates/extensions/src/backend/cover.rs:304 — rust_backend/crates/extensions/src/backend/cover.rs:304-313 | rust_backend/crates/extensions/src/backend/cover.rs:403-412 | rust_backend/crates/extensions/src/backend/library.rs:42-51 | rust_backend/crates/extensions/src/backend/library.rs:280-289 | rust_backend/crates/extensions/src/backend/tags.rs:47-56 | rust_backend/crates/extensions/src/backend/tags.rs:83-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 (6–7 lines × 2) · ×1
  • 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.
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.
SC1 · Supply-chain hygiene · NuGet dependencies are not locked · ×1
  • NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
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:66 — This function unwraps IPv4-MAPPED IPv6 (`[10] == 0xff`, line 68) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 66 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:230 — `_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:736 — `!_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/metadata_cover_resources.dart:99 — `!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/screens/downloaded_album_screen.dart:177 — `!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:111 — `!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:318 — `!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:581 — `!settings.separateSingles && settings.folderOrganization == 'custom'` appears character-identically in 2 files — lib/providers/download_queue_provider_paths.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/screens/setup_screen.dart:702 — `_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/screens/track_metadata_edit_autofill.dart:768 — `_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:266 — `_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:605 — `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:269 — `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:269 — `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:80 — `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:364 — `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.
  • Duplicated predicate lib/screens/track_metadata_edit_cover.dart:77 — `bytes.length >= 12 && bytes[0] == 0x52 && bytes[1] == 0x49 && bytes[2] == 0x46 && bytes[3] == 0x46 && bytes[8] == 0x57 && bytes[9] == 0x45 &…` appears character-identically in 2 files — lib/screens/track_metadata_edit_cover.dart, lib/services/cover_download_service.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/models/library_collections.dart:44 — `colonIndex <= 0 || colonIndex == value.length - 1` appears character-identically in 2 files — lib/models/library_collections.dart, lib/utils/provider_resource_ids.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_cards.dart:589 — `composer != null && composer!.isNotEmpty` appears character-identically in 2 files — lib/screens/track_metadata_cards.dart, lib/screens/track_metadata_convert.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:346 — `context.isMornye && !MediaQuery.disableAnimationsOf(context)` appears character-identically in 3 files — lib/screens/downloaded_album_screen.dart, lib/screens/local_album_screen.dart, lib/widgets/player_lyrics_word_sweep.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_cards.dart:587 — `copyright != null && copyright!.isNotEmpty` appears character-identically in 2 files — lib/screens/track_metadata_cards.dart, lib/screens/track_metadata_convert.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/ffmpeg_conversion.dart:318 — `coverPath != null && coverPath.trim().isNotEmpty` appears character-identically in 2 files — lib/services/ffmpeg_conversion.dart, lib/services/ffmpeg_metadata.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/library_tracks_folder_screen.dart:674 — `customCoverPath != null && customCoverPath.isNotEmpty` appears character-identically in 3 files — lib/screens/library_tracks_folder_screen.dart, lib/screens/queue_tab_navigation.dart, lib/widgets/playlist_picker_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/theme/mornye_theme.dart:257 — `defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.macOS` appears character-identically in 2 files — lib/theme/mornye_theme.dart, lib/utils/app_bar_layout.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:202 — `embeddedCoverPath == null && !context.isMornye` appears character-identically in 2 files — lib/screens/downloaded_album_screen.dart, lib/screens/queue_tab_navigation.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 · ×9
  • Silent fallback default in catch android/app/src/main/kotlin/com/zarz/mornye/DownloadService.kt:801 — `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:992 — `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:1005 — `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:1015 — `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:134 — `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 android/app/src/main/kotlin/com/zarz/mornye/NativeFinalizerMedia.kt:217 — `resolveLyricsLrc` 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.
AX6 · Interface segregation · Fat interface · ×1
  • Fat interface: ServiceListener (37 abstract methods) third_party/audio_service/android/src/main/java/com/ryanheise/audioservice/AudioService.java:1177 — `ServiceListener` declares 37 abstract methods: `onAddQueueItem`, `onAddQueueItemAt`, `onAdjustVolume`, `onClick`, `onClose`, `onCustomAction`, `onDestroy`, `onFastForward`, `onLoadChildren`, `onLoadItem`, `onPause`, `onPlay`, `onPlayFromMediaId`, `onPlayFromSearch`, `onPlayFromUri`, `onPlayMediaItem`, `onPrepare`, `onPrepareFromMediaId`, `onPrepareFromSearch`, `onPrepareFromUri`, `onRemoveQueueItem`, `onRemoveQueueItemAt`, `onRewind`, `onSearch`, `onSeekTo`, `onSetCaptioningEnabled`, `onSetPlaybackSpeed`, `onSetRating`, `onSetRating`, `onSetRepeatMode`, `onSetShuffleMode`, `onSetVolumeTo`, `onSkipToNext`, `onSkipToPrevious`, `onSkipToQueueItem`, `onStop`, `onTaskRemoved`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 37 declarations carry 36 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 36 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
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 — 3 of 17 project(s) overshoot their size bounds, lowering Project Cohesion to 6.5/10. The most over is `(repository root)` (182816 LoC, 843 module-visible types across 19 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.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift scripts/README_ios_ffmpeg_capabilities.md:9 — scripts/README_ios_ffmpeg_capabilities.md names `scripts/setup_ios.sh`, but no file or folder `scripts/setup_ios.sh` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 4/7 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/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.
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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-25927005d5c84305bfc63081795e6b40/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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-25927005d5c84305bfc63081795e6b40/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/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .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 .6artifacts/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 1 file(s) — `android/app/src/rust/kotlin/com/zarz/mornye/SelectedCoreBackend.kt` — 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 01a168cd-4fbd-7ca9-8af1-854075af7a07 · 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