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

RyanYuuki/AnymeX

Measured 17 November 2026, 22:40 UTC, at code version 18960f9

CAI score 31.5out of 100 Weak
CriticalWeakAdequateStrongExemplary
Up 0.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: 247,372 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 1.5 person-years · Weakest lens: Security and Compliance, 9.1

Findings by how serious they are

67 critical 2688 serious 118 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 22:40 UTC

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

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

63of 63 dimensions measured by tools.
2857of 2873 findings point to an exact file and line, so you can open each one in the code. The other 16 concern the repository as a whole, such as missing documentation.
63dimensions across 7 lenses, read from 247,372 lines of product code in 11 projects.
Chapters

Executive summary

RyanYuuki/AnymeX falls short of our standard for production, in part because we found no access checks on the code's endpoints or handlers. It scores 31.5 out of 100 and is rated Weak, and 64 of its 67 critical findings are security problems.

Security and Compliance, at 9.1, is the weakest lens and counts most in the score. The best first steps are adding access checks and restoring certificate checks, each worth about 12.5 points. Raising Security and Compliance to 70 would lift the score to about 49.9.

Thirty-two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nine secrets can leak from the build pipeline, and eight passwords or keys in the code's history and five in the code are open to anyone who can read the repository. Pinning each tool to an exact version, limiting each secret to its own step and replacing each exposed password or key would close these risks. Switching the validation back on would fix the three security checks on connections or logins switched off, and the three pipeline steps that run downloads without checking them need each download checked against a known checksum first. The two packages under a licence on your banned list need replacing, or clearing with your legal team.

The product code is 247,372 lines, about €210,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.
Security and Compliance 9.1 · counts for 46%Production Readiness 41.5 · counts for 25%Code Health 46.1 · counts for 14%Performance 60.0 · counts for 8%Maturity 62.1 · counts for 4%Architecture 93.8 · counts for 2%Domain Modelling 100.0 · counts for 1%

If Security and Compliance rose from 9.1 to 70, the lowest score rated Strong, the score would rise from 31.5 to about 49.9.

Code composition: what the lines of code are
Product code 99%Tests 1%
New since the last survey: 554 findings

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

  • Cyclomatic Complexity · _ProfilePageState._buildBody (cyclomatic 34) lib/screens/profile/profile_page.dart
  • Cyclomatic Complexity · KvHelper.get (cyclomatic 30) lib/database/kv_helper.dart
  • Cyclomatic Complexity · AnymeXSheet.build (cyclomatic 30) lib/widgets/anymex_widgets/anymex_bottomsheet.dart
  • Cyclomatic Complexity · AnymeXTile.build (cyclomatic 29) lib/widgets/anymex_widgets/anymex_tile.dart
  • Cyclomatic Complexity · _AnymeXExpansionTileState.build (cyclomatic 26) lib/widgets/anymex_widgets/anymex_expansion_tile.dart
  • Cyclomatic Complexity · AnymeXSectionBuilder.build (cyclomatic 25) lib/widgets/anymex_widgets/anymex_section_builder.dart
  • Cyclomatic Complexity · _ChapterListBuilderState.build (cyclomatic 20) lib/screens/manga/widgets/chapter_list_builder.dart
  • Cyclomatic Complexity · SettingsSheet._buildHeroHeader (cyclomatic 18) lib/widgets/non_widgets/settings_sheet.dart
  • Cyclomatic Complexity · _EpisodeListBuilderState._buildHeaderCard (cyclomatic 17) lib/screens/anime/widgets/episode_list_builder.dart
  • Cognitive Complexity · KvHelper.get (cognitive 50) lib/database/kv_helper.dart
  • Cognitive Complexity · AnymeXSheet.build (cognitive 39) lib/widgets/anymex_widgets/anymex_bottomsheet.dart
  • Cognitive Complexity · _ProfilePageState._buildBody (cognitive 36) lib/screens/profile/profile_page.dart
  • Cognitive Complexity · AnymeXTile.build (cognitive 34) lib/widgets/anymex_widgets/anymex_tile.dart
  • Cognitive Complexity · AnilistData.fetchAnilistMangaPage (cognitive 33) lib/controllers/services/anilist/anilist_data.dart
  • Cognitive Complexity · _EpisodeListBuilderState._buildHeaderCard (cognitive 33) lib/screens/anime/widgets/episode_list_builder.dart
  • Cognitive Complexity · _AnymeXPopupMenuOverlay.build (cognitive 29) lib/widgets/anymex_widgets/anymex_popup_menu.dart
  • Cognitive Complexity · AnilistApi.postQuery (cognitive 27) lib/controllers/services/anilist/anilist_api.dart
  • Cognitive Complexity · _AnymeXPopupMenuOverlay._buildEntry (cognitive 27) lib/widgets/anymex_widgets/anymex_popup_menu.dart
  • Cognitive Complexity · SettingsSheet._buildHeroHeader (cognitive 26) lib/widgets/non_widgets/settings_sheet.dart
  • Cognitive Complexity · AnilistData.fetchAnilistHomepage (cognitive 24) lib/controllers/services/anilist/anilist_data.dart
  • Cognitive Complexity · _SettingsReaderState._showTapZonesDialog (cognitive 24) lib/screens/settings/sub_settings/settings_reader.dart
  • Cognitive Complexity · AnilistRateLimiter._processQueue (cognitive 23) lib/controllers/services/anilist/anilist_rate_limiter.dart
  • Cognitive Complexity · Media.mergeSecondaryData (cognitive 22) lib/models/Media/media.dart
  • Cognitive Complexity · BakedBlurImage.load (cognitive 22) lib/widgets/common/baked_blur_image.dart
  • Cognitive Complexity · MediaDetailsController._fetchFullDetails (cognitive 21) lib/screens/anime/details/controller/media_details_controller.dart
  • Cognitive Complexity · AnilistData.fetchSecondaryDetails (cognitive 20) lib/controllers/services/anilist/anilist_data.dart
  • Cognitive Complexity · _SettingsPlayerShadersState.build (cognitive 18) lib/screens/settings/sub_settings/player/settings_player_shaders.dart
  • Cognitive Complexity · BakedBlurImage.loadCachedOnly (cognitive 18) lib/widgets/common/baked_blur_image.dart
  • Cognitive Complexity · SourceSelectorWidget.build (cognitive 17) lib/widgets/common/source_selector.dart
  • Cognitive Complexity · UnifiedSourceSection.build (cognitive 17) lib/widgets/common/unified_source_section.dart
  • Cognitive Complexity · AnilistAuth.getNotifications (cognitive 16) lib/controllers/services/anilist/anilist_auth.dart
  • Cognitive Complexity · _SettingsUiDetailsState.initState (cognitive 16) lib/screens/settings/sub_settings/settings_ui_details.dart
  • God Classes · MethodTooLong: _SettingsPlayerShadersState.build lib/screens/settings/sub_settings/player/settings_player_shaders.dart
  • God Classes · MethodTooLong: _SettingsPlayerEngineState.build lib/screens/settings/sub_settings/player/settings_player_engine.dart
  • God Classes · MethodTooLong: _SettingsReaderState._buildNovelReaderSection lib/screens/settings/sub_settings/settings_reader.dart
  • God Classes · MethodTooLong: _SettingsReaderNovelState.build lib/screens/settings/sub_settings/reader/settings_reader_novel.dart
  • God Classes · ClassTooLong: _SettingsPlayerControlsState lib/screens/settings/sub_settings/player/settings_player_controls.dart
  • God Classes · MethodTooLong: _UserProfilePageState._buildBody lib/screens/profile/user_profile_page.dart
  • God Classes · MethodTooLong: _SettingsReaderState._buildMangaReaderSection lib/screens/settings/sub_settings/settings_reader.dart
  • God Classes · MethodTooLong: _SettingsReaderMangaState.build lib/screens/settings/sub_settings/reader/settings_reader_manga.dart
  • God Classes · FileTooLong: player/settings_player_controls.dart lib/screens/settings/sub_settings/player/settings_player_controls.dart
  • God Classes · MethodTooLong: AnymeXSheet.build lib/widgets/anymex_widgets/anymex_bottomsheet.dart
  • God Classes · MethodTooLong: _SettingsReaderState._showTapZonesDialog lib/screens/settings/sub_settings/settings_reader.dart
  • God Classes · MethodTooLong: _SettingsPlayerSubtitlesState.build lib/screens/settings/sub_settings/player/settings_player_subtitles.dart
  • God Classes · MethodTooLong: _SettingsPlayerControlsState.build lib/screens/settings/sub_settings/player/settings_player_controls.dart
  • God Classes · ClassTooLong: _SettingsPlayerEngineState lib/screens/settings/sub_settings/player/settings_player_engine.dart
  • God Classes · MethodTooLong: _SettingsPlayerControlsState._showGestureAreasDialog lib/screens/settings/sub_settings/player/settings_player_controls.dart
  • God Classes · MethodTooLong: _SettingsPlayerEngineState._showMpvConfEditorSheet lib/screens/settings/sub_settings/player/settings_player_engine.dart
  • God Classes · FileTooLong: player/settings_player_engine.dart lib/screens/settings/sub_settings/player/settings_player_engine.dart
  • God Classes · MethodTooLong: AnymeXTile.build lib/widgets/anymex_widgets/anymex_tile.dart
  • God Classes · MethodTooLong: _StylePickerSectionState.build lib/screens/settings/widgets/style_picker_section.dart
  • God Classes · MethodTooLong: AnymeXSectionBuilder.build lib/widgets/anymex_widgets/anymex_section_builder.dart
  • God Classes · MethodTooLong: SettingsSheet._buildHeroHeader lib/widgets/non_widgets/settings_sheet.dart
  • God Classes · ClassTooLong: _SettingsPlayerShadersState lib/screens/settings/sub_settings/player/settings_player_shaders.dart
  • God Classes · MethodTooLong: _SettingsPlayerControlsState._showPlayerControlThemeDialog lib/screens/settings/sub_settings/player/settings_player_controls.dart
  • God Classes · MethodTooLong: _SettingsReaderState._showReaderControlThemeDialog lib/screens/settings/sub_settings/settings_reader.dart
  • God Classes · MethodTooLong: AnymeXScaffold.build lib/widgets/common/anymex_scaffold.dart
  • God Classes · MethodTooLong: _AddRepoDialogState.build lib/screens/settings/sub_settings/settings_extensions.dart
  • God Classes · ClassTooLong: _SettingsReaderNovelState lib/screens/settings/sub_settings/reader/settings_reader_novel.dart
  • God Classes · ClassTooLong: MediaHeader lib/widgets/anime/media_header.dart
  • God Classes · ClassTooLong: _SettingsPlayerSubtitlesState lib/screens/settings/sub_settings/player/settings_player_subtitles.dart
  • God Classes · MethodTooLong: AnilistAuth.updateListEntry lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Near-duplicate member family (4 members, 47 shared lines) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Near-duplicate member family (3 members, 38 shared lines) lib/screens/anime/watch/controls/top_controls.dart
  • Code Duplication · Near-duplicate member family (3 members, 21 shared lines) lib/screens/settings/sub_settings/player/settings_player_controls.dart
  • Code Duplication · Near-duplicate member pair (182 shared lines) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart
  • Code Duplication · Near-duplicate member pair (141 shared lines) lib/screens/settings/sub_settings/settings_network.dart
  • Code Duplication · Near-duplicate member pair (129 shared lines) lib/screens/profile/profile_page.dart
  • Code Duplication · Near-duplicate member pair (115 shared lines) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart
  • Code Duplication · Near-duplicate member pair (103 shared lines) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Near-duplicate member pair (57 shared lines) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart
  • Code Duplication · Near-duplicate member pair (57 shared lines) lib/utils/compatibility/matchmaker.dart
  • Code Duplication · Edited copy of a member (33 corresponding lines) lib/controllers/services/anilist/anilist_data.dart
  • Code Duplication · Edited copy of a member (37 corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart
  • Code Duplication · Edited copy of a member (38 corresponding lines) lib/screens/settings/sub_settings/settings_comments.dart
  • Code Duplication · Edited copy of a member (22 corresponding lines) lib/controllers/services/anilist/anilist_data.dart
  • Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) lib/screens/anime/home_page.dart
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/screens/anime/details/media_details_page.dart
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/services/commentum_service.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/models/Media/media.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/anime/widgets/list_editor.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/downloads/controller/download_controller.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/extensions/ExtensionScreen.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/settings/sub_settings/player/settings_player_controls.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/settings/sub_settings/settings_comments.dart
  • Code Duplication · Edited copy of a member (102 corresponding lines) lib/screens/library/online/anime_list.dart
  • Code Duplication · Edited copies of one member (3 members, 121+ corresponding lines) lib/screens/profile/widgets/decoration_closet_sheet.dart
  • Code Duplication · Edited copy of a member (115 corresponding lines) lib/screens/profile/profile_page.dart
  • Code Duplication · Edited copy of a member (84 corresponding lines) lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart
  • Code Duplication · Edited copy of a member (106 corresponding lines) lib/screens/anime/widgets/episode/styles/minimal_style.dart
  • Code Duplication · Edited copy of a member (105 corresponding lines) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart
  • Code Duplication · Edited copy of a member (93 corresponding lines) lib/screens/library/widgets/anime_card.dart
  • Code Duplication · Edited copy of a member (41 corresponding lines) lib/widgets/non_widgets/recommend_sheet.dart
  • Code Duplication · Edited copy of a member (90 corresponding lines) lib/controllers/sync/gist_sync_controller.dart
  • Code Duplication · Edited copy of a member (76 corresponding lines) lib/screens/notifications/notification_screen.dart
  • Code Duplication · Edited copy of a member (68 corresponding lines) lib/widgets/anymex_widgets/anymex_animated_logo.dart
  • Code Duplication · Edited copy of a member (91 corresponding lines) lib/screens/manga/widgets/reader/auto_scroll_menu.dart

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

Fixed since the last survey: 483 findings

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

  • Cyclomatic Complexity · _SettingsReaderState.build (cyclomatic 24) lib/screens/settings/sub_settings/settings_reader.dart
  • Cyclomatic Complexity · _SettingsPlayerState.build (cyclomatic 21) lib/screens/settings/sub_settings/settings_player.dart
  • Cyclomatic Complexity · _SettingsUiState._buildFontFamilyPickerContent (cyclomatic 20) lib/screens/settings/sub_settings/settings_ui.dart
  • Cyclomatic Complexity · _MediaDetailsPageState._resolveDynamicColor (cyclomatic 16) lib/screens/anime/details/media_details_page.dart
  • Cognitive Complexity · _SettingsPlayerState.build (cognitive 32) lib/screens/settings/sub_settings/settings_player.dart
  • Cognitive Complexity · _SettingsUiState._buildFontFamilyPickerContent (cognitive 31) lib/screens/settings/sub_settings/settings_ui.dart
  • Cognitive Complexity · SettingsSheet._buildProfileHeader (cognitive 20) lib/widgets/non_widgets/settings_sheet.dart
  • Cognitive Complexity · NotificationController.loadAnilistNotifications (cognitive 17) lib/screens/notifications/notification_controller.dart
  • Cognitive Complexity · AnilistAuth.fetchUserMangaList (cognitive 16) lib/controllers/services/anilist/anilist_auth.dart
  • God Classes · MethodTooLong: _SettingsPlayerState.build lib/screens/settings/sub_settings/settings_player.dart
  • God Classes · ClassTooLong: _SettingsPlayerState lib/screens/settings/sub_settings/settings_player.dart
  • God Classes · FileTooLong: sub_settings/settings_player.dart lib/screens/settings/sub_settings/settings_player.dart
  • God Classes · MethodTooLong: _SettingsReaderState.build lib/screens/settings/sub_settings/settings_reader.dart
  • God Classes · MethodTooLong: _SettingsUiState._buildFontFamilyPickerContent lib/screens/settings/sub_settings/settings_ui.dart
  • God Classes · TooManyMethods: _SettingsPlayerState lib/screens/settings/sub_settings/settings_player.dart
  • God Classes · MethodTooLong: SettingsSheet.showServiceSelector lib/widgets/non_widgets/settings_sheet.dart
  • God Classes · MethodTooLong: _SettingsPlayerState._showMpvConfEditorSheet lib/screens/settings/sub_settings/settings_player.dart
  • God Classes · FileTooLong: sub_settings/settings_ui.dart lib/screens/settings/sub_settings/settings_ui.dart
  • God Classes · MethodTooLong: SettingsSheet._buildProfileHeader lib/widgets/non_widgets/settings_sheet.dart
  • God Classes · MethodTooLong: TopControls._buildMobileLayout lib/screens/anime/watch/controls/top_controls.dart
  • God Classes · ClassTooLong: BottomControls lib/screens/anime/watch/controls/bottom_controls.dart
  • God Classes · ClassTooLong: _ExtensionScreenState lib/screens/extensions/ExtensionScreen.dart
  • God Classes · ClassTooLong: SettingsSheet lib/widgets/non_widgets/settings_sheet.dart
  • God Classes · ClassTooLong: TopControls lib/screens/anime/watch/controls/top_controls.dart
  • God Classes · ClassTooLong: _UserProfileAppBarState lib/screens/profile/widgets/user_profile_app_bar.dart
  • Code Duplication · Near-duplicate member family (4 members, 20 shared lines) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Near-duplicate member family (3 members, 58 shared lines) lib/screens/anime/watch/controls/top_controls.dart
  • Code Duplication · Near-duplicate member family (3 members, 31 shared lines) lib/screens/anime/misc/calendar.dart
  • Code Duplication · Near-duplicate member pair (141 shared lines) lib/screens/settings/sub_settings/settings_network.dart
  • Code Duplication · Near-duplicate member pair (128 shared lines) lib/screens/profile/profile_page.dart
  • Code Duplication · Near-duplicate member pair (88 shared lines) lib/screens/anime/details/media_details_page.dart
  • Code Duplication · Near-duplicate member pair (58 shared lines) lib/screens/profile/profile_page.dart
  • Code Duplication · Near-duplicate member pair (57 shared lines) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart
  • Code Duplication · Near-duplicate member pair (56 shared lines) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart
  • Code Duplication · Near-duplicate member pair (51 shared lines) lib/utils/compatibility/matchmaker.dart
  • Code Duplication · Edited copy of a member (37 corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart
  • Code Duplication · Edited copy of a member (38 corresponding lines) lib/screens/settings/sub_settings/settings_comments.dart
  • Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) lib/screens/anime/home_page.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/network/cookie_manager.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/offline/offline_storage_controller.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/models/Media/media.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/anime/widgets/list_editor.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/downloads/controller/download_controller.dart
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/settings/sub_settings/settings_comments.dart
  • Code Duplication · Duplicated block (82–95 lines × 2) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Duplicated block (63–64 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart
  • Code Duplication · Duplicated block (51 lines × 2) lib/screens/anime/details/media_details_page.dart
  • Code Duplication · Duplicated block (43–44 lines × 2) lib/screens/library/online/anime_list.dart
  • Code Duplication · Duplicated block (34–35 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart
  • Code Duplication · Duplicated block (34 lines × 2) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart
  • Code Duplication · Duplicated block (34 lines × 2) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (34 lines × 2) lib/screens/settings/sub_settings/settings_player.dart
  • Code Duplication · Duplicated block (29 lines × 2) lib/screens/settings/sub_settings/settings_extensions.dart
  • Code Duplication · Duplicated block (28 lines × 3) lib/screens/settings/sub_settings/settings_player.dart
  • Code Duplication · Duplicated block (28 lines × 2) lib/screens/library/editor/list_editor.dart
  • Code Duplication · Duplicated block (27–28 lines × 2) lib/screens/profile/profile_page.dart
  • Code Duplication · Duplicated block (25–26 lines × 2) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (21–25 lines × 3) lib/screens/settings/sub_settings/settings_player.dart
  • Code Duplication · Duplicated block (24–25 lines × 2) lib/screens/anime/watch/controls/top_controls.dart
  • Code Duplication · Duplicated block (20–25 lines × 2) lib/screens/settings/sub_settings/settings_player.dart
  • Code Duplication · Duplicated block (24–25 lines × 2) lib/widgets/common/media_mode_selector.dart
  • Code Duplication · Duplicated block (20–23 lines × 4) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (22 lines × 3) lib/controllers/offline/offline_storage_controller.dart
  • Code Duplication · Duplicated block (22 lines × 2) lib/models/notification/notification_item.dart
  • Code Duplication · Duplicated block (21–22 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart
  • Code Duplication · Duplicated block (22 lines × 2) lib/screens/anime/widgets/character_staff_sheet.dart
  • Code Duplication · Duplicated block (21–22 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart
  • Code Duplication · Duplicated block (22 lines × 2) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (22 lines × 2) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart
  • Code Duplication · Duplicated block (20–21 lines × 3) lib/services/commentum_service.dart
  • Code Duplication · Duplicated block (20 lines × 4) lib/models/notification/notification_item.dart
  • Code Duplication · Duplicated block (20 lines × 2) lib/screens/anime/widgets/anime_stats.dart
  • Code Duplication · Duplicated block (19–20 lines × 2) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (18–19 lines × 4) lib/screens/settings/sub_settings/settings_player.dart
  • Code Duplication · Duplicated block (19 lines × 3) lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart
  • Code Duplication · Duplicated block (19 lines × 2) lib/screens/profile/profile_page.dart
  • Code Duplication · Duplicated block (18–19 lines × 2) lib/screens/profile/profile_page.dart
  • Code Duplication · Duplicated block (18–19 lines × 2) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (18 lines × 10) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Duplicated block (18 lines × 8) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Duplicated block (18 lines × 4) lib/screens/settings/sub_settings/settings_player.dart
  • Code Duplication · Duplicated block (18 lines × 2) lib/screens/anime/watch/controls/bottom_controls.dart
  • Code Duplication · Duplicated block (18 lines × 2) lib/screens/downloads/controller/download_controller.dart
  • Code Duplication · Duplicated block (15–17 lines × 5) lib/services/commentum_service.dart
  • Code Duplication · Duplicated block (16–17 lines × 2) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (17 lines × 2) lib/screens/settings/sub_settings/settings_player.dart
  • Code Duplication · Duplicated block (16 lines × 4) lib/controllers/discord/discord_rpc.dart
  • Code Duplication · Duplicated block (15–16 lines × 4) lib/screens/anime/widgets/anime_stats.dart
  • Code Duplication · Duplicated block (16 lines × 2) lib/controllers/services/anilist/anilist_auth.dart
  • Code Duplication · Duplicated block (15–16 lines × 2) lib/screens/library/editor/list_editor.dart
  • Code Duplication · Duplicated block (14–15 lines × 4) lib/screens/downloads/controller/download_controller.dart
  • Code Duplication · Duplicated block (15 lines × 3) lib/controllers/discord/discord_rpc.dart
  • Code Duplication · Duplicated block (14–15 lines × 3) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart
  • Code Duplication · Duplicated block (15 lines × 2) lib/controllers/services/widgets/widgets_builders.dart
  • Code Duplication · Duplicated block (14–15 lines × 2) lib/screens/profile/widgets/profile_header.dart
  • Code Duplication · Duplicated block (15 lines × 2) lib/screens/settings/sub_settings/settings_player.dart
Rebuild cost: about €210,000 · Estimate
Cost to rebuild€70,000 to €350,000, for 1,174 to 3,724 hours of work, about 1.5 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 32. 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: 247,372 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
Raises the score by about 12.5 points · Medium effort · Access Controls
2
Stop accepting every TLS certificate: delete the `badCertificateCallback` / `onBadCertificate` / `validateCertificate` that returns `true` so the chain, hostname and expiry are verified, and trust a self-signed or private server by loading its CA into a `SecurityContext` — never by switching verification off.
This repository constructs a TLS client that accepts any certificate at 3 sites, not one: `lib/main.dart:91` (`badCertificateCallback` returning `true`), `lib/services/cast/cast_v2_client.dart:47` (`onBadCertificate` returning `true`), `lib/utils/download_isolate_pool.dart:15` (`badCertificateCallback` returning `true`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Raises the score by about 12.5 points · Medium effort · Web-Security Posture
3
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (3), REDACTED, REDACTED.
Raises the score by about 5.4 points · Low effort · Secrets (history)

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 €210,000 to build again, about 1.5 person-years of work. Its weakest lens is Security and Compliance, at 9.1 (Critical). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do. Of all the actions in this report, it raises the score most for the work it takes: about 12.5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 4.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 18% on every change. The history of the code shows how much it changes: about 154,643 lines over the last 90 days, which is about 627,163 lines a year. At that pace, the extra work comes to an estimated 128.1 to 768.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch android android android:app android:app anymex anymex flutter_iconly flutter_iconly anymex->flutter_iconly rhttp (pub) rhttp (pub) anymex->rhttp (pub) build_tool build_tool device_apps (Gradle) device_apps (Gradle) device_apps (pub) device_apps (pub) rhttp (Cargo) rhttp (Cargo) rhttp (Gradle) rhttp (Gradle)

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.

28 modules, with 35 dependencies between them. 2 loops run through 10 of the modules, marked above the diagonal.

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 com.flutter_rust_bridge.rhttp2 com.flutter_rust_bridge.rhttp.RhttpPlugin3 com.ryan.anymex4 com.ryan.anymex.MainActivity5 fr.g123k.deviceapps.listener6 fr.g123k.deviceapps.utils7 repo.update_source8 repository.ai9 repository.mixins10 repository.src11 rhttp.api.error12 rhttp.api.init13 rhttp.api.init.init_android_context14 rhttp.api.stream15 rhttp.utils.socket_addr16 fr.g123k.deviceapps17 repo18 repository.models19 rhttp.api.http20 repository.database21 repository.utils22 rhttp.api.client23 repository.repositories24 repository.services25 repository.widgets26 repository.screens27 repository.controllers28 repository
1 com.flutter_rust_bridge.rhttp
2 com.flutter_rust_bridge.rhttp.RhttpPlugin
3 com.ryan.anymex
4 com.ryan.anymex.MainActivity
5 fr.g123k.deviceapps.listener
6 fr.g123k.deviceapps.utils
7 repo.update_source
8 repository.ai
9 repository.mixins
10 repository.src
11 rhttp.api.error
12 rhttp.api.init
13 rhttp.api.init.init_android_context
14 rhttp.api.stream
15 rhttp.utils.socket_addr
16 fr.g123k.deviceapps2
17 repo3
18 repository.models16
19 rhttp.api.http12
20 repository.database2
21 repository.utils313
22 rhttp.api.client2
23 repository.repositories11
24 repository.services1121
25 repository.widgets23412519
26 repository.screens75551026145
27 repository.controllers102891
28 repository12
Uses a module listed above itPart of a loopThe module itself
1 com.flutter_rust_bridge.rhttp2 com.flutter_rust_bridge.rhttp.RhttpPlugin3 com.ryan.anymex4 com.ryan.anymex.MainActivity5 fr.g123k.deviceapps.listener6 fr.g123k.deviceapps.utils7 repo.update_source8 repository.ai9 repository.mixins10 repository.src11 rhttp.api.error12 rhttp.api.init13 rhttp.api.init.init_android_context14 rhttp.api.stream15 rhttp.utils.socket_addr16 fr.g123k.deviceapps17 repo18 repository.models19 rhttp.api.http20 repository.database21 repository.utils22 rhttp.api.client23 repository.repositories24 repository.services25 repository.widgets26 repository.screens27 repository.controllers28 repositorycom.flutter_rust_bridge.rhttp1com.flutter_rust_bridge.rhttp.RhttpPlugin2com.ryan.anymex3com.ryan.anymex.MainActivity4fr.g123k.deviceapps.listener5fr.g123k.deviceapps.utils6repo.update_source7repository.ai8repository.mixins9repository.src10rhttp.api.error11rhttp.api.init12rhttp.api.init.init_android_context13rhttp.api.stream14rhttp.utils.socket_addr15fr.g123k.deviceapps16repo17repository.models18rhttp.api.http19repository.database20repository.utils21rhttp.api.client22repository.repositories23repository.services24repository.widgets25repository.screens26repository.controllers27repository2823161223132111121234125197555102614510289112

At a glance — Code Health · 46.1 · Weak · gated by D2, D4, X4 ·

At a glance — Architecture · 93.8 · Exemplary ·

At a glance — Maturity · 62.1 · Adequate · gated by M2 ·

At a glance — Readiness · 41.5 · Weak · gated by D13, P3 ·

At a glance — Security · 9.1 · Critical · gated by D28, D29, D36, C2, S1 ·

At a glance — Domain Modelling · 100.0 · Exemplary ·

At a glance — Performance · 60.0 · Adequate ·

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 — Injection53High / Critical
A07:2025 — Authentication Failures14High / Critical
A03:2025 — Software Supply Chain Failures12Medium

Roadmap

Top priorities: Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do; Stop accepting every TLS certificate: delete the `badCertificateCallback` / `onBadCertificate` / `validateCertificate` that returns `true` so the chain, hostname and expiry are verified, and trust a self-signed or private server by loading its CA into a `SecurityContext` — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 3 sites, not one: `lib/main.dart:91` (`badCertificateCallback` returning `true`), `lib/services/cast/cast_v2_client.dart:47` (`onBadCertificate` returning `true`), `lib/utils/download_isolate_pool.dart:15` (`badCertificateCallback` returning `true`). Each is a separate decision — fixing only the line this row cites leaves the others in place; Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (3), REDACTED, REDACTED.

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

Do thisHelpsEffortDimension
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.+12.5 ptsMediumAccess Controls
Stop accepting every TLS certificate: delete the `badCertificateCallback` / `onBadCertificate` / `validateCertificate` that returns `true` so the chain, hostname and expiry are verified, and trust a self-signed or private server by loading its CA into a `SecurityContext` — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 3 sites, not one: `lib/main.dart:91` (`badCertificateCallback` returning `true`), `lib/services/cast/cast_v2_client.dart:47` (`onBadCertificate` returning `true`), `lib/utils/download_isolate_pool.dart:15` (`badCertificateCallback` returning `true`). Each is a separate decision — fixing only the line this row cites leaves the others in place.+12.5 ptsMediumWeb-Security Posture
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (3), REDACTED, REDACTED.+5.4 ptsLowSecrets (history)
Resolve the 5 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (4), REDACTED.+4.5 ptsLowREDACTED Scanning
Resolve the 2 Banned license finding(s) in License Compliance.+3.2 ptsLowLicense Compliance
Add a SAST step to CI running what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — so a security regression fails the build instead of landing.+3.1 ptsMediumSecurity & performance tooling
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3).+1.5 ptsLowStatic Analysis (SAST)
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED.+1.5 ptsLowStatic Analysis (SAST)

File quality

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

FileScoreBandWorst signal
REDACTED0.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED2.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
lib/controllers/services/anilist/anilist_data.dart4.8MixedCyclomatic Complexity: AnilistData.fetchFilterData (cyclomatic 35)
lib/screens/anime/home_page.dart4.8MixedGod Classes: MethodTooLong: _AnimeHomePageState.build
REDACTED5.1MixedSecrets (history): REDACTED: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
lib/controllers/services/backup_restore/backup_restore_service.dart5.5MixedCyclomatic Complexity: BackupRestoreService._applyExternalMangaAndAnime (cyclomatic 63)
lib/screens/anime/watch/controller/player_controller.dart5.5MixedCyclomatic Complexity: PlayerController._bindPlayerStreams (cyclomatic 54)
lib/widgets/non_widgets/activity_composer_sheet.dart5.5MixedCyclomatic Complexity: ActivityComposerSheetState.build (cyclomatic 36)
lib/screens/anime/watch/controls/bottom_controls.dart5.5MixedCyclomatic Complexity: BottomControls._buildLayout (cyclomatic 30)
lib/screens/anime/widgets/comments/comments_section.dart5.5MixedCyclomatic Complexity: _CommentSectionState._showUserHistoryDialog (cyclomatic 30)
lib/controllers/offline/offline_storage_controller.dart5.5MixedCyclomatic Complexity: OfflineStorageController.addOrUpdateAnime (cyclomatic 29)
lib/screens/search/widgets/search_widgets.dart5.5MixedCyclomatic Complexity: _FuturisticFilterSheetState._loadCurrentFilters (cyclomatic 27)
lib/screens/anime/widgets/list_editor.dart5.5MixedCyclomatic Complexity: _ListEditorModalState.initState (cyclomatic 25)

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

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

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

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

Could not be resolved — 8

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

Methodology & how to trust this report

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

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

What we checked — 63 dimensions across the health lenses
D1D2D3D4D5D6D13D14D15D17D19D20D26D28D29D30D34D35D36D43D44AX1AX10AX3AX4AX6AX9C2DM5DM6GD1IC1M1M2M3M4P1P10P2P3P4P6PF3S1X1X12X13X14X16X17X18X19X2X21X22X23X25X27X28X3X30X4X5

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1ebaa-d3b9-79a0-99e7-2a13ad01ea43.

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

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in packages/rhttp/rust did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.dart, .swift, .kt) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 6 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a 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.
  • 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 (20 contributor(s) across 2418 commit(s) sampled, automation and bot accounts excluded). One of them holds 83% of the history; the other 19 hold 0.9% 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.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (pubspec.yaml), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `packages/rhttp/android/settings.gradle.kts` 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 1 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P1 CI/CD gates — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • P5 DR & Backup — 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. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 83 further occurrence(s) are not listed individually; the score already reflects all 123.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 272 further occurrence(s) are not listed individually; the score already reflects all 312.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • 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.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

258 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Media.fromSimkl at 101. A further 7 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 ThemeRenderer._getDynamicColor at 62 — they are counted neither in the figure above nor in this dimension's score. 4 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: lib/widgets/anymex_widgets/anymex_animated_logo.dart (_AnymeXAnimatedLogoState._buildAnimatedLogo at 24), lib/models/notification/notification_item.dart (NotificationItem.typeIcon at 23), lib/screens/notifications/notification_screen.dart (_NotificationCard._getCategoryIcon at 23), lib/screens/settings/sub_settings/reader/settings_reader_manga.dart (_SettingsReaderMangaState.build at 18). 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.

Media.fromSimkl (cyclomatic 101)lib/models/Media/media.dart:559
TachiyomiBackupParser.parseBytes (cyclomatic 90)lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:31
_CharacterStaffSheetContentState.build (cyclomatic 78)lib/screens/anime/widgets/character_staff_sheet.dart:140
SourceMapper.mapMedia (cyclomatic 74)lib/controllers/source/source_mapper.dart:86
Media.fromJson (cyclomatic 66)lib/models/Media/media.dart:1128

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

What to do

  1. Bring the 7 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Media.fromSimkl (cyclomatic 101), TachiyomiBackupParser.parseBytes (cyclomatic 90), _CharacterStaffSheetContentState.build (cyclomatic 78). — 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 7 together lifts Cyclomatic Complexity from 4.6 to about 5.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

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

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

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

445 method(s) exceeded the cognitive complexity threshold of 15; the worst was TachiyomiBackupParser.parseBytes at 186.

TachiyomiBackupParser.parseBytes (cognitive 186)lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:31
DubService.fetchDubSources (cognitive 185)lib/screens/anime/misc/dub_service.dart:10
DownloadController._mergeMediaDirectory (cognitive 165)lib/screens/downloads/controller/download_controller.dart:2019
BackupRestoreService._applyExternalMangaAndAnime (cognitive 162)lib/controllers/services/backup_restore/backup_restore_service.dart:1679
DownloadController._syncMediaFolderMeta (cognitive 153)lib/screens/downloads/controller/download_controller.dart:2337

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

What to do

  1. Bring the 31 bodies over 60 down to 60 or less in Cognitive Complexity — start with TachiyomiBackupParser.parseBytes (cognitive 186), DubService.fetchDubSources (cognitive 185), DownloadController._mergeMediaDirectory (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 31 together lifts Cognitive Complexity from 2.0 to about 3.7/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes6.1 / 10Adequate✓ Tool-verified

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

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

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

495 god class(es) detected.

MethodTooLong: _UserProfileHeaderState.build · ×254lib/screens/profile/widgets/user_profile_header.dart:62
FileTooLong: comments/comments_section.dart · ×110lib/screens/anime/widgets/comments/comments_section.dart
ClassTooLong: _CommentSectionState · ×102lib/screens/anime/widgets/comments/comments_section.dart:55
TooManyMethods: Settings · ×29lib/controllers/settings/settings.dart:26

What to do

  1. Resolve the 254 MethodTooLong finding(s) in God Classes — start with comments_section.dart (13), compatibility_result_page.dart (7), REDACTED (5). — One of this dimension's main actionable groups (254 warning-level).
  2. Resolve the 110 FileTooLong finding(s) in God Classes — start with reader_controller.dart (2), list_editor.dart (2), comments_section.dart. — One of this dimension's main actionable groups (110 warning-level).
  3. Resolve the 102 ClassTooLong finding(s) in God Classes — start with reader_controller.dart (2), list_editor.dart (2), settings_moderation.dart (2). — One of this dimension's main actionable groups (102 warning-level).

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

D4 · Code Duplication3.0 / 10Weak✓ Tool-verified

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

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

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

958 duplicated block group(s) detected. 17.5 % of the production lines (43,261 of 247,372) are in a reported copy. A further 329 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 6 of the 1287 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (11 lines × 2) · ×47lib/controllers/services/anilist/anilist_data.dart:90
Duplicated block (13 lines × 2) · ×42lib/controllers/offline/offline_storage_controller.dart:934
Duplicated block (10 lines × 2) · ×38lib/controllers/services/anilist/anilist_auth.dart:2140
Duplicated block (12 lines × 2) · ×35lib/controllers/services/anilist/anilist_api.dart:127
Duplicated block (8 lines × 2) · ×30lib/controllers/services/backup_restore/backup_restore_service.dart:704

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

What to do

  1. Resolve the 47 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with backup_restore_service.dart (2), compact_style.dart (2), compatibility_result_page.dart (2). — One of this dimension's main actionable groups (47 warning-level).
  2. Resolve the 42 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with anime_stats.dart (3), settings_view.dart (2), profile_page.dart (2). — One of this dimension's main actionable groups (42 warning-level).
  3. Resolve the 38 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with community_service.dart (3), active_downloads.dart (3), mal_service.dart (2). — One of this dimension's main actionable groups (38 warning-level).

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.3 / 10Stronggated by 26 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

26 of 458 classes have LCOM4 above 3.

Low cohesion: CommentumService (LCOM4 28) · ×26lib/services/commentum_service.dart:47

What to do

  1. Resolve the 26 Low cohesion finding(s) in Cohesion (LCOM4) — start with commentum_service.dart, offline_storage_controller.dart, REDACTED. — One of this dimension's main actionable groups (26 warning-level).

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

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

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

3 secret(s) detected.

REDACTED

What to do

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

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

D14 · License Compliance6.0 / 10Adequate✓ Tool-verified

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

2 of 312 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 6 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 41 package(s) locked at an older version the licence read is that of the package's latest analysed release, not of the locked one. 5 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 Gradle build (build.gradle/build.gradle.kts), and the licences of those dependencies 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.

Banned license: dart_discord_presence · ×2

What to do

  1. Resolve the 2 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (2 issue-level).

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

D15 · Churn × Complexity Hotspots9.4 / 10Stronggated by 81 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.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: lib/screens/anime/watch/controller/player_controller.dart (19×54=1026); lib/screens/anime/details/media_details_page.dart (20×39=780); lib/screens/downloads/controller/download_controller.dart (13×56=728) Repeated repair below the complexity floor: lib/screens/anime/watch/watch_view.dart (5 of 7 changes were fixes); lib/database/database.dart (3 of 5 changes were fixes); lib/screens/manga/widgets/chapter_section.dart (3 of 5 changes were fixes)

Hotspot: lib/screens/anime/watch/controller/player_controller.dart · ×76lib/screens/anime/watch/controller/player_controller.dart:1303
Repeated repair: lib/screens/anime/watch/watch_view.dart · ×5lib/screens/anime/watch/watch_view.dart:83

What to do

  1. Resolve the 76 Hotspot finding(s) in Churn × Complexity Hotspots — start with player_controller.dart, media_details_page.dart, download_controller.dart. — One of this dimension's main actionable groups (76 warning-level).
  2. Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with watch_view.dart, database.dart, chapter_section.dart. — One of this dimension's main actionable groups (5 warning-level).

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

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality9.0 / 10Exemplary✓ Tool-verified

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

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

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

1 of 2 documentation facets pass in full; short on: F2 example. 8 document(s) read across 10 unit(s).

Documentation: no build, run or usage examplepackages/rhttp/cargokit/build_tool/README.md:1

✓ On the Gold path — maintain.

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

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

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

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

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

No architecture decision records were found.

No ADRs foundpackages/rhttp/cargokit/build_tool/bin/build_tool.dart:6

What to do

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

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

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

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

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

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

1 of 11 build units (Cargo, Gradle, Xcode, pub) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesionpubspec.yaml:1

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with pubspec.yaml. — 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)2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Documented

8 finding(s): 0 critical, 8 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 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

53 finding(s): 0 critical, 48 high, 5 medium, 0 low. 32 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 1 file(s) — `lib/ffi/image_decoder.h` — so no absence of findings in them is evidence of anything, and nothing in them was analysed. 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 3 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

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

What to do

  1. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  3. No action in Static Analysis (SAST) — all 32 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (32 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

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

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

No known-vulnerable dependencies in any ecosystem this repository declares.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D34 · Knowledge Freshness9.8 / 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 9.8 / 10 · rule-coverage 100% · ceiling Documented

8 of 488 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is lib/screens/novel/reader/widgets/dictionary_popup.dart. Counted over 488 of the 638 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×8lib/screens/novel/reader/widgets/dictionary_popup.dart:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.7 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: reader_view.dart↔settings_view.dart 73%; player_controller.dart↔better_player.dart 73%; widgets_builders.dart↔main.dart 64%

Boundary-crossing change coupling: player_adaptor.dart ↔ settings_player.dartlib/models/player/player_adaptor.dart:1
Change coupling: reader_view.dart ↔ settings_view.dart · ×11lib/screens/manga/widgets/reader/reader_view.dart:1
Change coupling clique: anilist_data.dart, mal_service.dart, simkl_service.dartlib/controllers/services/anilist/anilist_data.dart

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with player_adaptor.dart. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 11 Change coupling finding(s) in Change Coupling — start with REDACTED (2), reader_view.dart, player_controller.dart. — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with anilist_data.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 & Signing2.5 / 10Weak✓ 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 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 4 platform declaration(s) and 6 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.0 / 10Exemplary✓ Tool-verified

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

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

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

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation9.1 / 10Exemplary✓ 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.

  • `BasePlayer` declares 32 abstract methods: `positionStream`, `durationStream`, `bufferStream`, `playingStream`, `bufferingStream`, `tracksStream`, `rateStream`, `errorStream`, `subtitleStream`, `heightStream`, `completedStream`, `state`, `initialize`, `open`, `seek`, `play`, `pause`, `stop`, `playOrPause`, `setRate`, `setVolume`, `setVideoTrack`, `setAudioTrack`, `setSubtitleTrack`, `setSubtitleDelay`, `setAudioDelay`, `setAudioChannelLayout`, `toggleVideoFit`, `screenshot`, `dispose`, `getVideoWidget`, `setHardwareDecoding`. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. 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. — lib/screens/anime/watch/player/base_player.dart:5
  • `RustLibApi` declares 28 abstract methods: `crateApiStreamDart2RustStreamSinkAdd`, `crateApiStreamDart2RustStreamSinkClose`, `crateApiHttpCancelRequest`, `crateApiHttpCancelRunningRequests`, `crateApiClientClientSettingsDefault`, `crateApiClientCreateDynamicResolverSync`, `crateApiClientCreateStaticResolverSync`, `crateApiStreamCreateStream`, `crateApiInitInitApp`, `crateApiHttpMakeHttpRequest`, `crateApiHttpMakeHttpRequestReceiveStream`, `crateApiHttpRegisterClient`, `crateApiHttpRegisterClientSync`, `rust_arc_increment_strong_count_CancellationToken`, `rust_arc_decrement_strong_count_CancellationToken`, `rust_arc_decrement_strong_count_CancellationTokenPtr`, `rust_arc_increment_strong_count_Dart2RustStreamReceiver`, `rust_arc_decrement_strong_count_Dart2RustStreamReceiver`, `rust_arc_decrement_strong_count_Dart2RustStreamReceiverPtr`, `rust_arc_increment_strong_count_Dart2RustStreamSink`, `rust_arc_decrement_strong_count_Dart2RustStreamSink`, `rust_arc_decrement_strong_count_Dart2RustStreamSinkPtr`, `rust_arc_increment_strong_count_DnsSettings`, `rust_arc_decrement_strong_count_DnsSettings`, `rust_arc_decrement_strong_count_DnsSettingsPtr`, `rust_arc_increment_strong_count_RequestClient`, `rust_arc_decrement_strong_count_RequestClient`, `rust_arc_decrement_strong_count_RequestClientPtr`. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. 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. — packages/rhttp/lib/src/rust/frb_generated.dart:88
  • `RustLibApiImplPlatform` declares 302 abstract methods: `dco_decode_AnyhowException`, `dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Chrono_Duration`, `dco_decode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken_Output_unit_AnyhowException`, `dco_decode_DartFn_Inputs_String_Output_list_String_AnyhowException`, `dco_decode_DartFn_Inputs_http_response_Output_unit_AnyhowException`, `dco_decode_DartFn_Inputs_rhttp_error_Output_unit_AnyhowException`, `dco_decode_DartOpaque`, `dco_decode_Map_String_String_None`, `dco_decode_Map_String_list_String_None`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_StreamSink_list_prim_u_8_strict_Sse`, `dco_decode_String`, `dco_decode_bool`, `dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_box_autoadd_Chrono_Duration`, `dco_decode_box_autoadd_client_certificate`, `dco_decode_box_autoadd_client_settings`, `dco_decode_box_autoadd_cookie_settings`, `dco_decode_box_autoadd_http_body`, `dco_decode_box_autoadd_http_headers`, `dco_decode_box_autoadd_http_method`, `dco_decode_box_autoadd_http_response_body`, `dco_decode_box_autoadd_multipart_payload`, `dco_decode_box_autoadd_proxy_settings`, `dco_decode_box_autoadd_redirect_settings`, `dco_decode_box_autoadd_static_dns_settings`, and 262 more. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. 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. (×2) — packages/rhttp/lib/src/rust/frb_generated.io.dart:17, packages/rhttp/lib/src/rust/frb_generated.web.dart:19

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
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.

C2 · Access Controls0.0 / 10Critical✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • This repository serves requests — an HTTP server (HttpServer.bind) (lib/services/cast/cast_proxy_server.dart:29) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected. — lib/services/cast/cast_proxy_server.dart:29

What to do

  • Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain entity fused to a persistence ORM (drift/floor/isar/objectbox/hive) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

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

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

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

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.

  • `onScrollNotification` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — lib/widgets/anymex_widgets/anymex_header.dart:47
  • `detachSocket`'s body only throws an UnsupportedError or an UnimplementedError that gives its reason — sometimes a deliberate refusal, often an unfinished stub. Confirm it's intentional. — packages/rhttp/lib/src/client/io/io_response.dart:38
  • `redirect`'s body only throws an UnsupportedError or an UnimplementedError that gives its reason — sometimes a deliberate refusal, often an unfinished stub. Confirm it's intentional. — packages/rhttp/lib/src/client/io/io_response.dart:77

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
  • Clear the softer debt: re-enable or delete tests marked `skip:`, decide whether each empty method or UnsupportedError is deliberate (and say so in a comment), and replace `// ignore_for_file: type=lint` with targeted, justified ignores.
M1 · Documentation (README)8.2 / 10Strong✓ Tool-verified

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

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

What to do

  • 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.
M2 · Architecture documentation0.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.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

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.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified

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.

What to do

  • Run the test suite in CI via an explicit runner step (`mvn test` for the toolchain this pipeline already uses) and gate merges on it.
P10 · Library API & versioning9.7 / 10Exemplary✓ Tool-verified

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

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

  • 6 public types in `repository.src` are marked as implementation by their own namespace, folder or name: `RustLibApiImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:201, name ends in `Impl`), `CancellationTokenImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4190, name ends in `Impl`), `Dart2RustStreamReceiverImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4214, name ends in `Impl`), `Dart2RustStreamSinkImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4243, name ends in `Impl`), `DnsSettingsImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4280, name ends in `Impl`), `RequestClientImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4300, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — packages/rhttp/lib/src/rust/frb_generated.dart:201

What to do

  • Hide `repository.src` (`RustLibApiImpl`, `CancellationTokenImpl`, `Dart2RustStreamReceiverImpl`, `Dart2RustStreamSinkImpl`, `DnsSettingsImpl`, `RequestClientImpl`) (Dart: a `_` name, or keep it under `lib/src/` unexported; Java: package-private (no modifier), or leave its package out of `module-info` exports; Kotlin: `internal`; Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability6.0 / 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/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `ios`, `macos`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling0.0 / 10Critical✓ 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.

  • No static application security testing detected. For this repository's stack, add the Dart analyzer's security lints plus `semgrep --config=auto` as a CI step. What was searched, so you can tell an absence from a miss: the 10 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:4
  • `packages/rhttp/rust/Cargo.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — packages/rhttp/rust/Cargo.toml:9

What to do

  • Add a SAST step to CI running what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • 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.
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.

PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `_deleteMatchingDiskFiles` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/controllers/services/anilist/anilist_cache.dart:133
  • `pickBackupFile` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/controllers/services/backup_restore/backup_restore_service.dart:1255
  • `getTorrentCacheSize` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/controllers/services/storage/storage_manager_service.dart:50
  • `clearTorrentCacheOnly` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/controllers/services/storage/storage_manager_service.dart:99
  • `clearOtherTempOnly` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/controllers/services/storage/storage_manager_service.dart:125
  • `_clearDirectoryContents` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/controllers/services/storage/storage_manager_service.dart:213
  • `_loadLocalSubtitles` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/screens/anime/watch/controller/player_controller.dart:1539
  • `_fetchChapterPages` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/screens/manga/controller/reader_controller.dart:279
  • `fetchImages` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/screens/manga/controller/reader_controller.dart:1927
  • `_testProxy` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/screens/settings/sub_settings/settings_network.dart:945
  • `_getPrecompiledArtifacts` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — packages/rhttp/cargokit/build_tool/lib/src/artifacts_provider.dart:99
  • `_tryDownloadArtifacts` is async and calls writeAsBytesSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — packages/rhttp/cargokit/build_tool/lib/src/artifacts_provider.dart:184
  • `build` is async and calls copySync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — packages/rhttp/cargokit/build_tool/lib/src/build_cmake.dart:19
  • `build` is async and calls createSync, copySync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — packages/rhttp/cargokit/build_tool/lib/src/build_gradle.dart:22
  • `build` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — packages/rhttp/cargokit/build_tool/lib/src/build_pod.dart:20
  • `run` is async and calls createSync, readAsBytesSync, deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — packages/rhttp/cargokit/build_tool/lib/src/precompile_binaries.dart:52
  • `getCustomFontNames` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/utils/external_font_loader.dart:255
  • `loadAllCustomFonts` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/utils/external_font_loader.dart:291
  • `deleteCustomFont` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/utils/external_font_loader.dart:325
  • `download` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/utils/media_downloader.dart:105
  • `_downloadM3u8WithProgress` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/utils/media_downloader.dart:183

What to do

  • Dart: await the async dart:io API (readAsString, writeAsString, Process.run, Future.delayed) instead of the *Sync variant or sleep(), or move heavy synchronous work to another isolate with Isolate.run.
S1 · Web-Security Posture0.0 / 10Critical✓ Tool-verified

Other · Security — Read from this repository's Dart source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS certificate validation — facts about code that hold whether or not it serves anything itself. The TLS protocol version is not read: `dart:io` leaves the protocol floor to the platform's TLS library and has no switch that admits an obsolete version. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. This repository serves HTTP itself (lib/services/cast/cast_proxy_server.dart:29 — `HttpServer.bind(`), so its Dart source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Dart spelling appears in production source, not proven on every route.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `badCertificateCallback` returning `true` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the callback so `dart:io` validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: load its CA into a `SecurityContext` (`setTrustedCertificatesBytes`) and pass it as `HttpClient(context: …)` / `SecureSocket.connect(…, context: …)`, which keeps the chain and hostname checks on. A callback that must exist should compare the presented certificate with a pinned fingerprint, never return `true`. (×3) — lib/main.dart:91, lib/services/cast/cast_v2_client.dart:47, lib/utils/download_isolate_pool.dart:15
  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha256.convert(…)` from `package:crypto`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:580
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `firebase.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — firebase.json:1
  • This repository runs an HTTP server that is not bound to the loopback interface alone — or binds it at an address its source does not spell out — and nothing in its Dart source secures the transport: no `HttpServer.bindSecure` or `securityContext:`, no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: lib/services/cast/cast_proxy_server.dart:29 — `HttpServer.bind(`.

What to do

  • Stop accepting every TLS certificate: delete the `badCertificateCallback` / `onBadCertificate` / `validateCertificate` that returns `true` so the chain, hostname and expiry are verified, and trust a self-signed or private server by loading its CA into a `SecurityContext` — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 3 sites, not one: `lib/main.dart:91` (`badCertificateCallback` returning `true`), `lib/services/cast/cast_v2_client.dart:47` (`onBadCertificate` returning `true`), `lib/utils/download_isolate_pool.dart:15` (`badCertificateCallback` returning `true`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
  • Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
  • Secure the server's transport: serve TLS itself (`HttpServer.bindSecure(…, context)`, or `shelf_io.serve(…, securityContext: context)`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only. A server only this device needs to reach should bind `InternetAddress.loopbackIPv4` instead.
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 stream3.5 / 10Weak✓ Tool-verified

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.

  • The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`). — android/app/src/main/kotlin/com/ryan/anymex/MainActivity.kt:375

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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

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

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 document3.5 / 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.

  • `Comment.fromMap` is public and takes `Map m` from its caller, and it calls itself at line 153 (`Comment.fromMap`) with a piece of `m` — and nowhere in `Comment.fromMap` 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 `Comment.fromMap` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/database/comments/model/comment.dart:153

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/5 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.
  • `_downloadAndInstallAndroid` calls `dio.download(…)` 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/utils/updater.dart:418
  • `_downloadWindows` calls `dio.download(…)` 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/utils/updater.dart:463
  • `_downloadShaders` calls `dio.download(…)` 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/settings/sub_settings/player/settings_player_shaders.dart:85
  • `getDetails` calls `Dio(…).get(…)` 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`. — REDACTED:22
  • `urlToDcAsset` calls `Dio(…).post(…)` 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/controllers/discord/discord_rpc.dart:464

What to do

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

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

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

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. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`. In Rust, where a guard or permit releases when it is dropped, whether a release written BY HAND — `add_permits` after a forgotten permit, `force_unlock` after a leaked guard, a raw lock's `unlock` — matches the state the function's own acquisitions put the primitive in: not after a try or timed acquire whose failure does not leave, not from a cleanup set up before an acquire that can fail, not skipped by a `?`, `return`, `break` or `continue`, and not on top of a guard that still releases itself.

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

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.

  • `finer` at line 109 is called with an argument built by `arguments.join('…')` (line 109), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because finer is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on. — packages/rhttp/cargokit/build_tool/lib/src/util.dart:109

What to do

  • In Dart, put the construction behind the logger's own check (`if (log.isLoggable(Level.FINE))` for package:logging, `if (kDebugMode)` for a line only a debug build needs), or hand the logger a closure it calls only when the record is written (`log.fine(() => 'rows: ${rows.map((r) => r.id).join(', ')}')`; package:logger's `logger.d(() => …)` likewise). Interpolating the value into the message is not the fix: Dart builds the string, and every `map`, `join` or `jsonEncode` inside it, before the call is entered.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

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

Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. 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.

X3 · Exception handling4.4 / 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.

  • 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. (×30) — lib/main.dart:135, lib/main.dart:778, lib/main.dart:785, …
  • `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×7) — lib/widgets/subsampling_scale_image_view/ffi_image_decoder.dart:476, lib/widgets/non_widgets/reasons_sheet.dart:830, lib/widgets/media_items/media_peek_popup.dart:410, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. — lib/widgets/non_widgets/activity_composer_sheet.dart:130
  • `catch (e)` 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. (×2) — lib/widgets/common/baked_blur_image.dart:341, lib/widgets/anymex_widgets/anymex_animated_logo.dart:77

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X4 · Structured logging1.5 / 10Critical✓ Tool-verified

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

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

  • `exception` at line 120 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:120
  • `exception` at line 123 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:123
  • `exception` at line 162 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:162
  • `info` at line 175 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:175
  • `info` at line 196 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:196
  • `warning` at line 239 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:239
  • `info` at line 289 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:289
  • `info` at line 315 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:315
  • `info` at line 328 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:328
  • `exception` at line 353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:353
  • `exception` at line 356 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:356
  • `warning` at line 372 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:372
  • `warning` at line 390 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:390
  • `exception` at line 445 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:445
  • `info` at line 460 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:460
  • `info` at line 468 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:468
  • `exception` at line 470 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:470
  • `info` at line 493 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:493
  • `exception` at line 496 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — repo/update_source.py:496

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types8.9 / 10Strong✓ 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 Health46.1Weak — gated by D2, D4, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture93.8ExemplarySolid.
Maturity62.1Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness41.5Weak — gated by D13, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security9.1Critical — gated by D28, D29, D36, C2, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100.0ExemplaryStrongest area.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 3 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 10 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 57 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 — Frontend below the scale floor (15 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (15 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (15 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (15 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (15 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (15 DOM element(s) < 25) — too little surface to assess accessibility.
  • 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.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an Isar, ObjectBox, Floor or Hive entity, or a Serverpod table model — and no database or data-store client (sqflite, Drift, Isar, Hive, Realm, Firestore, Supabase, postgres, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an ObjectBox/Floor @Entity, an Isar @collection, a Hive @HiveType or a Serverpod table model — and no database or data-store client (sqflite, Firestore, Supabase, postgres, …) imported either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an ObjectBox/Floor @Entity, an Isar @collection, a Hive @HiveType or a Serverpod table model — and no database or data-store client (sqflite, Firestore, Supabase, postgres, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an ObjectBox/Floor @Entity, an Isar @collection, a Hive @HiveType or a Serverpod table model — and no database or data-store client (sqflite, Firestore, Supabase, postgres, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~1716 lines of test source are present (.dart, .swift, .kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — no .dart test runner
  • D12 Dependency Hygiene — Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 6 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
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — D21 withholds its sibling role token rows: 1 candidate(s) found and not reported.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .dart, .java, .kt, .py, .rs, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.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.
  • 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 measured — Rust suite
  • DM1 Aggregate boundaries — not scored for Dart: aggregate-vs-value-object classification cannot be told apart in source (every class-holding-class reads alike), and a child COLLECTION (legitimate membership) vs a single embedded aggregate is indistinguishable — reported as guidance rather than measured
  • DM2 Strongly-typed ids — no in-repo typed-id idiom — primitive-obsession recorded as advisory DM8, DM2 not gated
  • DM3 Integration-event coupling — not scored for Dart: a cross-package domain leak cannot be told apart in source from a legitimate shared-kernel package, and most repositories ship a single package — reported as guidance rather than measured
  • DM4 Rich vs anemic domain model — this Dart repository declares no domain-layer entity carrying stored data (every type is a typed-id wrapper, DTO/config, ORM row or presentation container), so DM4's rich-vs-anemic read has no population to be taken over
  • DM7 Repository granularity — not scored for Dart: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Dart, JVM, 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for classes extending benchmark_harness's `BenchmarkBase`, `AsyncBenchmarkBase` or `PerfBenchmarkBase` (directly or through a base of your own), `benchmark(…)` calls under the pub `benchmark` package, Flutter's `benchmarkWidgets`, `watchPerformance` or `traceAction` in a test importing flutter_test, integration_test or flutter_driver, or benchmark_harness, benchmark or web_benchmarks in a pubspec.yaml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X9 Subsumed condition operand — 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 — 67 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 7 more in this group — see findings.md.
D28 · Secrets (history) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
S1 · Web-Security Posture · TLS certificate validation disabled · ×3
  • TLS certificate validation disabled lib/main.dart:91 — `badCertificateCallback` returning `true` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the callback so `dart:io` validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: load its CA into a `SecurityContext` (`setTrustedCertificatesBytes`) and pass it as `HttpClient(context: …)` / `SecureSocket.connect(…, context: …)`, which keeps the chain and hostname checks on. A callback that must exist should compare the presented certificate with a pinned fingerprint, never return `true`.
  • TLS certificate validation disabled lib/services/cast/cast_v2_client.dart:47 — `badCertificateCallback` returning `true` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the callback so `dart:io` validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: load its CA into a `SecurityContext` (`setTrustedCertificatesBytes`) and pass it as `HttpClient(context: …)` / `SecureSocket.connect(…, context: …)`, which keeps the chain and hostname checks on. A callback that must exist should compare the presented certificate with a pinned fingerprint, never return `true`.
  • TLS certificate validation disabled lib/utils/download_isolate_pool.dart:15 — `badCertificateCallback` returning `true` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the callback so `dart:io` validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: load its CA into a `SecurityContext` (`setTrustedCertificatesBytes`) and pass it as `HttpClient(context: …)` / `SecureSocket.connect(…, context: …)`, which keeps the chain and hostname checks on. A callback that must exist should compare the presented certificate with a pinned fingerprint, never return `true`.
D14 · License Compliance · Banned license · ×2
  • Banned license: dart_discord_presence — `dart_discord_presence` 1.2.1 is resolved by this repository's pubspec.lock outside its dev_dependencies, and every licence pub.dev detected in it is one this policy bans (`gpl-3.0`). Where a package carries several licences it is charged only when all of them are banned. Replace the package, or record an accepted exception.
  • Banned license: iconsax — `iconsax` 0.0.8 is resolved by this repository's pubspec.lock outside its dev_dependencies, and every licence pub.dev detected in it is one this policy bans (`gpl-3.0`). Where a package carries several licences it is charged only when all of them are banned. Replace the package, or record an accepted exception.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: player_adaptor.dart ↔ settings_player.dart lib/models/player/player_adaptor.dart:1 — `lib/models/player/player_adaptor.dart` (context models) and `lib/screens/settings/sub_settings/settings_player.dart` (context screens) sit in DIFFERENT parts of the tree yet change together 52% of the time (16 of the 31 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 16 shared commits counted here, the most recent 3 are `7c1c13bc` fix: changed media session to a toggle based feature since its pretty…; `5f6a4eee` feat: add slide to seek toggle in player settings (#513); `9cbd2c77` feat: option to enable/disable hold to seek — run `git show` on any of them.
Serious — 2688 finding(s)
D3 · God Classes · MethodTooLong · ×254
  • MethodTooLong: _UserProfileHeaderState.build lib/screens/profile/widgets/user_profile_header.dart:62 — MethodTooLong — build runs 456 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 356 over it, 4.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: _UserProfileAppBarState.build lib/screens/profile/widgets/user_profile_app_bar.dart:60 — MethodTooLong — build runs 382 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 282 over it, 3.82× 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: DesktopProfileHeader.build lib/screens/profile/widgets/profile_header.dart:72 — MethodTooLong — build runs 360 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 260 over it, 3.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MediaHeader.build lib/widgets/anime/media_header.dart:46 — MethodTooLong — build runs 356 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 256 over it, 3.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MobileProfileHeaderSliver.build lib/screens/profile/widgets/profile_header.dart:583 — MethodTooLong — build runs 349 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 249 over it, 3.49× 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: _UserSearchSheetState.build lib/screens/settings/sub_settings/settings_moderation.dart:303 — MethodTooLong — build runs 349 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 249 over it, 3.49× 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: _SettingsPlayerShadersState.build lib/screens/settings/sub_settings/player/settings_player_shaders.dart:205 — MethodTooLong — build runs 340 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 240 over it, 3.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _BackupRestorePageState._buildImportSection lib/screens/settings/sub_settings/settings_backup.dart:405 — MethodTooLong — _buildImportSection runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ExportBackupSheetState.build lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1047 — MethodTooLong — build runs 333 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 233 over it, 3.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ReaderSettings.showSettings lib/screens/manga/widgets/reader/settings_view.dart:19 — MethodTooLong — showSettings runs 311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _SettingsUiDetailsState._buildLivePreviewCard lib/screens/settings/sub_settings/settings_ui_details.dart:354 — MethodTooLong — _buildLivePreviewCard runs 294 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 194 over it, 2.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Media.fromSimkl lib/models/Media/media.dart:559 — MethodTooLong — fromSimkl 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: MediaModeSelector.build lib/widgets/common/media_mode_selector.dart:109 — MethodTooLong — build runs 289 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× 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: AnilistAuth.getNotifications lib/controllers/services/anilist/anilist_auth.dart:2752 — MethodTooLong — getNotifications runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: __ListMediaEditorBottomSheetState.build lib/screens/library/editor/list_editor.dart:833 — MethodTooLong — build runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ActiveDownloadsState._buildMediaExpandableCard lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:171 — MethodTooLong — _buildMediaExpandableCard runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _WatchiumPageState._buildRoomCard lib/screens/watchium/watchium_page.dart:1137 — MethodTooLong — _buildRoomCard runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _RecommendSheetState._buildAlreadyAdded lib/widgets/non_widgets/recommend_sheet.dart:709 — MethodTooLong — _buildAlreadyAdded runs 270 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 170 over it, 2.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _DownloadScreenState._buildEpisodeStep lib/screens/downloads/download_screen.dart:870 — MethodTooLong — _buildEpisodeStep runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: _SettingsPlayerEngineState.build lib/screens/settings/sub_settings/player/settings_player_engine.dart:545 — MethodTooLong — build runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: _SettingsReaderState._buildNovelReaderSection lib/screens/settings/sub_settings/settings_reader.dart:1122 — MethodTooLong — _buildNovelReaderSection runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Ios26PlayerControlTheme.buildBottomControls lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:229 — MethodTooLong — buildBottomControls runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ActivityCardState.build lib/widgets/non_widgets/activity_card.dart:522 — MethodTooLong — build runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _CommentsRepliesSheetState._buildCommentCard lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:159 — MethodTooLong — _buildCommentCard runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× 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: _EpisodeListBuilderState.build lib/screens/anime/widgets/episode_list_builder.dart:466 — MethodTooLong — build 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.
  • + 229 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×110
  • FileTooLong: comments/comments_section.dart lib/screens/anime/widgets/comments/comments_section.dart — FileTooLong — 2883 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: _CommentSectionState (55-3781). The bar is 500 significant lines; this is 2383 over it, 5.77× 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: REDACTED lib/controllers/services/anilist/anilist_auth.dart — FileTooLong — 2320 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: AnilistAuth (37-3140). The bar is 500 significant lines; this is 1820 over it, 4.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: controller/player_controller.dart lib/screens/anime/watch/controller/player_controller.dart — FileTooLong — 2301 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: PlayerController (96-3155). The bar is 500 significant lines; this is 1801 over it, 4.60× 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: controller/download_controller.dart lib/screens/downloads/controller/download_controller.dart — FileTooLong — 2224 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DownloadController (37-2939). The bar is 500 significant lines; this is 1724 over it, 4.45× 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: compatibility/compatibility_result_page.dart lib/screens/profile/compatibility/compatibility_result_page.dart — FileTooLong — 2206 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: _CompatibilityResultPageState (53-2835). The bar is 500 significant lines; this is 1706 over it, 4.41× 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: setup/json_player_control_theme.dart lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart — FileTooLong — 2164 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1664 over it, 4.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: widgets/search_widgets.dart lib/screens/search/widgets/search_widgets.dart — FileTooLong — 1830 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: _FuturisticFilterSheetState (263-2415). The bar is 500 significant lines; this is 1330 over it, 3.66× 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: sub_settings/settings_moderation.dart lib/screens/settings/sub_settings/settings_moderation.dart — FileTooLong — 1711 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1211 over it, 3.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: widgets/episode_list_builder.dart lib/screens/anime/widgets/episode_list_builder.dart — FileTooLong — 1659 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: _EpisodeListBuilderState (87-1547). The bar is 500 significant lines; this is 1159 over it, 3.32× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: controller/reader_controller.dart lib/screens/manga/controller/reader_controller.dart — FileTooLong — 1605 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: ReaderController (95-2234). The bar is 500 significant lines; this is 1105 over it, 3.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/commentum_service.dart lib/services/commentum_service.dart — FileTooLong — 1573 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: CommentumService (47-2140). The bar is 500 significant lines; this is 1073 over it, 3.15× 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: Media/media.dart lib/models/Media/media.dart — FileTooLong — 1512 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: Media (19-1643). The bar is 500 significant lines; this is 1012 over it, 3.02× 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: backup_restore/backup_restore_service.dart lib/controllers/services/backup_restore/backup_restore_service.dart — FileTooLong — 1484 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: BackupRestoreService (362-1873). The bar is 500 significant lines; this is 984 over it, 2.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: anilist/anilist_data.dart lib/controllers/services/anilist/anilist_data.dart — FileTooLong — 1355 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: AnilistData (54-1786). The bar is 500 significant lines; this is 855 over it, 2.71× 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: downloads/download_screen.dart lib/screens/downloads/download_screen.dart — FileTooLong — 1352 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: _DownloadScreenState (159-1814). The bar is 500 significant lines; this is 852 over it, 2.70× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: registry/settings_registry.dart lib/screens/settings/registry/settings_registry.dart — FileTooLong — 1327 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: SettingsRegistry (27-1571). The bar is 500 significant lines; this is 827 over it, 2.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: search/search_view.dart lib/screens/search/search_view.dart — FileTooLong — 1289 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: _SearchPageState (79-1719). The bar is 500 significant lines; this is 789 over it, 2.58× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: widgets/chapter_list_builder.dart lib/screens/manga/widgets/chapter_list_builder.dart — FileTooLong — 1250 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: _ChapterListBuilderState (148-1639). The bar is 500 significant lines; this is 750 over it, 2.50× 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: controller/reader_controller.dart lib/screens/novel/reader/controller/reader_controller.dart — FileTooLong — 1177 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: NovelReaderController (23-1564). The bar is 500 significant lines; this is 677 over it, 2.35× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: widgets/character_staff_sheet.dart lib/screens/anime/widgets/character_staff_sheet.dart — FileTooLong — 1151 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 651 over it, 2.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: sub_settings/settings_reader.dart lib/screens/settings/sub_settings/settings_reader.dart — FileTooLong — 1133 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: _SettingsReaderState (32-1472). The bar is 500 significant lines; this is 633 over it, 2.27× 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/backup_and_restore_widgets.dart lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart — FileTooLong — 1120 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 620 over it, 2.24× 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: watchium/watchium_page.dart lib/screens/watchium/watchium_page.dart — FileTooLong — 1117 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: _WatchiumPageState (26-1514). The bar is 500 significant lines; this is 617 over it, 2.23× 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: notifications/notification_screen.dart lib/screens/notifications/notification_screen.dart — FileTooLong — 1099 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: NotificationScreen (24-952). The bar is 500 significant lines; this is 599 over it, 2.20× 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: utils/color_profiler.dart lib/utils/color_profiler.dart — FileTooLong — 1084 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: _ColorProfileBottomSheetState (289-1476). The bar is 500 significant lines; this is 584 over it, 2.17× 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.
  • + 85 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×102
  • ClassTooLong: _CommentSectionState lib/screens/anime/widgets/comments/comments_section.dart:55 — ClassTooLong — 2748 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 400 significant lines; this is 2348 over it, 6.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AnilistAuth lib/controllers/services/anilist/anilist_auth.dart:37 — ClassTooLong — 2288 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 400 significant lines; this is 1888 over it, 5.72× 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: PlayerController lib/screens/anime/watch/controller/player_controller.dart:96 — ClassTooLong — 2217 significant lines (blank, comment-only and punctuation-only lines excluded), 129 methods. The bar is 400 significant lines; this is 1817 over it, 5.54× 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: DownloadController lib/screens/downloads/controller/download_controller.dart:37 — ClassTooLong — 2177 significant lines (blank, comment-only and punctuation-only lines excluded), 84 methods. The bar is 400 significant lines; this is 1777 over it, 5.44× 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: _CompatibilityResultPageState lib/screens/profile/compatibility/compatibility_result_page.dart:53 — ClassTooLong — 2090 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 1690 over it, 5.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _FuturisticFilterSheetState lib/screens/search/widgets/search_widgets.dart:263 — ClassTooLong — 1621 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 1221 over it, 4.05× 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: CommentumService lib/services/commentum_service.dart:47 — ClassTooLong — 1536 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 1136 over it, 3.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ReaderController lib/screens/manga/controller/reader_controller.dart:95 — ClassTooLong — 1532 significant lines (blank, comment-only and punctuation-only lines excluded), 105 methods. The bar is 400 significant lines; this is 1132 over it, 3.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Media lib/models/Media/media.dart:19 — ClassTooLong — 1387 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 987 over it, 3.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AnilistData lib/controllers/services/anilist/anilist_data.dart:54 — ClassTooLong — 1307 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 907 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SettingsRegistry lib/screens/settings/registry/settings_registry.dart:27 — ClassTooLong — 1302 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 902 over it, 3.26× 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: _DownloadScreenState lib/screens/downloads/download_screen.dart:159 — ClassTooLong — 1227 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 827 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _SearchPageState lib/screens/search/search_view.dart:79 — ClassTooLong — 1193 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 793 over it, 2.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: BackupRestoreService lib/controllers/services/backup_restore/backup_restore_service.dart:362 — ClassTooLong — 1179 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 779 over it, 2.95× 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: NovelReaderController lib/screens/novel/reader/controller/reader_controller.dart:23 — ClassTooLong — 1158 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 400 significant lines; this is 758 over it, 2.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: ThemeRenderer lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:144 — ClassTooLong — 1133 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 733 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _ChapterListBuilderState lib/screens/manga/widgets/chapter_list_builder.dart:148 — ClassTooLong — 1130 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 730 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _EpisodeListBuilderState lib/screens/anime/widgets/episode_list_builder.dart:87 — ClassTooLong — 1109 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 709 over it, 2.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: _SettingsReaderState lib/screens/settings/sub_settings/settings_reader.dart:32 — ClassTooLong — 1107 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 707 over it, 2.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: _WatchiumPageState lib/screens/watchium/watchium_page.dart:26 — ClassTooLong — 1096 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 696 over it, 2.74× 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: _DownloadedMediaViewState lib/screens/downloads/widgets/downloaded_media_view.dart:35 — ClassTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 606 over it, 2.52× 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: _AnymeXAnimatedLogoState lib/widgets/anymex_widgets/anymex_animated_logo.dart:38 — ClassTooLong — 997 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 597 over it, 2.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: _MediaDetailsPageState lib/screens/anime/details/media_details_page.dart:73 — ClassTooLong — 968 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 568 over it, 2.42× 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: _UserProfilePageState lib/screens/profile/user_profile_page.dart:44 — ClassTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 542 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: _SettingsPlayerControlsState lib/screens/settings/sub_settings/player/settings_player_controls.dart:38 — ClassTooLong — 907 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 507 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 77 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×76
  • Hotspot: lib/screens/anime/watch/controller/player_controller.dart lib/screens/anime/watch/controller/player_controller.dart:1303 — lib/screens/anime/watch/controller/player_controller.dart changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in PlayerController._bindPlayerStreams at line 1303. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/watch/controller/player_controller.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/anime/details/media_details_page.dart lib/screens/anime/details/media_details_page.dart:266 — lib/screens/anime/details/media_details_page.dart changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in _MediaDetailsPageState.build at line 266. 10 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/details/media_details_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/screens/downloads/controller/download_controller.dart lib/screens/downloads/controller/download_controller.dart:2337 — lib/screens/downloads/controller/download_controller.dart changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in DownloadController._syncMediaFolderMeta at line 2337. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/downloads/controller/download_controller.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/anime/media_header.dart lib/widgets/anime/media_header.dart:46 — lib/widgets/anime/media_header.dart changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in MediaHeader.build at line 46. 4 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/widgets/anime/media_header.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/controllers/services/anilist/anilist_data.dart lib/controllers/services/anilist/anilist_data.dart:1409 — lib/controllers/services/anilist/anilist_data.dart changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in AnilistData.fetchFilterData at line 1409. 8 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/controllers/services/anilist/anilist_data.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/anime/details/controller/media_details_controller.dart lib/screens/anime/details/controller/media_details_controller.dart:561 — lib/screens/anime/details/controller/media_details_controller.dart changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in MediaDetailsController._fetchContentFromSource at line 561. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/details/controller/media_details_controller.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/main.dart lib/main.dart:576 — lib/main.dart changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in _FilterScreenState._getNavItemForTab at line 576. 6 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/main.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/screens/home_page.dart lib/screens/home_page.dart:40 — lib/screens/home_page.dart changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in _HomePageState._buildNewEpisodesSection at line 40. 4 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/home_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/screens/settings/sub_settings/settings_extension_manager.dart lib/screens/settings/sub_settings/settings_extension_manager.dart:449 — lib/screens/settings/sub_settings/settings_extension_manager.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in _SettingsExtensionManagerState._buildPluginStatusCard at line 449. 2 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/settings/sub_settings/settings_extension_manager.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/models/Media/media.dart lib/models/Media/media.dart:1128 — lib/models/Media/media.dart changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in Media.fromJson at line 1128. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/models/Media/media.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/media_items/media_item.dart lib/widgets/media_items/media_item.dart:115 — lib/widgets/media_items/media_item.dart changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in GridAnimeCard.build at line 115. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/widgets/media_items/media_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/controllers/offline/offline_storage_controller.dart lib/controllers/offline/offline_storage_controller.dart:624 — lib/controllers/offline/offline_storage_controller.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in OfflineStorageController.addOrUpdateAnime at line 624. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/controllers/offline/offline_storage_controller.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/profile/widgets/user_profile_header.dart lib/screens/profile/widgets/user_profile_header.dart:62 — lib/screens/profile/widgets/user_profile_header.dart changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in _UserProfileHeaderState.build at line 62. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/profile/widgets/user_profile_header.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/controllers/services/mal/mal_service.dart lib/controllers/services/mal/mal_service.dart:900 — lib/controllers/services/mal/mal_service.dart changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in MalService.updateListEntry at line 900. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/controllers/services/mal/mal_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/manga/widgets/chapter_list_builder.dart lib/screens/manga/widgets/chapter_list_builder.dart:1217 — lib/screens/manga/widgets/chapter_list_builder.dart changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in _ChapterListBuilderState._buildChapterDownloadButton at line 1217. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/manga/widgets/chapter_list_builder.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/anime/watch/controls/bottom_controls.dart lib/screens/anime/watch/controls/bottom_controls.dart:226 — lib/screens/anime/watch/controls/bottom_controls.dart changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in BottomControls._buildLayout at line 226. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/watch/controls/bottom_controls.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/manga/controller/reader_controller.dart lib/screens/manga/controller/reader_controller.dart:1544 — lib/screens/manga/controller/reader_controller.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ReaderController._initTracking at line 1544. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/manga/controller/reader_controller.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/anymex_widgets/anymex_tile.dart lib/widgets/anymex_widgets/anymex_tile.dart:620 — lib/widgets/anymex_widgets/anymex_tile.dart changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in AnymeXTile.build at line 620. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/widgets/anymex_widgets/anymex_tile.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/controllers/source/source_mapper.dart lib/controllers/source/source_mapper.dart:86 — lib/controllers/source/source_mapper.dart changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in SourceMapper.mapMedia at line 86. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/controllers/source/source_mapper.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/controllers/services/anilist/anilist_auth.dart lib/controllers/services/anilist/anilist_auth.dart:2267 — lib/controllers/services/anilist/anilist_auth.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in AnilistAuth.updateListEntry at line 2267. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/controllers/services/anilist/anilist_auth.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/downloads/widgets/downloaded_media_view.dart lib/screens/downloads/widgets/downloaded_media_view.dart:239 — lib/screens/downloads/widgets/downloaded_media_view.dart changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in _DownloadedMediaViewState._buildContinueFab at line 239. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/downloads/widgets/downloaded_media_view.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/common/anymex_scaffold.dart lib/widgets/common/anymex_scaffold.dart:148 — lib/widgets/common/anymex_scaffold.dart changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in AnymeXScaffold.build at line 148. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/widgets/common/anymex_scaffold.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/anime/widgets/comments/comments_section.dart lib/screens/anime/widgets/comments/comments_section.dart:1745 — lib/screens/anime/widgets/comments/comments_section.dart changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in _CommentSectionState._buildCommentItem at line 1745. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/widgets/comments/comments_section.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/controllers/services/simkl/simkl_service.dart lib/controllers/services/simkl/simkl_service.dart:749 — lib/controllers/services/simkl/simkl_service.dart changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in SimklService.updateListEntryFromExternalId at line 749. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/controllers/services/simkl/simkl_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/anime/widgets/episode_list_builder.dart lib/screens/anime/widgets/episode_list_builder.dart:466 — lib/screens/anime/widgets/episode_list_builder.dart changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in _EpisodeListBuilderState.build at line 466. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/widgets/episode_list_builder.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.
  • + 51 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×47
  • Duplicated block (11 lines × 2) lib/controllers/services/anilist/anilist_data.dart:90 — lib/controllers/services/anilist/anilist_data.dart:90-100 | lib/controllers/services/mal/mal_service.dart:65-75 — before extracting anything, compare `lib/controllers/services/anilist/anilist_data.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/controllers/services/backup_restore/backup_restore_service.dart:247 — lib/controllers/services/backup_restore/backup_restore_service.dart:247-257 | lib/controllers/services/backup_restore/backup_restore_service.dart:309-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) lib/controllers/services/mal/mal_service.dart:789 — lib/controllers/services/mal/mal_service.dart:789-799 | lib/controllers/services/mal/mal_service.dart:817-827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_service.dart:789` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) lib/screens/anime/details/controller/media_details_controller.dart:668 — lib/screens/anime/details/controller/media_details_controller.dart:668-678 | lib/screens/anime/details/controller/media_details_controller.dart:786-796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) lib/screens/anime/watch/controls/widgets/source_popup.dart:86 — lib/screens/anime/watch/controls/widgets/source_popup.dart:86-96 | lib/screens/anime/watch/controls/widgets/tracks_popup.dart:153-163 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/source_popup.dart` and `lib/screens/anime/watch/controls/widgets/tracks_popup.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/source_popup.dart:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/screens/anime/watch/controls/widgets/torrent_files_popup.dart:60 — lib/screens/anime/watch/controls/widgets/torrent_files_popup.dart:60-70 | lib/screens/downloads/widgets/torrent_file_selector_sheet.dart:99-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:652 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:652-662 | lib/widgets/watchium/watchium_create_dialog.dart:574-584 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:652` 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) lib/screens/anime/widgets/comments/comments_section.dart:347 — lib/screens/anime/widgets/comments/comments_section.dart:347-357 | lib/screens/settings/widgets/style_picker_section.dart:121-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:347` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/screens/anime/widgets/comments/discord_markdown.dart:475 — lib/screens/anime/widgets/comments/discord_markdown.dart:475-485 | lib/screens/anime/widgets/comments/discord_markdown.dart:487-497 — both copies are in the same file, so extract the block into 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/screens/anime/widgets/episode/styles/compact_style.dart:34 — lib/screens/anime/widgets/episode/styles/compact_style.dart:34-44 | lib/screens/anime/widgets/episode/styles/detailed_style.dart:34-44 — before extracting anything, compare `lib/screens/anime/widgets/episode/styles/compact_style.dart` and `lib/screens/anime/widgets/episode/styles/detailed_style.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/screens/anime/widgets/episode/styles/compact_style.dart:146 — lib/screens/anime/widgets/episode/styles/compact_style.dart:146-156 | lib/screens/anime/widgets/episode/styles/detailed_style.dart:162-172 — before extracting anything, compare `lib/screens/anime/widgets/episode/styles/compact_style.dart` and `lib/screens/anime/widgets/episode/styles/detailed_style.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode/styles/compact_style.dart:146` 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 (11 lines × 2) lib/screens/anime/widgets/voice_actor.dart:49 — lib/screens/anime/widgets/voice_actor.dart:49-59 | lib/screens/anime/widgets/voice_actor.dart:315-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/voice_actor.dart:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/screens/anime/widgets/wrongtitle_modal.dart:243 — lib/screens/anime/widgets/wrongtitle_modal.dart:243-253 | lib/screens/anime/widgets/wrongtitle_modal.dart:291-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/wrongtitle_modal.dart:243` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:389 — lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:389-399 | lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:405-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:389` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/screens/downloads/widgets/downloaded_media_view.dart:844 — lib/screens/downloads/widgets/downloaded_media_view.dart:844-854 | lib/screens/downloads/widgets/downloaded_media_view.dart:1141-1151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:844` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/screens/library/widgets/anime_card.dart:51 — lib/screens/library/widgets/anime_card.dart:51-61 | lib/screens/library/widgets/common_widgets.dart:54-64 — before extracting anything, compare `lib/screens/library/widgets/anime_card.dart` and `lib/screens/library/widgets/common_widgets.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/anime_card.dart:51` 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) lib/screens/library/widgets/library_deps.dart:202 — lib/screens/library/widgets/library_deps.dart:202-212 | lib/widgets/common/custom_tiles.dart:382-392 — before extracting anything, compare `lib/screens/library/widgets/library_deps.dart` and `lib/widgets/common/custom_tiles.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/library_deps.dart:202` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) lib/screens/local_source/local_source_view.dart:77 — lib/screens/local_source/local_source_view.dart:77-87 | lib/screens/settings/misc/sauce_finder_view.dart:102-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:77` 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 (11 lines × 2) lib/screens/manga/widgets/reader/bottom_controls.dart:85 — lib/screens/manga/widgets/reader/bottom_controls.dart:85-95 | lib/screens/manga/widgets/reader/bottom_controls.dart:125-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/bottom_controls.dart:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/screens/manga/widgets/reader/top_controls.dart:506 — lib/screens/manga/widgets/reader/top_controls.dart:506-516 | lib/screens/manga/widgets/reader/top_controls.dart:575-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/manga/widgets/reader/top_controls.dart:505` calls `symmetric` and `lib/screens/manga/widgets/reader/top_controls.dart:574` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) lib/screens/novel/reader/widgets/settings_view.dart:575 — lib/screens/novel/reader/widgets/settings_view.dart:575-585 | lib/screens/novel/reader/widgets/settings_view.dart:784-794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) lib/screens/profile/activity_details_page.dart:350 — lib/screens/profile/activity_details_page.dart:350-360 | lib/screens/profile/activity_details_page.dart:378-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/activity_details_page.dart:350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1608 — lib/screens/profile/compatibility/compatibility_result_page.dart:1608-1619 | lib/screens/profile/compatibility/compatibility_result_page.dart:2055-2065 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1608` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1752 — lib/screens/profile/compatibility/compatibility_result_page.dart:1752-1762 | lib/screens/profile/compatibility/compatibility_result_page.dart:1904-1914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1752` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) lib/screens/profile/widgets/user_media_list_page.dart:528 — lib/screens/profile/widgets/user_media_list_page.dart:528-538 | lib/screens/profile/widgets/user_media_list_page.dart:544-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_media_list_page.dart:528` 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.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×42
  • Duplicated block (13 lines × 2) lib/controllers/offline/offline_storage_controller.dart:934 — lib/controllers/offline/offline_storage_controller.dart:934-946 | lib/controllers/offline/offline_storage_controller.dart:998-1010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/offline/offline_storage_controller.dart:934` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:210 — lib/controllers/services/anilist/anilist_auth.dart:210-222 | lib/controllers/services/mal/mal_service.dart:683-695 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/controllers/services/simkl/simkl_api.dart:134 — lib/controllers/services/simkl/simkl_api.dart:134-146 | lib/controllers/services/simkl/simkl_api.dart:149-161 — both copies are in the same file, so extract the 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 (13 lines × 2) lib/controllers/sync/gist_sync_controller.dart:1012 — lib/controllers/sync/gist_sync_controller.dart:1012-1024 | lib/controllers/sync/progress_sync_section.dart:361-373 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) lib/models/Media/media.dart:1157 — lib/models/Media/media.dart:1157-1169 | lib/models/Media/media.dart:1372-1384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:1157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/anime/details/controller/media_details_controller.dart:625 — lib/screens/anime/details/controller/media_details_controller.dart:625-637 | lib/screens/anime/details/controller/media_details_controller.dart:750-762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/controller/media_details_controller.dart:625` 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 (13 lines × 2) lib/screens/anime/misc/list_exporter.dart:385 — lib/screens/anime/misc/list_exporter.dart:385-397 | lib/screens/anime/misc/list_exporter.dart:449-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/list_exporter.dart:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:95 — lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:95-107 | lib/screens/anime/watch/controls/themes/player_control_themes/netflix_mobile_player_theme.dart:174-186 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_mobile_player_theme.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:95` 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 (13 lines × 2) lib/screens/anime/widgets/anime_stats.dart:585 — lib/screens/anime/widgets/anime_stats.dart:585-597 | lib/screens/anime/widgets/anime_stats.dart:634-646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:585` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) lib/screens/anime/widgets/anime_stats.dart:850 — lib/screens/anime/widgets/anime_stats.dart:850-862 | lib/screens/manga/widgets/manga_stats.dart:513-525 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:850` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) lib/screens/anime/widgets/anime_stats.dart:870 — lib/screens/anime/widgets/anime_stats.dart:870-882 | lib/screens/manga/widgets/manga_stats.dart:534-546 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:870` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/anime/widgets/comments/discord_markdown.dart:921 — lib/screens/anime/widgets/comments/discord_markdown.dart:921-933 | lib/screens/anime/widgets/comments/discord_markdown.dart:935-947 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/discord_markdown.dart:921` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/anime/widgets/wrongtitle_modal.dart:261 — lib/screens/anime/widgets/wrongtitle_modal.dart:261-273 | lib/screens/library/online/manga_list.dart:833-845 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/wrongtitle_modal.dart:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/downloads/widgets/download_server_selector.dart:678 — lib/screens/downloads/widgets/download_server_selector.dart:678-690 | lib/screens/downloads/widgets/download_server_selector.dart:719-731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/download_server_selector.dart:678` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/downloads/widgets/manga_chapter_download_confirm.dart:131 — lib/screens/downloads/widgets/manga_chapter_download_confirm.dart:131-143 | lib/widgets/watchium/watchium_create_dialog.dart:369-381 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/manga_chapter_download_confirm.dart:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/extensions/ExtensionItem.dart:361 — lib/screens/extensions/ExtensionItem.dart:361-373 | lib/screens/extensions/ExtensionItem.dart:396-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/extensions/ExtensionItem.dart:361` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/library/history_page.dart:222 — lib/screens/library/history_page.dart:222-234 | lib/screens/stats/user_stats_page.dart:232-244 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/history_page.dart:222` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) lib/screens/library/widgets/anime_card.dart:80 — lib/screens/library/widgets/anime_card.dart:80-92 | lib/screens/library/widgets/common_widgets.dart:84-96 — before extracting anything, compare `lib/screens/library/widgets/anime_card.dart` and `lib/screens/library/widgets/common_widgets.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/anime_card.dart:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/manga/widgets/reader/settings_view.dart:94 — lib/screens/manga/widgets/reader/settings_view.dart:94-106 | lib/screens/manga/widgets/reader/settings_view.dart:164-176 — both copies are in the same file, so extract the block into 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) lib/screens/manga/widgets/reader/top_controls.dart:258 — lib/screens/manga/widgets/reader/top_controls.dart:258-270 | lib/screens/novel/reader/widgets/top_controls.dart:216-228 — before extracting anything, compare `lib/screens/manga/widgets/reader/top_controls.dart` and `lib/screens/novel/reader/widgets/top_controls.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/top_controls.dart:258` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/novel/reader/widgets/settings_view.dart:297 — lib/screens/novel/reader/widgets/settings_view.dart:297-309 | lib/screens/novel/reader/widgets/settings_view.dart:413-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/novel/reader/widgets/settings_view.dart:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:836 — lib/screens/profile/compatibility/compatibility_result_page.dart:836-848 | lib/screens/profile/compatibility/compatibility_result_page.dart:2370-2382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:836` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/screens/profile/profile_page.dart:932 — lib/screens/profile/profile_page.dart:932-944 | lib/screens/profile/user_profile_page.dart:894-906 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) lib/screens/profile/profile_page.dart:1141 — lib/screens/profile/profile_page.dart:1141-1153 | lib/screens/profile/user_profile_page.dart:1065-1077 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:1141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/profile/user_profile_page.dart:1064` calls `SizedBox` and `lib/screens/profile/profile_page.dart:1139` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) lib/screens/profile/widgets/profile_header.dart:894 — lib/screens/profile/widgets/profile_header.dart:894-906 | lib/screens/profile/widgets/user_profile_app_bar.dart:313-325 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:894` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • + 17 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×38
  • Duplicated block (10 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:2140 — lib/controllers/services/anilist/anilist_auth.dart:2140-2149 | lib/controllers/services/anilist/anilist_auth.dart:2527-2536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:2140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/controllers/services/anilist/anilist_data.dart:1538 — lib/controllers/services/anilist/anilist_data.dart:1538-1547 | lib/controllers/services/anilist/anilist_data.dart:1548-1557 — both copies are in the same file, so extract the block into 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/controllers/services/community_service.dart:459 — lib/controllers/services/community_service.dart:459-468 | lib/controllers/services/community_service.dart:543-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:459` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/controllers/services/community_service.dart:487 — lib/controllers/services/community_service.dart:487-496 | lib/controllers/services/community_service.dart:515-524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:487` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/controllers/services/community_service.dart:1074 — lib/controllers/services/community_service.dart:1074-1083 | lib/controllers/services/community_service.dart:1125-1134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:1074` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/controllers/services/mal/mal_service.dart:311 — lib/controllers/services/mal/mal_service.dart:311-320 | lib/controllers/services/simkl/simkl_service.dart:208-217 — `lib/controllers/services/mal/mal_service.dart` and `lib/controllers/services/simkl/simkl_service.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_service.dart:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/controllers/services/mal/mal_service.dart:750 — lib/controllers/services/mal/mal_service.dart:750-760 | lib/controllers/services/mal/mal_service.dart:784-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_service.dart:750` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/controllers/services/simkl/simkl_service.dart:1070 — lib/controllers/services/simkl/simkl_service.dart:1070-1079 | lib/controllers/services/simkl/simkl_service.dart:1092-1101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/simkl/simkl_service.dart:1070` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/anime/misc/calendar.dart:953 — lib/screens/anime/misc/calendar.dart:953-963 | lib/widgets/media_items/media_item.dart:254-263 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/widgets/media_items/media_item.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:953` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/widgets/media_items/media_item.dart:252` calls `BlurAnimeCard` and `lib/screens/anime/misc/calendar.dart:951` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:569 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:569-580 | lib/widgets/watchium/watchium_create_dialog.dart:495-504 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:583` calls `of` and `lib/widgets/watchium/watchium_create_dialog.dart:507` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) lib/screens/anime/widgets/anime_stats.dart:548 — lib/screens/anime/widgets/anime_stats.dart:548-557 | lib/screens/manga/widgets/manga_stats.dart:570-579 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:548` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:3029 — lib/screens/anime/widgets/comments/comments_section.dart:3029-3038 | lib/screens/anime/widgets/comments/comments_section.dart:3062-3071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:3029` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/anime/widgets/episode/styles/compact_style.dart:51 — lib/screens/anime/widgets/episode/styles/compact_style.dart:51-60 | lib/screens/anime/widgets/episode/styles/detailed_style.dart:51-60 — before extracting anything, compare `lib/screens/anime/widgets/episode/styles/compact_style.dart` and `lib/screens/anime/widgets/episode/styles/detailed_style.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 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/downloads/controller/download_controller.dart:2031 — lib/screens/downloads/controller/download_controller.dart:2031-2040 | lib/screens/downloads/controller/download_controller.dart:2042-2051 — both copies are in the same file, so extract the block into 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/downloads/controller/download_controller.dart:2130 — lib/screens/downloads/controller/download_controller.dart:2130-2139 | lib/screens/downloads/controller/download_controller.dart:2141-2150 — both copies are in the same file, so extract the block into 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/downloads/download_screen.dart:402 — lib/screens/downloads/download_screen.dart:402-411 | lib/screens/downloads/download_screen.dart:616-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:393 — lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:393-403 | lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:615-624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:393` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:425 — lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:425-434 | lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:643-652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:425` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:569 — lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:569-578 | lib/screens/profile/compatibility/compatibility_input_page.dart:741-750 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/extensions/ExtensionScreen.dart:435 — lib/screens/extensions/ExtensionScreen.dart:435-444 | lib/widgets/common/source_selector.dart:510-519 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/extensions/ExtensionScreen.dart:435` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:264 — lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:264-273 | lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:275-284 — both copies are in the same file, so extract the 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) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:655 — lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:655-664 | lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:697-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1349 — lib/screens/profile/compatibility/compatibility_result_page.dart:1349-1359 | lib/screens/profile/compatibility/compatibility_result_page.dart:2257-2266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1349` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/screens/profile/widgets/favorites_section.dart:175 — lib/screens/profile/widgets/favorites_section.dart:175-184 | lib/screens/profile/widgets/favorites_section.dart:290-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/favorites_section.dart:175` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `items` to `List<FavouriteMedia>` in one and `List<PersonItem>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) lib/screens/profile/widgets/profile_stats_tab.dart:84 — lib/screens/profile/widgets/profile_stats_tab.dart:84-93 | lib/widgets/common/source_selector.dart:908-917 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_stats_tab.dart:84` 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.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×35
  • Duplicated block (12 lines × 2) lib/controllers/services/anilist/anilist_api.dart:127 — lib/controllers/services/anilist/anilist_api.dart:127-138 | lib/controllers/services/anilist/anilist_api.dart:140-151 — both copies are in the same file, so extract the block into 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/controllers/services/anilist/anilist_auth.dart:2584 — lib/controllers/services/anilist/anilist_auth.dart:2584-2595 | lib/controllers/services/anilist/anilist_auth.dart:2641-2652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:2584` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/controllers/services/anilist/anilist_data.dart:102 — lib/controllers/services/anilist/anilist_data.dart:102-113 | lib/controllers/services/mal/mal_service.dart:77-88 — before extracting anything, compare `lib/controllers/services/anilist/anilist_data.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/controllers/services/mal/mal_api.dart:87 — lib/controllers/services/mal/mal_api.dart:87-98 | lib/controllers/services/mal/mal_service.dart:421-432 — before extracting anything, compare `lib/controllers/services/mal/mal_api.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_api.dart:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/controllers/services/mal/mal_service.dart:650 — lib/controllers/services/mal/mal_service.dart:650-661 | lib/controllers/services/mal/mal_service.dart:847-858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_service.dart:650` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:695 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:695-706 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:614-625 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:695` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:316 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:316-327 | lib/widgets/watchium/watchium_party_popup.dart:1231-1242 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1065 — lib/screens/anime/widgets/episode_list_builder.dart:1065-1076 | lib/screens/manga/widgets/chapter_list_builder.dart:609-620 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1065` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1419 — lib/screens/anime/widgets/episode_list_builder.dart:1419-1430 | lib/screens/manga/widgets/chapter_list_builder.dart:1534-1545 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/screens/anime/widgets/voice_actor.dart:144 — lib/screens/anime/widgets/voice_actor.dart:144-155 | lib/screens/anime/widgets/voice_actor.dart:296-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/voice_actor.dart:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/screens/anime/widgets/wrongtitle_modal.dart:214 — lib/screens/anime/widgets/wrongtitle_modal.dart:214-225 | lib/screens/anime/widgets/wrongtitle_modal.dart:275-286 — both copies are in the same file, so extract the block into 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/screens/library/widgets/unified_history_card.dart:28 — lib/screens/library/widgets/unified_history_card.dart:28-39 | lib/screens/library/widgets/unified_history_card.dart:324-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) lib/screens/novel/details/widgets/novel_stats.dart:30 — lib/screens/novel/details/widgets/novel_stats.dart:30-41 | lib/screens/novel/details/widgets/novel_stats.dart:65-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/novel/details/widgets/novel_stats.dart:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1472 — lib/screens/profile/compatibility/compatibility_result_page.dart:1472-1483 | lib/screens/profile/compatibility/compatibility_result_page.dart:1675-1686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1472` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/profile/compatibility/compatibility_result_page.dart:1471` calls `of`, `pop` and `lib/screens/profile/compatibility/compatibility_result_page.dart:1674` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1792 — lib/screens/profile/compatibility/compatibility_result_page.dart:1792-1803 | lib/screens/profile/compatibility/compatibility_result_page.dart:2110-2122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1792` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) lib/screens/profile/profile_page.dart:308 — lib/screens/profile/profile_page.dart:308-319 | lib/screens/profile/user_profile_page.dart:395-406 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:308` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) lib/screens/profile/profile_page.dart:693 — lib/screens/profile/profile_page.dart:693-704 | lib/screens/profile/user_profile_page.dart:638-649 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:693` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) lib/screens/profile/profile_page.dart:1042 — lib/screens/profile/profile_page.dart:1042-1053 | lib/screens/profile/profile_page.dart:1058-1069 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:1042` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/screens/profile/widgets/profile_header.dart:416 — lib/screens/profile/widgets/profile_header.dart:416-427 | lib/screens/profile/widgets/user_profile_header.dart:383-399 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 179 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:416` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/screens/profile/widgets/user_profile_header.dart:286 — lib/screens/profile/widgets/user_profile_header.dart:286-297 | lib/screens/profile/widgets/user_profile_header.dart:327-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_profile_header.dart:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/screens/settings/sub_settings/player/settings_player_engine.dart:282 — lib/screens/settings/sub_settings/player/settings_player_engine.dart:282-293 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:302-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_engine.dart:282` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:503 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:503-514 | lib/screens/settings/sub_settings/settings_reader.dart:1398-1409 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:503` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) lib/screens/settings/sub_settings/settings_addons.dart:227 — lib/screens/settings/sub_settings/settings_addons.dart:227-238 | lib/screens/settings/sub_settings/settings_addons.dart:418-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 (12 lines × 2) lib/screens/settings/sub_settings/settings_backup.dart:323 — lib/screens/settings/sub_settings/settings_backup.dart:323-334 | lib/screens/settings/sub_settings/settings_backup.dart:445-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_backup.dart:323` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) lib/screens/settings/sub_settings/settings_extension_manager.dart:67 — lib/screens/settings/sub_settings/settings_extension_manager.dart:67-78 | lib/screens/settings/sub_settings/settings_extension_manager.dart:102-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_extension_manager.dart:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 10 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×31
  • Swallowed exception (empty catch) lib/main.dart:135 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/main.dart:778 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/main.dart:785 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/watchium/watchium_live_overlays.dart:48 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:595 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:598 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:608 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:646 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:661 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:670 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/non_widgets/activity_composer_sheet.dart:86 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/non_widgets/activity_composer_sheet.dart:93 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/non_widgets/activity_composer_sheet.dart:109 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/non_widgets/activity_composer_sheet.dart:123 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/non_widgets/activity_composer_sheet.dart:130 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) lib/widgets/media_items/media_peek_popup.dart:322 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/header/header.dart:408 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/header/header.dart:414 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/dialogs/logo_animation_preview_dialog.dart:67 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/dialogs/logo_animation_preview_dialog.dart:79 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/common/anymex_scaffold.dart:144 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/common/baked_blur_image.dart:205 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/common/baked_blur_image.dart:233 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/common/baked_blur_image.dart:258 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/widgets/common/baked_blur_image.dart:316 — 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×30
  • Duplicated block (8 lines × 2) lib/controllers/services/backup_restore/backup_restore_service.dart:704 — lib/controllers/services/backup_restore/backup_restore_service.dart:704-711 | lib/controllers/services/backup_restore/backup_restore_service.dart:1827-1834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/backup_restore_service.dart:704` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/controllers/services/community_service.dart:944 — lib/controllers/services/community_service.dart:944-951 | lib/controllers/services/community_service.dart:1045-1052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:944` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/controllers/services/community_service.dart:1014 — lib/controllers/services/community_service.dart:1014-1021 | lib/controllers/services/community_service.dart:1100-1107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:1014` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/controllers/services/mal/mal_service.dart:523 — lib/controllers/services/mal/mal_service.dart:523-530 | lib/controllers/services/simkl/simkl_service.dart:402-409 — `lib/controllers/services/mal/mal_service.dart` and `lib/controllers/services/simkl/simkl_service.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_service.dart:523` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/models/Media/media.dart:501 — lib/models/Media/media.dart:501-508 | lib/models/Media/media.dart:1150-1157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:501` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/models/Media/media.dart:709 — lib/models/Media/media.dart:709-716 | lib/models/Media/media.dart:1020-1027 — both copies are in the same file, so extract the block into 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/anime/details/controller/media_details_controller.dart:703 — lib/screens/anime/details/controller/media_details_controller.dart:703-710 | lib/screens/anime/details/controller/media_details_controller.dart:802-809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/controller/media_details_controller.dart:703` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) lib/screens/anime/widgets/comments/discord_markdown.dart:1040 — lib/screens/anime/widgets/comments/discord_markdown.dart:1040-1047 | lib/screens/anime/widgets/comments/discord_markdown.dart:1065-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/discord_markdown.dart:1040` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/screens/anime/widgets/comments/discord_markdown.dart:1070 — lib/screens/anime/widgets/comments/discord_markdown.dart:1070-1077 | lib/widgets/non_widgets/activity_composer_sheet.dart:209-216 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/discord_markdown.dart:1070` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:413 — lib/screens/anime/widgets/episode_list_builder.dart:413-420 | lib/screens/downloads/controller/download_search_controller.dart:331-338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:413` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:540 — lib/screens/anime/widgets/episode_list_builder.dart:540-548 | lib/screens/anime/widgets/episode_list_builder.dart:714-721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:540` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/screens/anime/widgets/list_editor.dart:574 — lib/screens/anime/widgets/list_editor.dart:574-581 | lib/screens/anime/widgets/list_editor.dart:674-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 `lib/screens/anime/widgets/list_editor.dart:574` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/screens/local_source/controller/local_source_controller.dart:368 — lib/screens/local_source/controller/local_source_controller.dart:368-375 | lib/screens/local_source/controller/local_source_controller.dart:401-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/controller/local_source_controller.dart:368` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/screens/profile/compatibility/compatibility_input_page.dart:423 — lib/screens/profile/compatibility/compatibility_input_page.dart:423-430 | lib/screens/settings/sub_settings/settings_addons.dart:264-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_input_page.dart:423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/screens/settings/sub_settings/player/settings_player_controls.dart:156 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:156-163 | lib/screens/settings/sub_settings/player/settings_player_controls.dart:200-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 (8 lines × 2) lib/screens/settings/sub_settings/settings_ui_details.dart:620 — lib/screens/settings/sub_settings/settings_ui_details.dart:620-629 | lib/widgets/common/no_source.dart:21-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_ui_details.dart:620` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:562 — lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:562-569 | lib/screens/watchium/watchium_page.dart:796-803 — 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/utils/compatibility/matchmaker.dart:906 — lib/utils/compatibility/matchmaker.dart:906-913 | lib/utils/compatibility/matchmaker.dart:922-929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `bool) _voiceActorOverlapDetailed(AnimeStats` in one and `bool) _studioOverlapDetailed(AnimeStats` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) lib/utils/media_syncer.dart:28 — lib/utils/media_syncer.dart:28-35 | lib/utils/media_syncer.dart:45-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/media_syncer.dart:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/utils/media_syncer.dart:36` calls `i` and `lib/utils/media_syncer.dart:53` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) lib/widgets/animation/page_transition.dart:127 — lib/widgets/animation/page_transition.dart:127-134 | lib/widgets/animation/page_transition.dart:139-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/animation/page_transition.dart:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/widgets/anymex_widgets/anymex_titlebar.dart:263 — lib/widgets/anymex_widgets/anymex_titlebar.dart:263-270 | lib/widgets/common/navbar.dart:102-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_titlebar.dart:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/widgets/common/content_error_widget.dart:227 — lib/widgets/common/content_error_widget.dart:227-234 | lib/widgets/common/no_source.dart:17-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/content_error_widget.dart:227` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) lib/widgets/non_widgets/activity_composer_sheet.dart:521 — lib/widgets/non_widgets/activity_composer_sheet.dart:521-528 | lib/widgets/non_widgets/activity_composer_sheet.dart:544-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) lib/screens/anime/watch/controls/center_controls.dart:13 — lib/screens/anime/watch/controls/center_controls.dart:13-20 | lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:130-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 (8 lines × 2) lib/screens/manga/controller/reader_controller.dart:2047 — lib/screens/manga/controller/reader_controller.dart:2047-2055 | lib/screens/novel/reader/controller/reader_controller.dart:1422-1429 — before extracting anything, compare `lib/screens/manga/controller/reader_controller.dart` and `lib/screens/novel/reader/controller/reader_controller.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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.
  • + 5 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×29
  • TooManyMethods: Settings lib/controllers/settings/settings.dart:26 — TooManyMethods — 193 methods. The bar is 30 methods; this is 163 over it, 6.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PlayerController lib/screens/anime/watch/controller/player_controller.dart:96 — TooManyMethods — 129 methods. The bar is 30 methods; this is 99 over it, 4.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: ReaderController lib/screens/manga/controller/reader_controller.dart:95 — TooManyMethods — 105 methods. The bar is 30 methods; this is 75 over it, 3.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: NovelReaderController lib/screens/novel/reader/controller/reader_controller.dart:23 — TooManyMethods — 92 methods. The bar is 30 methods; this is 62 over it, 3.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: DownloadController lib/screens/downloads/controller/download_controller.dart:37 — TooManyMethods — 84 methods. The bar is 30 methods; this is 54 over it, 2.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CommentumService lib/services/commentum_service.dart:47 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AnilistAuth lib/controllers/services/anilist/anilist_auth.dart:37 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _CommentSectionState lib/screens/anime/widgets/comments/comments_section.dart:55 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OfflineStorageController lib/controllers/offline/offline_storage_controller.dart:24 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SourceController lib/controllers/source/source_controller.dart:31 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CommentSectionController lib/screens/anime/widgets/comments/controller/comments_controller.dart:16 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 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.
  • TooManyMethods: _FuturisticFilterSheetState lib/screens/search/widgets/search_widgets.dart:263 — 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: _SearchPageState lib/screens/search/search_view.dart:79 — 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: DiscordRPCController lib/controllers/discord/discord_rpc.dart:103 — 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: GistSyncController lib/controllers/sync/gist_sync_controller.dart:33 — 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: WatchiumService lib/controllers/watchium/watchium_service.dart:16 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MediaDetailsController lib/screens/anime/details/controller/media_details_controller.dart:32 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ThemeRenderer lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:144 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Matchmaker lib/utils/compatibility/matchmaker.dart:6 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AnilistData lib/controllers/services/anilist/anilist_data.dart:54 — 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: _CompatibilityResultPageState lib/screens/profile/compatibility/compatibility_result_page.dart:53 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MediaKitPlayer lib/screens/anime/watch/player/media_kit_player.dart:15 — 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: SimklService lib/controllers/services/simkl/simkl_service.dart:43 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _AnymeXAnimatedLogoState lib/widgets/anymex_widgets/anymex_animated_logo.dart:38 — 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: MalService lib/controllers/services/mal/mal_service.dart:50 — 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×29
  • Duplicated block (15 lines × 2) lib/controllers/services/widgets/widgets_builders.dart:304 — lib/controllers/services/widgets/widgets_builders.dart:304-318 | lib/screens/community/community_recommendations_page.dart:537-551 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/widgets/widgets_builders.dart:304` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) lib/screens/anime/studio_details_page.dart:118 — lib/screens/anime/studio_details_page.dart:118-132 | lib/screens/anime/widgets/character_staff_sheet.dart:140-154 — before extracting anything, compare `lib/screens/anime/studio_details_page.dart` and `lib/screens/anime/widgets/character_staff_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/studio_details_page.dart:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/netflix_shared.dart:199 — lib/screens/anime/watch/controls/themes/player_control_themes/netflix_shared.dart:199-213 | lib/screens/anime/watch/controls/themes/player_control_themes/netflix_shared.dart:435-449 — both copies are in the same file, so extract the 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 (15 lines × 2) lib/screens/anime/widgets/comments/discord_markdown.dart:1083 — lib/screens/anime/widgets/comments/discord_markdown.dart:1083-1097 | lib/widgets/non_widgets/activity_composer_sheet.dart:227-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/discord_markdown.dart:1083` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/widgets/non_widgets/activity_composer_sheet.dart:225` calls `requestFocus` and `lib/screens/anime/widgets/comments/discord_markdown.dart:1082` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) lib/screens/anime/widgets/episode/styles/minimal_style.dart:81 — lib/screens/anime/widgets/episode/styles/minimal_style.dart:81-95 | lib/screens/manga/widgets/chapter_list_builder.dart:888-902 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode/styles/minimal_style.dart:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/screens/anime/widgets/video_slider.dart:108 — lib/screens/anime/widgets/video_slider.dart:108-122 | lib/widgets/common/slider_semantics.dart:196-210 — before extracting anything, compare `lib/screens/anime/widgets/video_slider.dart` and `lib/widgets/common/slider_semantics.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/video_slider.dart:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/screens/downloads/controller/download_controller.dart:180 — lib/screens/downloads/controller/download_controller.dart:180-194 | lib/screens/downloads/controller/download_controller.dart:218-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:180` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) lib/screens/downloads/controller/download_controller.dart:1519 — lib/screens/downloads/controller/download_controller.dart:1519-1533 | lib/screens/downloads/controller/download_controller.dart:1565-1579 — both copies are in the same file, so extract the block into 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/screens/downloads/download_screen.dart:1189 — lib/screens/downloads/download_screen.dart:1189-1203 | lib/screens/downloads/download_screen.dart:1463-1477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:1189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:88 — lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:88-102 | lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:724-738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:87` calls `all`, `opaque` and `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:723` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) lib/screens/downloads/widgets/downloaded_media_view.dart:369 — lib/screens/downloads/widgets/downloaded_media_view.dart:369-383 | lib/screens/manga/widgets/chapter_list_builder.dart:1498-1512 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:369` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) lib/screens/library/online/anime_list.dart:276 — lib/screens/library/online/anime_list.dart:276-290 | lib/screens/library/online/manga_list.dart:255-269 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:276` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/screens/manga/widgets/chapter_list_builder.dart:692 — lib/screens/manga/widgets/chapter_list_builder.dart:692-706 | lib/screens/manga/widgets/chapter_list_builder.dart:748-762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/chapter_list_builder.dart:692` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:65 — lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:65-79 | lib/widgets/header/header.dart:686-700 — before extracting anything, compare `lib/screens/manga/widgets/reader/tabbed_reader_settings.dart` and `lib/widgets/header/header.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:2530 — lib/screens/profile/compatibility/compatibility_result_page.dart:2530-2544 | lib/screens/settings/sub_settings/settings_addons.dart:169-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:2530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/screens/profile/widgets/profile_header.dart:777 — lib/screens/profile/widgets/profile_header.dart:777-791 | lib/screens/profile/widgets/user_profile_app_bar.dart:206-220 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:777` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:50 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:50-64 | lib/screens/settings/sub_settings/settings_reader.dart:134-148 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 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/screens/settings/sub_settings/reader/settings_reader_manga.dart:129 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:129-143 | lib/screens/settings/sub_settings/settings_reader.dart:213-227 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 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/screens/settings/sub_settings/reader/settings_reader_novel.dart:89 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:89-103 | lib/screens/settings/sub_settings/settings_reader.dart:266-280 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 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/screens/settings/sub_settings/settings_backup.dart:384 — lib/screens/settings/sub_settings/settings_backup.dart:384-398 | lib/screens/settings/sub_settings/settings_backup.dart:793-807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_backup.dart:384` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/utils/compatibility/matchmaker.dart:162 — lib/utils/compatibility/matchmaker.dart:162-176 | lib/utils/compatibility/matchmaker.dart:348-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) lib/utils/download_isolate_pool.dart:93 — lib/utils/download_isolate_pool.dart:93-107 | lib/utils/download_isolate_pool.dart:155-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/download_isolate_pool.dart:93` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) lib/widgets/anymex_widgets/anymex_expansion_tile.dart:239 — lib/widgets/anymex_widgets/anymex_expansion_tile.dart:239-253 | lib/widgets/anymex_widgets/anymex_tile_builder.dart:96-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) lib/widgets/anymex_widgets/anymex_tile.dart:253 — lib/widgets/anymex_widgets/anymex_tile.dart:253-267 | lib/widgets/anymex_widgets/anymex_tile.dart:552-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_tile.dart:253` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/widgets/anymex_widgets/anymex_tile_builder.dart:159 — lib/widgets/anymex_widgets/anymex_tile_builder.dart:159-173 | lib/widgets/anymex_widgets/anymex_tile_builder.dart:235-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_tile_builder.dart:159` 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×28
  • Duplicated block (9 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:1992 — lib/controllers/services/anilist/anilist_auth.dart:1992-2000 | lib/controllers/services/anilist/anilist_auth.dart:2147-2155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1992` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/controllers/source/source_controller.dart:194 — lib/controllers/source/source_controller.dart:194-202 | lib/screens/extensions/ExtensionList.dart:171-179 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/source/source_controller.dart:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/controllers/stats/stats_tracker.dart:18 — lib/controllers/stats/stats_tracker.dart:18-26 | lib/controllers/stats/stats_tracker.dart:71-79 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/stats/stats_tracker.dart:18` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:28 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:28-36 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:30-38 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:179 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:179-187 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:185-193 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:179` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:361 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:361-369 | lib/widgets/watchium/watchium_create_dialog.dart:195-203 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:668 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:668-676 | lib/widgets/watchium/watchium_create_dialog.dart:587-595 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:668` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/screens/anime/widgets/anime_stats.dart:844 — lib/screens/anime/widgets/anime_stats.dart:844-852 | lib/screens/profile/widgets/profile_stats_tab.dart:751-759 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/profile/widgets/profile_stats_tab.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:3174 — lib/screens/anime/widgets/comments/comments_section.dart:3174-3182 | lib/screens/settings/sub_settings/settings_moderation.dart:1782-1790 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/settings/sub_settings/settings_moderation.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/comments/comments_section.dart:3172` calls `toString` and `lib/screens/settings/sub_settings/settings_moderation.dart:1781` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) lib/screens/anime/widgets/comments/mention_autocomplete.dart:135 — lib/screens/anime/widgets/comments/mention_autocomplete.dart:135-143 | lib/screens/anime/widgets/comments/mention_autocomplete.dart:145-153 — both copies are in the same file, so extract the block into 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/anime/widgets/comments/widgets/comment_input_bar.dart:346 — lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:346-354 | lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:400-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:346` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) lib/screens/anime/widgets/episode_range.dart:23 — lib/screens/anime/widgets/episode_range.dart:23-31 | lib/screens/manga/widgets/chapter_ranges.dart:18-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_range.dart:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/screens/community/community_recommendations_page.dart:402 — lib/screens/community/community_recommendations_page.dart:402-410 | lib/screens/community/community_recommendations_page.dart:843-851 — both copies are in the same file, so extract the block into 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/downloads/controller/download_controller.dart:608 — lib/screens/downloads/controller/download_controller.dart:608-616 | lib/screens/downloads/controller/download_controller.dart:686-694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:608` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/downloads/controller/download_controller.dart:685` calls `_saveActiveTasks` and `lib/screens/downloads/controller/download_controller.dart:607` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) lib/screens/downloads/download_screen.dart:470 — lib/screens/downloads/download_screen.dart:470-478 | lib/screens/downloads/download_screen.dart:830-838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:470` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/screens/manga/controller/reader_controller.dart:457 — lib/screens/manga/controller/reader_controller.dart:457-465 | lib/screens/manga/controller/reader_controller.dart:1526-1534 — both copies are in the same file, so extract the block into 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/manga/controller/reader_controller.dart:731 — lib/screens/manga/controller/reader_controller.dart:731-739 | lib/screens/manga/controller/reader_controller.dart:1573-1581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/controller/reader_controller.dart:731` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/screens/manga/controller/reader_controller.dart:1614 — lib/screens/manga/controller/reader_controller.dart:1614-1622 | lib/screens/novel/reader/controller/reader_controller.dart:713-721 — before extracting anything, compare `lib/screens/manga/controller/reader_controller.dart` and `lib/screens/novel/reader/controller/reader_controller.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/controller/reader_controller.dart:1614` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/screens/novel/details/widgets/chapters_section.dart:241 — lib/screens/novel/details/widgets/chapters_section.dart:241-249 | lib/screens/novel/details/widgets/chapters_section.dart:319-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/novel/details/widgets/chapters_section.dart:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/screens/settings/sub_settings/contributors/contributors.dart:754 — lib/screens/settings/sub_settings/contributors/contributors.dart:754-762 | lib/screens/settings/sub_settings/contributors/contributors.dart:775-783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/contributors/contributors.dart:754` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/screens/watchium/watchium_page.dart:855 — lib/screens/watchium/watchium_page.dart:855-863 | lib/utils/color_profiler.dart:1192-1200 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/watchium/watchium_page.dart:855` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/services/commentum_service.dart:772 — lib/services/commentum_service.dart:772-780 | lib/services/commentum_service.dart:1264-1272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:772` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/widgets/anymex_widgets/anymex_image.dart:196 — lib/widgets/anymex_widgets/anymex_image.dart:196-204 | lib/widgets/anymex_widgets/anymex_image.dart:215-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_image.dart:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/widgets/anymex_widgets/anymex_tile_builder.dart:197 — lib/widgets/anymex_widgets/anymex_tile_builder.dart:197-205 | lib/widgets/anymex_widgets/anymex_tile_builder.dart:271-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_tile_builder.dart:197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/widgets/header/header.dart:786 — lib/widgets/header/header.dart:786-794 | lib/widgets/header/header.dart:823-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/header/header.dart:786` 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×26
  • Duplicated block (16 lines × 2) lib/controllers/services/backup_restore/backup_restore_service.dart:732 — lib/controllers/services/backup_restore/backup_restore_service.dart:732-747 | lib/controllers/services/backup_restore/backup_restore_service.dart:1497-1512 — both copies are in the same file, so extract the block into 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/controllers/watchium/watchium_service.dart:79 — lib/controllers/watchium/watchium_service.dart:79-94 | lib/widgets/watchium/watchium_party_popup.dart:252-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/watchium/watchium_service.dart:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:164 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:164-179 | lib/widgets/common/anymex_slider_m3.dart:169-184 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart` and `lib/widgets/common/anymex_slider_m3.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:944 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:944-959 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:837-852 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:68 — lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:68-83 | lib/screens/anime/watch/controls/themes/player_control_themes/netflix_mobile_player_theme.dart:83-98 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_mobile_player_theme.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:608 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:608-623 | lib/widgets/watchium/watchium_create_dialog.dart:529-544 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:608` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/screens/anime/watch/watch_view.dart:189 — lib/screens/anime/watch/watch_view.dart:189-204 | lib/screens/local_source/player/offline_player.dart:114-129 — before extracting anything, compare `lib/screens/anime/watch/watch_view.dart` and `lib/screens/local_source/player/offline_player.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/watch_view.dart:189` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/anime/watch/watch_view.dart:205` calls `BufferingOverlay` and `lib/screens/local_source/player/offline_player.dart:130` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) lib/screens/anime/widgets/anime_stats.dart:54 — lib/screens/anime/widgets/anime_stats.dart:54-69 | lib/screens/manga/widgets/manga_stats.dart:69-84 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/screens/anime/widgets/anime_stats.dart:824 — lib/screens/anime/widgets/anime_stats.dart:824-839 | lib/screens/manga/widgets/manga_stats.dart:490-505 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:824` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) lib/screens/anime/widgets/character_staff_sheet.dart:493 — lib/screens/anime/widgets/character_staff_sheet.dart:493-508 | lib/screens/anime/widgets/character_staff_sheet.dart:513-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/character_staff_sheet.dart:493` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) lib/screens/downloads/download_screen.dart:310 — lib/screens/downloads/download_screen.dart:310-325 | lib/screens/downloads/download_screen.dart:357-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:310` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) lib/screens/library/widgets/unified_history_card.dart:230 — lib/screens/library/widgets/unified_history_card.dart:230-245 | lib/screens/library/widgets/unified_history_card.dart:368-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:230` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/screens/manga/widgets/reader/top_controls.dart:79 — lib/screens/manga/widgets/reader/top_controls.dart:79-94 | lib/screens/novel/reader/widgets/top_controls.dart:56-71 — before extracting anything, compare `lib/screens/manga/widgets/reader/top_controls.dart` and `lib/screens/novel/reader/widgets/top_controls.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) lib/screens/profile/profile_page.dart:598 — lib/screens/profile/profile_page.dart:598-613 | lib/widgets/non_widgets/activity_card.dart:461-476 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:598` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:486 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:486-501 | lib/screens/settings/sub_settings/settings_reader.dart:1381-1396 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:486` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/screens/settings/sub_settings/settings_moderation.dart:1965 — lib/screens/settings/sub_settings/settings_moderation.dart:1965-1980 | lib/screens/settings/sub_settings/settings_moderation.dart:2032-2047 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_moderation.dart:1965` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/screens/settings/sub_settings/settings_reader.dart:687 — lib/screens/settings/sub_settings/settings_reader.dart:687-702 | lib/screens/settings/sub_settings/settings_reader.dart:704-719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/settings/sub_settings/settings_reader.dart:685` calls `Row` and `lib/screens/settings/sub_settings/settings_reader.dart:703` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) lib/screens/settings/sub_settings/widgets/about_deps.dart:27 — lib/screens/settings/sub_settings/widgets/about_deps.dart:27-42 | lib/screens/settings/sub_settings/widgets/about_deps.dart:112-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/widgets/about_deps.dart:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/services/cast/cast_proxy_server.dart:234 — lib/services/cast/cast_proxy_server.dart:234-249 | lib/services/cast/cast_proxy_server.dart:319-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/cast/cast_proxy_server.dart: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 (16 lines × 2) lib/utils/updater.dart:90 — lib/utils/updater.dart:90-105 | lib/utils/updater.dart:123-138 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/utils/updater.dart:122` calls `_fetchLatestRelease` and `lib/utils/updater.dart:88` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) lib/widgets/animation/animations.dart:316 — lib/widgets/animation/animations.dart:316-331 | lib/widgets/animation/animations.dart:390-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/animation/animations.dart:316` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/widgets/anymex_widgets/anymex_tile.dart:491 — lib/widgets/anymex_widgets/anymex_tile.dart:491-506 | lib/widgets/anymex_widgets/anymex_tile.dart:532-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) lib/widgets/common/navbar.dart:172 — lib/widgets/common/navbar.dart:172-187 | lib/widgets/common/navbar.dart:209-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar.dart:172` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:82 — lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:82-97 | lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:109-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/widgets/common/baked_blur_image.dart:192 — lib/widgets/common/baked_blur_image.dart:192-207 | lib/widgets/common/baked_blur_image.dart:220-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/baked_blur_image.dart:192` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 1 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×26
  • Low cohesion: CommentumService (LCOM4 28) lib/services/commentum_service.dart:47 — CommentumService's methods fall into 28 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 28 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: OfflineStorageController (LCOM4 22) lib/controllers/offline/offline_storage_controller.dart:24 — OfflineStorageController'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: AnilistAuth (LCOM4 11) lib/controllers/services/anilist/anilist_auth.dart:37 — AnilistAuth's methods fall into 11 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 11 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: ServiceHandler (LCOM4 8) lib/controllers/service_handler/service_handler.dart:58 — ServiceHandler's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _CommentSectionState (LCOM4 8) lib/screens/anime/widgets/comments/comments_section.dart:55 — _CommentSectionState's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _SettingsPlayerEngineState (LCOM4 8) lib/screens/settings/sub_settings/player/settings_player_engine.dart:63 — _SettingsPlayerEngineState's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Settings (LCOM4 7) lib/controllers/settings/settings.dart:26 — Settings'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: SourceController (LCOM4 7) lib/controllers/source/source_controller.dart:31 — SourceController'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: AnilistData (LCOM4 6) lib/controllers/services/anilist/anilist_data.dart:54 — AnilistData'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: BackupRestoreService (LCOM4 6) lib/controllers/services/backup_restore/backup_restore_service.dart:362 — BackupRestoreService'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: _CommentInputBarState (LCOM4 6) lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:34 — _CommentInputBarState'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: CookieManager (LCOM4 5) lib/controllers/network/cookie_manager.dart:9 — CookieManager'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: NetworkManager (LCOM4 5) lib/controllers/network/network_manager.dart:35 — NetworkManager'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: TorrentService (LCOM4 5) lib/controllers/services/torrent/torrent_service.dart:10 — TorrentService'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: _MentionAutocompleteState (LCOM4 5) lib/screens/anime/widgets/comments/mention_autocomplete.dart:30 — _MentionAutocompleteState'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: _ListEditorModalState (LCOM4 5) lib/screens/anime/widgets/list_editor.dart:46 — _ListEditorModalState'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: _FuturisticFilterSheetState (LCOM4 5) lib/screens/search/widgets/search_widgets.dart:263 — _FuturisticFilterSheetState'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: _AnymeXPopupMenuRoute (LCOM4 5) lib/widgets/anymex_widgets/anymex_popup_menu.dart:158 — _AnymeXPopupMenuRoute'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: _MediaPeekPopupState (LCOM4 5) lib/widgets/media_items/media_peek_popup.dart:130 — _MediaPeekPopupState'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: TrackBindingController (LCOM4 4) lib/controllers/track/track_binding_controller.dart:15 — TrackBindingController'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: _ExtensionListState (LCOM4 4) lib/screens/extensions/ExtensionList.dart:38 — _ExtensionListState'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: LocalSourceController (LCOM4 4) lib/screens/local_source/controller/local_source_controller.dart:26 — LocalSourceController'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: _SettingsNetworkState (LCOM4 4) lib/screens/settings/sub_settings/settings_network.dart:27 — _SettingsNetworkState'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: NotificationService (LCOM4 4) lib/utils/notification.dart:127 — NotificationService'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: ActivityComposerSheetState (LCOM4 4) lib/widgets/non_widgets/activity_composer_sheet.dart:53 — ActivityComposerSheetState'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.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×22
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/offline/offline_storage_controller.dart:547 — lib/controllers/offline/offline_storage_controller.dart:547-617 | lib/controllers/offline/offline_storage_controller.dart:624-688 | lib/controllers/offline/offline_storage_controller.dart:690-752 | lib/controllers/offline/offline_storage_controller.dart:754-816 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/services/anilist/anilist_auth.dart:888 — lib/controllers/services/anilist/anilist_auth.dart:888-1047 | lib/controllers/services/anilist/anilist_auth.dart:1052-1083 | lib/controllers/services/anilist/anilist_auth.dart:1122-1222 | lib/controllers/services/anilist/anilist_auth.dart:1228-1264 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/services/community_service.dart:1023 — lib/controllers/services/community_service.dart:1023-1052 | lib/controllers/services/community_service.dart:1054-1083 | lib/controllers/services/community_service.dart:1085-1107 | lib/controllers/services/community_service.dart:1109-1134 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/services/widgets/widgets_builders.dart:281 — lib/controllers/services/widgets/widgets_builders.dart:281-359 | lib/screens/anime/watch/controls/widgets/shader_osd.dart:10-66 | lib/screens/community/community_recommendations_page.dart:523-579 | lib/screens/community/community_recommendations_page.dart:770-810 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/controllers/services/widgets/widgets_builders.dart:420 — lib/controllers/services/widgets/widgets_builders.dart:420-453 | lib/screens/community/community_recommendations_page.dart:730-763 | lib/screens/community/user_recommendations_page.dart:360-393 | lib/widgets/media_items/media_peek_popup.dart:1135-1168 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/models/Media/media.dart:192 — lib/models/Media/media.dart:192-329 | lib/models/Media/media.dart:331-395 | lib/models/Media/media.dart:397-557 | lib/models/Media/media.dart:1128-1338 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/models/notification/notification_item.dart:80 — lib/models/notification/notification_item.dart:80-129 | lib/screens/anime/misc/list_exporter.dart:213-238 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1547-1592 | lib/screens/search/widgets/search_widgets.dart:33-58 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/anime/widgets/list_editor.dart:616 — lib/screens/anime/widgets/list_editor.dart:616-656 | lib/screens/anime/widgets/list_editor.dart:735-775 | lib/widgets/common/source_selector.dart:553-737 | lib/widgets/header/header.dart:548-606 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/downloads/controller/download_controller.dart:2605 — lib/screens/downloads/controller/download_controller.dart:2605-2651 | lib/screens/downloads/controller/download_controller.dart:2653-2697 | lib/screens/downloads/controller/download_controller.dart:2756-2799 | lib/screens/downloads/controller/download_controller.dart:2801-2842 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/downloads/download_screen.dart:870 — lib/screens/downloads/download_screen.dart:870-1217 | lib/screens/downloads/download_screen.dart:1219-1491 | lib/screens/downloads/download_screen.dart:1493-1660 | lib/screens/downloads/widgets/download_server_selector.dart:277-557 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/downloads/widgets/downloaded_media_view.dart:497 — lib/screens/downloads/widgets/downloaded_media_view.dart:497-660 | lib/screens/downloads/widgets/downloaded_media_view.dart:824-1109 | lib/screens/downloads/widgets/downloaded_media_view.dart:1111-1283 | lib/screens/extensions/ExtensionItem.dart:106-324 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/extensions/ExtensionScreen.dart:414 — lib/screens/extensions/ExtensionScreen.dart:414-444 | lib/screens/extensions/ExtensionScreen.dart:446-465 | lib/screens/extensions/ExtensionScreen.dart:540-552 | lib/widgets/common/source_selector.dart:493-519 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/library/editor/list_editor.dart:532 — lib/screens/library/editor/list_editor.dart:532-571 | lib/screens/local_source/local_source_view.dart:818-869 | lib/screens/local_source/local_source_view.dart:871-922 | lib/screens/local_source/local_source_view.dart:924-959 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/library/widgets/library_deps.dart:135 — lib/screens/library/widgets/library_deps.dart:135-231 | lib/widgets/common/custom_tiles.dart:144-200 | lib/widgets/common/custom_tiles.dart:227-285 | lib/widgets/common/custom_tiles.dart:314-418 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:110 — lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:110-188 | lib/widgets/anime/visuals/visuals_popup.dart:162-280 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:27-146 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:148-190 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/manga/widgets/reader/top_controls.dart:79 — lib/screens/manga/widgets/reader/top_controls.dart:79-94 | lib/screens/manga/widgets/reader/top_controls.dart:178-194 | lib/screens/novel/reader/widgets/top_controls.dart:56-71 | lib/screens/novel/reader/widgets/top_controls.dart:162-177 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/novel/reader/widgets/bottom_controls.dart:72 — lib/screens/novel/reader/widgets/bottom_controls.dart:72-94 | lib/screens/novel/reader/widgets/bottom_controls.dart:151-230 | lib/screens/novel/reader/widgets/bottom_controls.dart:232-296 | lib/screens/novel/reader/widgets/bottom_controls.dart:298-321 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/search/widgets/search_widgets.dart:1426 — lib/screens/search/widgets/search_widgets.dart:1426-1454 | lib/screens/search/widgets/search_widgets.dart:1509-1597 | lib/screens/search/widgets/search_widgets.dart:1599-1671 | lib/screens/search/widgets/search_widgets.dart:1673-1746 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/settings/sub_settings/player/settings_player_controls.dart:1055 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:1055-1252 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:545-870 | lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:340-570 | lib/screens/settings/sub_settings/settings_player.dart:116-230 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/screens/settings/sub_settings/settings_comments.dart:74 — lib/screens/settings/sub_settings/settings_comments.dart:74-316 | lib/screens/settings/sub_settings/settings_donation.dart:372-471 | lib/screens/settings/sub_settings/settings_moderation.dart:56-157 | lib/screens/settings/sub_settings/settings_network.dart:49-124 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/utils/color_profiler.dart:353 — lib/utils/color_profiler.dart:353-379 | lib/utils/color_profiler.dart:381-401 | lib/utils/color_profiler.dart:403-421 | lib/utils/color_profiler.dart:429-449 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/widgets/anymex_widgets/anymex_animated_logo.dart:667 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:667-731 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:903-1020 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:1119-1211 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:1316-1391 — 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 (7 lines × 2) · ×22
  • Duplicated block (7 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:2003 — lib/controllers/services/anilist/anilist_auth.dart:2003-2009 | lib/controllers/services/anilist/anilist_auth.dart:2404-2410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:2003` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/controllers/services/mal/mal_service.dart:771 — lib/controllers/services/mal/mal_service.dart:771-777 | lib/controllers/services/mal/mal_service.dart:795-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_service.dart:771` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/controllers/services/storage/storage_manager_service.dart:55 — lib/controllers/services/storage/storage_manager_service.dart:55-61 | lib/controllers/services/storage/storage_manager_service.dart:103-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/storage/storage_manager_service.dart:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/models/Media/media.dart:306 — lib/models/Media/media.dart:306-312 | lib/models/Media/media.dart:535-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.
  • Duplicated block (7 lines × 2) lib/models/Media/media.dart:865 — lib/models/Media/media.dart:865-871 | lib/models/Media/media.dart:1032-1038 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:865` 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 `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 (7 lines × 2) lib/screens/anime/watch/controls/widgets/speed_popup.dart:408 — lib/screens/anime/watch/controls/widgets/speed_popup.dart:408-414 | lib/utils/al_about_me_helpers.dart:246-252 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/speed_popup.dart:408` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/screens/downloads/controller/download_controller.dart:499 — lib/screens/downloads/controller/download_controller.dart:499-505 | lib/screens/downloads/controller/download_controller.dart:545-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/screens/local_source/controller/local_source_controller.dart:359 — lib/screens/local_source/controller/local_source_controller.dart:359-365 | lib/screens/local_source/controller/local_source_controller.dart:392-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/controller/local_source_controller.dart:359` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) lib/screens/manga/widgets/reader/continuous_reader.dart:339 — lib/screens/manga/widgets/reader/continuous_reader.dart:339-345 | lib/screens/manga/widgets/reader/reader_view.dart:300-306 — before extracting anything, compare `lib/screens/manga/widgets/reader/continuous_reader.dart` and `lib/screens/manga/widgets/reader/reader_view.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) lib/screens/search/widgets/search_widgets.dart:1217 — lib/screens/search/widgets/search_widgets.dart:1217-1223 | lib/screens/search/widgets/search_widgets.dart:1289-1295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/search_widgets.dart:1217` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/widgets/anime/visuals/visuals_popup.dart:72 — lib/widgets/anime/visuals/visuals_popup.dart:72-78 | lib/widgets/anime/visuals/visuals_popup.dart:138-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anime/visuals/visuals_popup.dart:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/widgets/common/navbar/styles/classic_navbar.dart:62 — lib/widgets/common/navbar/styles/classic_navbar.dart:62-68 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:58-64 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) lib/widgets/watchium/watchium_live_overlays.dart:130 — lib/widgets/watchium/watchium_live_overlays.dart:130-136 | lib/widgets/watchium/watchium_live_overlays.dart:305-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/watchium/watchium_live_overlays.dart:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:681 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:681-687 | lib/widgets/watchium/watchium_create_dialog.dart:600-606 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) lib/screens/library/history_page.dart:71 — lib/screens/library/history_page.dart:71-77 | lib/screens/library/my_library.dart:72-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/library/online/anime_list.dart:81 — lib/screens/library/online/anime_list.dart:81-87 | lib/screens/library/online/manga_list.dart:79-85 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) lib/screens/manga/controller/reader_controller.dart:499 — lib/screens/manga/controller/reader_controller.dart:499-505 | lib/screens/novel/reader/controller/reader_controller.dart:237-243 — before extracting anything, compare `lib/screens/manga/controller/reader_controller.dart` and `lib/screens/novel/reader/controller/reader_controller.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:81 — lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:81-87 | lib/widgets/header/header.dart:702-708 — before extracting anything, compare `lib/screens/manga/widgets/reader/tabbed_reader_settings.dart` and `lib/widgets/header/header.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:89 — lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:89-95 | lib/widgets/header/header.dart:710-716 — before extracting anything, compare `lib/screens/manga/widgets/reader/tabbed_reader_settings.dart` and `lib/widgets/header/header.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) lib/screens/profile/profile_page.dart:1226 — lib/screens/profile/profile_page.dart:1226-1232 | lib/screens/profile/user_profile_page.dart:1164-1170 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) lib/widgets/non_widgets/in_app_notification_banner.dart:157 — lib/widgets/non_widgets/in_app_notification_banner.dart:157-163 | lib/widgets/non_widgets/snackbar.dart:198-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) lib/utils/compatibility/matchmaker.dart:679 — lib/utils/compatibility/matchmaker.dart:679-685 | lib/utils/compatibility/matchmaker.dart:945-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/compatibility/matchmaker.dart:679` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×21
  • Duplicated block (17 lines × 2) lib/models/reader/tap_zones.dart:115 — lib/models/reader/tap_zones.dart:115-131 | lib/models/reader/tap_zones.dart:134-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/reader/tap_zones.dart:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/models/reader/tap_zones.dart:153 — lib/models/reader/tap_zones.dart:153-169 | lib/models/reader/tap_zones.dart:172-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/reader/tap_zones.dart:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/screens/anime/widgets/episode/styles/compact_style.dart:62 — lib/screens/anime/widgets/episode/styles/compact_style.dart:62-78 | lib/screens/anime/widgets/episode/styles/detailed_style.dart:62-78 — before extracting anything, compare `lib/screens/anime/widgets/episode/styles/compact_style.dart` and `lib/screens/anime/widgets/episode/styles/detailed_style.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode/styles/compact_style.dart:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) lib/screens/community/community_recommendations_page.dart:94 — lib/screens/community/community_recommendations_page.dart:94-110 | lib/widgets/media_items/media_peek_popup.dart:170-186 — before extracting anything, compare `lib/screens/community/community_recommendations_page.dart` and `lib/widgets/media_items/media_peek_popup.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/community/community_recommendations_page.dart:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/screens/downloads/download_screen.dart:1066 — lib/screens/downloads/download_screen.dart:1066-1082 | lib/screens/downloads/download_screen.dart:1344-1360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:1066` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/screens/downloads/widgets/downloaded_media_view.dart:597 — lib/screens/downloads/widgets/downloaded_media_view.dart:597-613 | lib/screens/downloads/widgets/downloaded_media_view.dart:1195-1211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:597` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/screens/library/online/anime_list.dart:204 — lib/screens/library/online/anime_list.dart:204-220 | lib/screens/library/online/manga_list.dart:182-198 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) lib/screens/library/online/anime_list.dart:542 — lib/screens/library/online/anime_list.dart:542-558 | lib/screens/library/online/manga_list.dart:526-542 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:542` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) lib/screens/local_source/local_source_view.dart:98 — lib/screens/local_source/local_source_view.dart:98-114 | lib/screens/settings/misc/sauce_finder_view.dart:129-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:98` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/screens/local_source/local_source_view.dart:853 — lib/screens/local_source/local_source_view.dart:853-869 | lib/screens/local_source/local_source_view.dart:906-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:853` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/screens/manga/widgets/manga_stats.dart:288 — lib/screens/manga/widgets/manga_stats.dart:288-304 | lib/screens/manga/widgets/manga_stats.dart:337-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/manga_stats.dart:288` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) lib/screens/settings/misc/sauce_finder_view.dart:329 — lib/screens/settings/misc/sauce_finder_view.dart:329-345 | lib/screens/settings/misc/sauce_finder_view.dart:680-696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/misc/sauce_finder_view.dart:329` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/screens/settings/sub_settings/player/settings_player_controls.dart:316 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:316-332 | lib/screens/settings/sub_settings/player/settings_player_controls.dart:482-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_controls.dart:316` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/screens/settings/sub_settings/player/settings_player_engine.dart:754 — lib/screens/settings/sub_settings/player/settings_player_engine.dart:754-770 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:773-789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_engine.dart:754` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/screens/settings/sub_settings/settings_network.dart:519 — lib/screens/settings/sub_settings/settings_network.dart:519-535 | lib/screens/settings/sub_settings/settings_network.dart:841-857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:519` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `label` to `'Reset'` in one and `'Clear Proxy'` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) lib/utils/color_profiler.dart:814 — lib/utils/color_profiler.dart:814-830 | lib/utils/color_profiler.dart:1326-1342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/color_profiler.dart:814` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/widgets/common/cards/styles/exotic_card.dart:66 — lib/widgets/common/cards/styles/exotic_card.dart:66-82 | lib/widgets/common/cards/styles/minimal_exotic_card.dart:64-80 — before extracting anything, compare `lib/widgets/common/cards/styles/exotic_card.dart` and `lib/widgets/common/cards/styles/minimal_exotic_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/cards/styles/exotic_card.dart:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) lib/widgets/common/carousel/themes/big_carousel_classic.dart:76 — lib/widgets/common/carousel/themes/big_carousel_classic.dart:76-92 | lib/widgets/common/carousel/themes/big_carousel_portrait.dart:110-126 — before extracting anything, compare `lib/widgets/common/carousel/themes/big_carousel_classic.dart` and `lib/widgets/common/carousel/themes/big_carousel_portrait.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/carousel/themes/big_carousel_classic.dart:76` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/widgets/dialogs/logo_animation_preview_dialog.dart:208 — lib/widgets/dialogs/logo_animation_preview_dialog.dart:208-224 | lib/widgets/dialogs/logo_animation_preview_dialog.dart:465-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/dialogs/logo_animation_preview_dialog.dart:208` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:92 — lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:92-108 | lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:160-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/models/Anilist/anilist_media_user.dart:292 — lib/models/Anilist/anilist_media_user.dart:292-308 | lib/models/Anilist/anilist_media_user.dart:333-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Anilist/anilist_media_user.dart:292` 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×21
  • Sync-over-async blocking lib/controllers/services/anilist/anilist_cache.dart:133 — `_deleteMatchingDiskFiles` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/controllers/services/backup_restore/backup_restore_service.dart:1255 — `pickBackupFile` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/controllers/services/storage/storage_manager_service.dart:50 — `getTorrentCacheSize` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/controllers/services/storage/storage_manager_service.dart:99 — `clearTorrentCacheOnly` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/controllers/services/storage/storage_manager_service.dart:125 — `clearOtherTempOnly` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/controllers/services/storage/storage_manager_service.dart:213 — `_clearDirectoryContents` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/screens/anime/watch/controller/player_controller.dart:1539 — `_loadLocalSubtitles` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/screens/manga/controller/reader_controller.dart:279 — `_fetchChapterPages` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/screens/manga/controller/reader_controller.dart:1927 — `fetchImages` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/screens/settings/sub_settings/settings_network.dart:945 — `_testProxy` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking packages/rhttp/cargokit/build_tool/lib/src/artifacts_provider.dart:99 — `_getPrecompiledArtifacts` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking packages/rhttp/cargokit/build_tool/lib/src/artifacts_provider.dart:184 — `_tryDownloadArtifacts` is async and calls writeAsBytesSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking packages/rhttp/cargokit/build_tool/lib/src/build_cmake.dart:19 — `build` is async and calls copySync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking packages/rhttp/cargokit/build_tool/lib/src/build_gradle.dart:22 — `build` is async and calls createSync, copySync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking packages/rhttp/cargokit/build_tool/lib/src/build_pod.dart:20 — `build` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking packages/rhttp/cargokit/build_tool/lib/src/precompile_binaries.dart:52 — `run` is async and calls createSync, readAsBytesSync, deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/utils/external_font_loader.dart:255 — `getCustomFontNames` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/utils/external_font_loader.dart:291 — `loadAllCustomFonts` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/utils/external_font_loader.dart:325 — `deleteCustomFont` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/utils/media_downloader.dart:105 — `download` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/utils/media_downloader.dart:183 — `_downloadM3u8WithProgress` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×20
  • Duplicated block (6 lines × 2) lib/controllers/offline/offline_storage_controller.dart:350 — lib/controllers/offline/offline_storage_controller.dart:350-355 | lib/controllers/offline/offline_storage_controller.dart:389-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) lib/controllers/offline/offline_storage_controller.dart:634 — lib/controllers/offline/offline_storage_controller.dart:634-639 | lib/controllers/offline/offline_storage_controller.dart:835-840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/offline/offline_storage_controller.dart:634` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/controllers/services/anilist/anilist_data.dart:247 — lib/controllers/services/anilist/anilist_data.dart:247-252 | lib/controllers/services/anilist/anilist_data.dart:261-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_data.dart:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:87 — lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:87-92 | lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:113-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) lib/controllers/sync/progress_sync_section.dart:811 — lib/controllers/sync/progress_sync_section.dart:811-816 | lib/screens/anime/watch/controls/widgets/speed_popup.dart:408-413 — 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/anime/details/media_details_page.dart:1157 — lib/screens/anime/details/media_details_page.dart:1157-1162 | lib/screens/anime/details/media_details_page.dart:1185-1190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:211 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:211-217 | lib/widgets/watchium/watchium_overlay.dart:117-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/screens/downloads/controller/download_controller.dart:2454 — lib/screens/downloads/controller/download_controller.dart:2454-2459 | lib/screens/downloads/controller/download_controller.dart:2563-2568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:2454` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) lib/screens/home_page.dart:211 — lib/screens/home_page.dart:211-216 | lib/screens/manga/home_page.dart:51-56 — before extracting anything, compare `lib/screens/home_page.dart` and `lib/screens/manga/home_page.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:627 — lib/screens/profile/compatibility/compatibility_result_page.dart:627-632 | lib/screens/profile/compatibility/compatibility_result_page.dart:636-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) lib/screens/profile/widgets/profile_stats_tab.dart:287 — lib/screens/profile/widgets/profile_stats_tab.dart:287-292 | lib/screens/profile/widgets/profile_stats_tab.dart:306-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_stats_tab.dart:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/screens/watchium/watchium_page.dart:853 — lib/screens/watchium/watchium_page.dart:853-859 | lib/services/cast/widgets/cast_device_dialog.dart:96-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/watchium/watchium_page.dart:853` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) lib/widgets/common/navbar/styles/classic_navbar.dart:312 — lib/widgets/common/navbar/styles/classic_navbar.dart:312-319 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:365-370 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:312` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/widgets/common/navbar/styles/classic_navbar.dart:311` calls `SingleChildScrollView` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart:364` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) lib/controllers/services/backup_restore/backup_restore_service.dart:1741 — lib/controllers/services/backup_restore/backup_restore_service.dart:1741-1746 | lib/controllers/services/backup_restore/backup_restore_service.dart:1811-1816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) lib/controllers/services/widgets/widgets_builders.dart:366 — lib/controllers/services/widgets/widgets_builders.dart:366-371 | lib/screens/community/community_recommendations_page.dart:855-860 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:43 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:43-48 | lib/screens/settings/sub_settings/settings_reader.dart:108-113 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:61 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:61-66 | lib/screens/settings/sub_settings/settings_reader.dart:229-234 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:923 — lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:923-928 | lib/screens/anime/watch/controls/widgets/decoder_quick_button.dart:42-47 — 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/anime/watch/controls/themes/setup/media_indicator_theme_registry.dart:15 — lib/screens/anime/watch/controls/themes/setup/media_indicator_theme_registry.dart:15-20 | lib/screens/manga/widgets/reader/themes/setup/reader_control_theme_registry.dart:13-18 — 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/utils/lanczos_image.dart:91 — lib/utils/lanczos_image.dart:91-96 | lib/utils/lanczos_image.dart:208-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×17
  • Duplicated block (21 lines × 2) lib/controllers/services/anilist/anilist_data.dart:370 — lib/controllers/services/anilist/anilist_data.dart:370-390 | lib/controllers/services/anilist/anilist_data.dart:447-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_data.dart:370` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/controllers/services/anilist/anilist_data.dart:1295 — lib/controllers/services/anilist/anilist_data.dart:1295-1315 | lib/controllers/services/anilist/anilist_data.dart:1346-1366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_data.dart:1295` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) lib/screens/anime/watch/controls/bottom_controls.dart:25 — lib/screens/anime/watch/controls/bottom_controls.dart:25-45 | lib/screens/anime/watch/controls/bottom_controls.dart:103-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/bottom_controls.dart:25` 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 (21 lines × 2) lib/screens/anime/widgets/anime_stats.dart:356 — lib/screens/anime/widgets/anime_stats.dart:356-376 | lib/screens/manga/widgets/manga_stats.dart:407-427 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:356` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:2487 — lib/screens/anime/widgets/comments/comments_section.dart:2487-2507 | lib/screens/anime/widgets/comments/comments_section.dart:2572-2592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2487` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1286 — lib/screens/anime/widgets/episode_list_builder.dart:1286-1306 | lib/screens/anime/widgets/episode_list_builder.dart:1324-1344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1286` 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 (21 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1344 — lib/screens/anime/widgets/episode_list_builder.dart:1344-1364 | lib/screens/manga/widgets/chapter_list_builder.dart:1454-1474 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1344` 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 (21 lines × 2) lib/screens/community/community_recommendations_page.dart:131 — lib/screens/community/community_recommendations_page.dart:131-151 | lib/widgets/media_items/media_peek_popup.dart:205-225 — before extracting anything, compare `lib/screens/community/community_recommendations_page.dart` and `lib/widgets/media_items/media_peek_popup.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `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 (21 lines × 2) lib/screens/library/editor/history_editor.dart:339 — lib/screens/library/editor/history_editor.dart:339-359 | lib/screens/library/editor/history_editor.dart:439-459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/history_editor.dart:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/screens/library/online/anime_list.dart:237 — lib/screens/library/online/anime_list.dart:237-257 | lib/screens/library/online/manga_list.dart:215-235 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 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/notifications/notification_screen.dart:452 — lib/screens/notifications/notification_screen.dart:452-472 | lib/screens/notifications/notification_screen.dart:628-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/notifications/notification_screen.dart:452` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/screens/search/search_view.dart:445 — lib/screens/search/search_view.dart:445-465 | lib/screens/search/search_view.dart:475-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/search_view.dart:445` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:107 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:107-127 | lib/screens/settings/sub_settings/settings_reader.dart:191-211 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) lib/screens/settings/sub_settings/settings_network.dart:490 — lib/screens/settings/sub_settings/settings_network.dart:490-510 | lib/screens/settings/sub_settings/settings_network.dart:812-832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:490` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/utils/color_profiler.dart:709 — lib/utils/color_profiler.dart:709-729 | lib/utils/color_profiler.dart:967-987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/color_profiler.dart:709` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/widgets/anymex_widgets/anymex_tile.dart:360 — lib/widgets/anymex_widgets/anymex_tile.dart:360-380 | lib/widgets/anymex_widgets/anymex_tile.dart:432-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_tile.dart:360` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) lib/widgets/common/baked_blur_image.dart:265 — lib/widgets/common/baked_blur_image.dart:265-285 | lib/widgets/common/baked_blur_image.dart:322-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/baked_blur_image.dart:265` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×17
  • Duplicated block (14 lines × 2) lib/controllers/services/anilist/anilist_data.dart:592 — lib/controllers/services/anilist/anilist_data.dart:592-605 | lib/controllers/services/anilist/anilist_data.dart:835-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_data.dart:592` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/controllers/services/widgets/widgets_builders.dart:301 — lib/controllers/services/widgets/widgets_builders.dart:301-314 | lib/screens/community/community_recommendations_page.dart:777-790 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/widgets/widgets_builders.dart:301` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/screens/anime/details/media_details_page.dart:1314 — lib/screens/anime/details/media_details_page.dart:1314-1327 | lib/widgets/common/home_continue_button.dart:188-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:1314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/screens/anime/misc/calendar.dart:965 — lib/screens/anime/misc/calendar.dart:965-978 | lib/widgets/media_items/media_item.dart:265-278 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/widgets/media_items/media_item.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:965` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/screens/anime/misc/calendar.dart:1040 — lib/screens/anime/misc/calendar.dart:1040-1053 | lib/widgets/media_items/media_item.dart:338-351 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/widgets/media_items/media_item.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:1040` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) lib/screens/anime/watch/controls/bottom_controls.dart:311 — lib/screens/anime/watch/controls/bottom_controls.dart:311-324 | lib/screens/anime/watch/controls/bottom_controls.dart:404-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/bottom_controls.dart:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/anime/watch/controls/bottom_controls.dart:325` calls `SizedBox` and `lib/screens/anime/watch/controls/bottom_controls.dart:418` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) lib/screens/anime/watch/controls/center_controls.dart:80 — lib/screens/anime/watch/controls/center_controls.dart:80-93 | lib/screens/anime/watch/controls/center_controls.dart:156-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/center_controls.dart:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/screens/anime/widgets/character_staff_sheet.dart:920 — lib/screens/anime/widgets/character_staff_sheet.dart:920-933 | lib/screens/anime/widgets/character_staff_sheet.dart:955-968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/character_staff_sheet.dart:920` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1437 — lib/screens/anime/widgets/comments/comments_section.dart:1437-1450 | lib/screens/anime/widgets/comments/comments_section.dart:1786-1799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1437` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/screens/downloads/controller/download_controller.dart:828 — lib/screens/downloads/controller/download_controller.dart:828-841 | lib/screens/downloads/controller/download_controller.dart:1180-1193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:828` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/screens/library/stats_page.dart:95 — lib/screens/library/stats_page.dart:95-108 | lib/screens/library/stats_page.dart:113-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/stats_page.dart:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/screens/notifications/notification_screen.dart:438 — lib/screens/notifications/notification_screen.dart:438-451 | lib/screens/notifications/notification_screen.dart:613-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/notifications/notification_screen.dart:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/screens/profile/widgets/profile_header.dart:673 — lib/screens/profile/widgets/profile_header.dart:673-686 | lib/screens/profile/widgets/profile_header.dart:690-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:673` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/screens/search/widgets/extension_filter_sheet.dart:459 — lib/screens/search/widgets/extension_filter_sheet.dart:459-472 | lib/screens/search/widgets/extension_filter_sheet.dart:616-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/extension_filter_sheet.dart:459` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/services/commentum_service.dart:602 — lib/services/commentum_service.dart:602-615 | lib/services/commentum_service.dart:961-974 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:72 — lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:72-85 | lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:146-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) lib/screens/extensions/ExtensionTesting/extension_test_item.dart:372 — lib/screens/extensions/ExtensionTesting/extension_test_item.dart:372-385 | lib/screens/extensions/ExtensionTesting/extension_test_page.dart:393-406 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/extensions/ExtensionTesting/extension_test_item.dart:372` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×15
  • Duplicated block (20 lines × 2) lib/controllers/services/widgets/widgets_builders.dart:375 — lib/controllers/services/widgets/widgets_builders.dart:375-394 | lib/screens/community/community_recommendations_page.dart:864-883 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/widgets/widgets_builders.dart:375` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/screens/anime/widgets/anime_stats.dart:645 — lib/screens/anime/widgets/anime_stats.dart:645-664 | lib/screens/manga/widgets/manga_stats.dart:348-367 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:645` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1981 — lib/screens/anime/widgets/comments/comments_section.dart:1981-2000 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:463-482 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1981` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:2217 — lib/screens/anime/widgets/comments/comments_section.dart:2217-2236 | lib/screens/anime/widgets/comments/comments_section.dart:2756-2775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2217` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:2679 — lib/screens/anime/widgets/comments/comments_section.dart:2679-2698 | lib/screens/anime/widgets/comments/comments_section.dart:2896-2915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2679` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) lib/screens/anime/widgets/voice_actor.dart:61 — lib/screens/anime/widgets/voice_actor.dart:61-80 | lib/screens/anime/widgets/voice_actor.dart:327-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/voice_actor.dart:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/screens/library/widgets/unified_history_card.dart:86 — lib/screens/library/widgets/unified_history_card.dart:86-105 | lib/screens/library/widgets/unified_history_card.dart:357-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/screens/profile/widgets/decoration_closet_sheet.dart:665 — lib/screens/profile/widgets/decoration_closet_sheet.dart:665-684 | lib/screens/profile/widgets/decoration_closet_sheet.dart:1129-1148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/decoration_closet_sheet.dart:665` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/screens/search/widgets/search_widgets.dart:1569 — lib/screens/search/widgets/search_widgets.dart:1569-1588 | lib/screens/search/widgets/search_widgets.dart:1643-1662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/search_widgets.dart:1569` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:66 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:66-85 | lib/screens/settings/sub_settings/settings_reader.dart:150-169 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 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 (20 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:68 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:68-87 | lib/screens/settings/sub_settings/settings_reader.dart:245-264 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 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 (20 lines × 2) lib/screens/settings/sub_settings/settings_network.dart:421 — lib/screens/settings/sub_settings/settings_network.dart:421-440 | lib/screens/settings/sub_settings/settings_network.dart:734-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:421` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/screens/settings/sub_settings/widgets/account_tile.dart:72 — lib/screens/settings/sub_settings/widgets/account_tile.dart:72-91 | lib/screens/settings/sub_settings/widgets/account_tile.dart:131-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/widgets/account_tile.dart:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/services/commentum_service.dart:2014 — lib/services/commentum_service.dart:2014-2033 | lib/services/commentum_service.dart:2095-2114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) lib/widgets/common/carousel/themes/big_carousel_classic.dart:95 — lib/widgets/common/carousel/themes/big_carousel_classic.dart:95-114 | lib/widgets/common/carousel/themes/big_carousel_portrait.dart:129-148 — before extracting anything, compare `lib/widgets/common/carousel/themes/big_carousel_classic.dart` and `lib/widgets/common/carousel/themes/big_carousel_portrait.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/carousel/themes/big_carousel_classic.dart:95` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×14
  • Duplicated block (19 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:2032 — lib/controllers/services/anilist/anilist_auth.dart:2032-2050 | lib/controllers/services/anilist/anilist_auth.dart:2432-2450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:2032` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/anime/watch/controls/bottom_controls.dart:364 — lib/screens/anime/watch/controls/bottom_controls.dart:364-382 | lib/screens/anime/watch/controls/bottom_controls.dart:466-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/bottom_controls.dart:364` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/anime/widgets/anime_stats.dart:592 — lib/screens/anime/widgets/anime_stats.dart:592-610 | lib/screens/profile/widgets/profile_stats_tab.dart:415-433 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/profile/widgets/profile_stats_tab.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:592` 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 (19 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:2193 — lib/screens/anime/widgets/comments/comments_section.dart:2193-2211 | lib/screens/anime/widgets/comments/comments_section.dart:2728-2746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2193` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/library/widgets/anime_card.dart:32 — lib/screens/library/widgets/anime_card.dart:32-50 | lib/screens/library/widgets/common_widgets.dart:33-51 — before extracting anything, compare `lib/screens/library/widgets/anime_card.dart` and `lib/screens/library/widgets/common_widgets.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/anime_card.dart:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/local_source/local_source_view.dart:606 — lib/screens/local_source/local_source_view.dart:606-624 | lib/screens/local_source/local_source_view.dart:674-692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:606` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1452 — lib/screens/profile/compatibility/compatibility_result_page.dart:1452-1470 | lib/screens/profile/compatibility/compatibility_result_page.dart:1656-1674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1452` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/profile/compatibility/compatibility_result_page.dart:1471` calls `of`, `pop` and `lib/screens/profile/compatibility/compatibility_result_page.dart:1675` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) lib/screens/profile/profile_page.dart:379 — lib/screens/profile/profile_page.dart:379-397 | lib/screens/profile/user_profile_page.dart:451-469 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:379` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (19 lines × 2) lib/screens/profile/widgets/activity_heatmap.dart:161 — lib/screens/profile/widgets/activity_heatmap.dart:161-179 | lib/screens/stats/user_stats_page.dart:662-680 — before extracting anything, compare `lib/screens/profile/widgets/activity_heatmap.dart` and `lib/screens/stats/user_stats_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/activity_heatmap.dart:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/profile/widgets/profile_header.dart:997 — lib/screens/profile/widgets/profile_header.dart:997-1015 | lib/screens/profile/widgets/user_profile_app_bar.dart:534-552 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:997` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/settings/misc/sauce_finder_view.dart:360 — lib/screens/settings/misc/sauce_finder_view.dart:360-378 | lib/screens/settings/misc/sauce_finder_view.dart:712-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/misc/sauce_finder_view.dart:360` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:87 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:87-105 | lib/screens/settings/sub_settings/settings_reader.dart:171-189 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:480 — lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:480-498 | lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:504-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) lib/widgets/header/legacy_header.dart:129 — lib/widgets/header/legacy_header.dart:129-147 | lib/widgets/header/legacy_header.dart:170-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/header/legacy_header.dart:129` 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 (18 lines × 2) · ×14
  • Duplicated block (18 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:2419 — lib/screens/anime/widgets/comments/comments_section.dart:2419-2436 | lib/screens/anime/widgets/comments/comments_section.dart:2634-2651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2419` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:2521 — lib/screens/anime/widgets/comments/comments_section.dart:2521-2538 | lib/screens/anime/widgets/comments/comments_section.dart:2657-2674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:972 — lib/screens/anime/widgets/episode_list_builder.dart:972-989 | lib/screens/manga/widgets/chapter_list_builder.dart:535-552 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:972` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/screens/manga/home_page.dart:53 — lib/screens/manga/home_page.dart:53-70 | lib/screens/novel/home_page.dart:43-60 — `lib/screens/manga/home_page.dart` and `lib/screens/novel/home_page.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 57 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/home_page.dart:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) lib/screens/notifications/notification_screen.dart:356 — lib/screens/notifications/notification_screen.dart:356-373 | lib/screens/notifications/notification_screen.dart:544-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/notifications/notification_screen.dart:356` 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 (18 lines × 2) lib/screens/novel/reader/controller/reader_controller.dart:1084 — lib/screens/novel/reader/controller/reader_controller.dart:1084-1101 | lib/screens/novel/reader/controller/reader_controller.dart:1107-1124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/novel/reader/controller/reader_controller.dart:1084` 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 (18 lines × 2) lib/screens/profile/profile_page.dart:778 — lib/screens/profile/profile_page.dart:778-795 | lib/screens/profile/user_profile_page.dart:737-754 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:778` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) lib/screens/settings/sub_settings/player/settings_player_controls.dart:353 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:353-370 | lib/screens/settings/sub_settings/settings_reader.dart:519-536 — before extracting anything, compare `lib/screens/settings/sub_settings/player/settings_player_controls.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_controls.dart:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:105 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:105-122 | lib/screens/settings/sub_settings/settings_reader.dart:282-299 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/screens/settings/sub_settings/settings_comments.dart:76 — lib/screens/settings/sub_settings/settings_comments.dart:76-93 | lib/screens/settings/sub_settings/settings_network.dart:51-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_comments.dart:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/screens/settings/sub_settings/settings_extensions.dart:469 — lib/screens/settings/sub_settings/settings_extensions.dart:469-486 | lib/screens/settings/sub_settings/settings_extensions.dart:531-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_extensions.dart:469` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) lib/screens/settings/sub_settings/settings_moderation.dart:823 — lib/screens/settings/sub_settings/settings_moderation.dart:823-840 | lib/screens/settings/sub_settings/settings_moderation.dart:1465-1482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_moderation.dart:823` 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 (18 lines × 2) lib/screens/stats/user_stats_page.dart:394 — lib/screens/stats/user_stats_page.dart:394-411 | lib/screens/stats/user_stats_page.dart:1147-1164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/stats/user_stats_page.dart:394` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18 lines × 2) lib/widgets/anymex_widgets/anymex_animated_logo.dart:572 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:572-589 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:647-664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_animated_logo.dart:572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×14
  • Duplicated block (13–14 lines × 2) lib/screens/anime/watch/controls/widgets/shader_osd.dart:31 — lib/screens/anime/watch/controls/widgets/shader_osd.dart:31-44 | lib/screens/community/community_recommendations_page.dart:780-792 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/shader_osd.dart:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) lib/screens/anime/widgets/voice_actor.dart:121 — lib/screens/anime/widgets/voice_actor.dart:121-134 | lib/screens/anime/widgets/voice_actor.dart:381-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/voice_actor.dart:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) lib/screens/downloads/controller/download_controller.dart:1351 — lib/screens/downloads/controller/download_controller.dart:1351-1364 | lib/screens/downloads/controller/download_controller.dart:1742-1754 — both copies are in the same file, so extract the block into 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/downloads/controller/download_controller.dart:1653 — lib/screens/downloads/controller/download_controller.dart:1653-1666 | lib/screens/downloads/controller/download_controller.dart:1716-1728 — both copies are in the same file, so extract the block into 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/downloads/nested_screens/active_downloads/active_downloads.dart:409 — lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:409-422 | lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:629-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:409` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13–14 lines × 2) lib/screens/manga/widgets/chapter_list_builder.dart:1032 — lib/screens/manga/widgets/chapter_list_builder.dart:1032-1045 | lib/screens/novel/details/widgets/chapter_item.dart:142-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/chapter_list_builder.dart:1032` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) lib/screens/notifications/notification_screen.dart:415 — lib/screens/notifications/notification_screen.dart:415-428 | lib/screens/notifications/notification_screen.dart:589-601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/notifications/notification_screen.dart:415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) lib/screens/novel/reader/widgets/bottom_controls.dart:420 — lib/screens/novel/reader/widgets/bottom_controls.dart:420-433 | lib/screens/novel/reader/widgets/bottom_controls.dart:449-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/novel/reader/widgets/bottom_controls.dart:420` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1436 — lib/screens/profile/compatibility/compatibility_result_page.dart:1436-1449 | lib/screens/profile/compatibility/compatibility_result_page.dart:1638-1650 — both copies are in the same file, so extract the block into 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/profile/widgets/profile_header.dart:179 — lib/screens/profile/widgets/profile_header.dart:179-191 | lib/screens/profile/widgets/user_profile_header.dart:150-163 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 179 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:179` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/profile/widgets/user_profile_header.dart:148` calls `IconButton`, `Icon` and `lib/screens/profile/widgets/profile_header.dart:178` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13–14 lines × 2) lib/screens/profile/widgets/user_profile_app_bar.dart:513 — lib/screens/profile/widgets/user_profile_app_bar.dart:513-526 | lib/screens/profile/widgets/user_profile_header.dart:301-313 — before extracting anything, compare `lib/screens/profile/widgets/user_profile_app_bar.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_profile_app_bar.dart:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) lib/screens/profile/widgets/user_profile_app_bar.dart:550 — lib/screens/profile/widgets/user_profile_app_bar.dart:550-563 | lib/screens/profile/widgets/user_profile_header.dart:343-355 — before extracting anything, compare `lib/screens/profile/widgets/user_profile_app_bar.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_profile_app_bar.dart:550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:340 — lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:340-353 | lib/screens/settings/sub_settings/settings_player.dart:116-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:340` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) lib/screens/settings/sub_settings/settings_downloads.dart:25 — lib/screens/settings/sub_settings/settings_downloads.dart:25-37 | lib/screens/settings/sub_settings/settings_ui.dart:57-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_downloads.dart:25` 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 × 3) · ×12
  • Duplicated block (11 lines × 3) lib/models/Media/media.dart:270 — lib/models/Media/media.dart:270-280 | lib/models/Media/media.dart:475-485 | lib/models/Media/media.dart:1230-1240 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/screens/anime/misc/calendar.dart:250 — lib/screens/anime/misc/calendar.dart:250-260 | lib/screens/library/online/anime_list.dart:543-553 | lib/screens/library/online/manga_list.dart:527-537 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/screens/library/online/anime_list.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) lib/screens/anime/misc/list_exporter.dart:387 — lib/screens/anime/misc/list_exporter.dart:387-397 | lib/screens/anime/misc/list_exporter.dart:451-461 | lib/screens/extensions/widgets/plugin_manager.dart:601-611 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/list_exporter.dart:387` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/screens/downloads/download_screen.dart:1070 — lib/screens/downloads/download_screen.dart:1070-1080 | lib/screens/downloads/download_screen.dart:1348-1358 | lib/screens/downloads/download_screen.dart:1571-1581 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) lib/screens/library/stats_page.dart:79 — lib/screens/library/stats_page.dart:79-90 | lib/screens/library/stats_page.dart:98-108 | lib/screens/library/stats_page.dart:116-126 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/stats_page.dart:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/screens/library/widgets/unified_history_card.dart:95 — lib/screens/library/widgets/unified_history_card.dart:95-105 | lib/screens/library/widgets/unified_history_card.dart:228-238 | lib/screens/library/widgets/unified_history_card.dart:366-376 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/screens/manga/widgets/reader/color_filter_settings_page.dart:84 — lib/screens/manga/widgets/reader/color_filter_settings_page.dart:84-94 | lib/screens/manga/widgets/reader/color_filter_settings_page.dart:98-108 | lib/screens/manga/widgets/reader/color_filter_settings_page.dart:112-122 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/color_filter_settings_page.dart:84` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 3) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:184 — lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:184-194 | lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:236-246 | lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:289-299 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/screens/profile/widgets/profile_header.dart:937 — lib/screens/profile/widgets/profile_header.dart:937-948 | lib/screens/profile/widgets/user_profile_app_bar.dart:457-468 | lib/screens/profile/widgets/user_profile_header.dart:253-263 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:937` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/screens/settings/sub_settings/player/settings_player_shaders.dart:339 — lib/screens/settings/sub_settings/player/settings_player_shaders.dart:339-349 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:401-411 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:543-553 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_shaders.dart:339` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/services/commentum_service.dart:322 — lib/services/commentum_service.dart:322-332 | lib/services/commentum_service.dart:376-386 | lib/services/commentum_service.dart:1082-1092 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:322` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/commentum_service.dart:319` calls `i`, `encode` and `lib/services/commentum_service.dart:373` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) lib/screens/anime/watch/controls/widgets/audio_popup.dart:25 — lib/screens/anime/watch/controls/widgets/audio_popup.dart:25-35 | lib/screens/anime/watch/controls/widgets/source_popup.dart:23-33 | lib/screens/anime/watch/controls/widgets/tracks_popup.dart:32-42 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/source_popup.dart` and `lib/screens/anime/watch/controls/widgets/tracks_popup.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×12
  • Duplicated block (5 lines × 2) lib/screens/anime/watch/controls/bottom_controls.dart:233 — lib/screens/anime/watch/controls/bottom_controls.dart:233-237 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:391-395 — 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) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1740 — lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1740-1744 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1797-1801 — both copies are in the same file, so extract the block into 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/anime/watch/controls/widgets/decoder_quick_button.dart:111 — lib/screens/anime/watch/controls/widgets/decoder_quick_button.dart:111-115 | lib/screens/anime/watch/controls/widgets/decoder_quick_button.dart:118-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/decoder_quick_button.dart:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:3394 — lib/screens/anime/widgets/comments/comments_section.dart:3394-3399 | lib/screens/anime/widgets/comments/comments_section.dart:3584-3588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:3394` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/anime/widgets/comments/comments_section.dart:3588` calls `toString` and `lib/screens/anime/widgets/comments/comments_section.dart:3399` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) lib/screens/downloads/download_screen.dart:580 — lib/screens/downloads/download_screen.dart:580-584 | lib/widgets/anime/visuals/visuals_popup.dart:446-452 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:580` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/screens/extensions/widgets/plugin_manager.dart:145 — lib/screens/extensions/widgets/plugin_manager.dart:145-150 | lib/screens/extensions/widgets/plugin_manager.dart:187-191 — both copies are in the same file, so extract the block into 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/database/comments/model/leaderboard_entry.dart:143 — lib/database/comments/model/leaderboard_entry.dart:143-147 | lib/database/comments/model/user_points.dart:68-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) lib/controllers/services/mal/mal_api.dart:76 — lib/controllers/services/mal/mal_api.dart:76-80 | lib/controllers/services/mal/mal_service.dart:408-412 — before extracting anything, compare `lib/controllers/services/mal/mal_api.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_api.dart:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/utils/compatibility/matchmaker.dart:815 — lib/utils/compatibility/matchmaker.dart:815-819 | lib/utils/compatibility/matchmaker.dart:856-860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/compatibility/matchmaker.dart:815` 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) lib/utils/media_downloader.dart:316 — lib/utils/media_downloader.dart:316-320 | lib/utils/media_downloader.dart:325-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/media_downloader.dart:316` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) lib/utils/mesh_blur_helper.dart:156 — lib/utils/mesh_blur_helper.dart:156-160 | lib/utils/mesh_blur_helper.dart:162-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/mesh_blur_helper.dart:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/widgets/anymex_widgets/anymex_image.dart:254 — lib/widgets/anymex_widgets/anymex_image.dart:254-258 | lib/widgets/anymex_widgets/anymex_image.dart:321-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D35 · Change Coupling · Change coupling · ×11
  • Change coupling: reader_view.dart ↔ settings_view.dart lib/screens/manga/widgets/reader/reader_view.dart:1 — `lib/screens/manga/widgets/reader/reader_view.dart` and `lib/screens/manga/widgets/reader/settings_view.dart` change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `0de1481e` feat: tachiyomi like overscroll; `d7c2b841` feat: fit to screen for tablets in manga reader, improved the ui a li…; `1630d6b3` Feat: Tap Zones + Better Crop Borders For Manga Reader (#278) — run `git show` on any of them.
  • Change coupling: player_controller.dart ↔ better_player.dart lib/screens/anime/watch/controller/player_controller.dart:1 — `lib/screens/anime/watch/controller/player_controller.dart` and `lib/screens/anime/watch/player/better_player.dart` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `1f30b647` feat: settings backup and restore, lots of fixes related to downloads…; `a734d196` fix: fixed broken subs, fixed a minor delay between subs; `adbdf085` fix: fixed some streams not playing, hid buttons that has 0 or 1 entr… — run `git show` on any of them.
  • Change coupling: widgets_builders.dart ↔ main.dart lib/controllers/services/widgets/widgets_builders.dart:1 — `lib/controllers/services/widgets/widgets_builders.dart` and `lib/main.dart` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9ed1c1bc` perf: improved page switch performance; `5ea07fca` feat: community recommendations for movies/shows, voting, live filter…; `81a01127` feat: add underrated anime/manga section powered by GitHub JSON (#360) — run `git show` on any of them.
  • Change coupling: episode_list_builder.dart ↔ episode_watch_screen.dart lib/screens/anime/widgets/episode_list_builder.dart:1 — `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/anime/widgets/episode_watch_screen.dart` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `d2c4fd5c` feat: Full download support on metadata services, lots of fixes; `b3a76f2b` fix: fixed sub/dub not persisting across all episodes; `67971f62` fix: fixed mal issue where manga and anime were mismatching — run `git show` on any of them.
  • Change coupling: anime_list.dart ↔ manga_list.dart lib/screens/library/online/anime_list.dart:1 — `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `a277be02` fix: overflow fix on anime and manga list; `d8294db8` fix:: fixed ui not reflecting instant changes and header ui overflow; `47d42453` fix: fixed dupe entries in tracking lists — run `git show` on any of them.
  • Change coupling: bottom_controls.dart ↔ ios26_player_control_theme.dart lib/screens/anime/watch/controls/bottom_controls.dart:1 — `lib/screens/anime/watch/controls/bottom_controls.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` change together 59% of the time (10 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `3bb0908d` feat: torrent file selector in player; `9605b5f1` fix: fixed tracking issues and new episode release stale states; `622e13dd` feat: dynamic orientation button in player — run `git show` on any of them.
  • Change coupling: ios26_player_control_theme.dart ↔ json_player_control_theme.dart lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:1 — `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `3bb0908d` feat: torrent file selector in player; `9605b5f1` fix: fixed tracking issues and new episode release stale states; `622e13dd` feat: dynamic orientation button in player — run `git show` on any of them.
  • Change coupling: themes.dart ↔ main.dart lib/constants/themes.dart:1 — `lib/constants/themes.dart` and `lib/main.dart` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `2ff00737` feat: ui improvements on details page, performance improved, animatio…; `55d68e6f` fix: fixed grey screens on watch page; `6cadc081` refactor: migrated to applinks from unilinks — run `git show` on any of them.
  • Change coupling: better_player.dart ↔ media_kit_player.dart lib/screens/anime/watch/player/better_player.dart:1 — `lib/screens/anime/watch/player/better_player.dart` and `lib/screens/anime/watch/player/media_kit_player.dart` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1f30b647` feat: settings backup and restore, lots of fixes related to downloads…; `1f9a2509` feat: subtitle delay support for libmpv; `a734d196` fix: fixed broken subs, fixed a minor delay between subs — run `git show` on any of them.
  • Change coupling: REDACTED ↔ REDACTED lib/screens/anime/home_page.dart:1 — `lib/screens/anime/home_page.dart` and `lib/screens/manga/home_page.dart` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `4f64fe02` fix: series type mismatch on simkl; `24ecc977` fix: fixed lag on keyboard popup; `e659c49a` feat: revamp extension service — run `git show` on any of them.
  • Change coupling: REDACTED ↔ REDACTED lib/screens/anime/home_page.dart:1 — `lib/screens/anime/home_page.dart` and `lib/screens/home_page.dart` 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `3fca1f5a` perf: minor performance improvements; `7809faa7` fix: fixed appbar disappear even on media tab change; `36754206` feat: enhanced new episode released cards, fixed bugs when deleting h… — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×11
  • Edited copy of a member (10 corresponding lines) lib/models/Anilist/anilist_profile.dart:594 — lib/models/Anilist/anilist_profile.dart:594-606 | lib/models/Anilist/anilist_profile.dart:624-633 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/screens/library/online/anime_list.dart:331 — lib/screens/library/online/anime_list.dart:331-340 | lib/screens/library/online/manga_list.dart:310-323 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/utils/compatibility/matchmaker.dart:460 — lib/utils/compatibility/matchmaker.dart:460-469 | lib/utils/compatibility/matchmaker.dart:483-492 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/controllers/services/simkl/simkl_api.dart:66 — lib/controllers/services/simkl/simkl_api.dart:66-75 | lib/controllers/services/simkl/simkl_api.dart:82-92 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/widgets/anymex_widgets/anymex_animated_logo.dart:377 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:377-386 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:467-476 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/screens/settings/sub_settings/settings_addons.dart:62 — lib/screens/settings/sub_settings/settings_addons.dart:62-71 | lib/screens/settings/sub_settings/settings_addons.dart:73-82 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/controllers/watchium/watchium_service.dart:849 — lib/controllers/watchium/watchium_service.dart:849-858 | lib/controllers/watchium/watchium_service.dart:870-879 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/screens/anime/widgets/comments/controller/comments_controller.dart:638 — lib/screens/anime/widgets/comments/controller/comments_controller.dart:638-647 | lib/screens/anime/widgets/comments/controller/comments_controller.dart:649-658 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/widgets/anime/visuals/visuals_popup.dart:290 — lib/widgets/anime/visuals/visuals_popup.dart:290-299 | lib/widgets/anime/visuals/visuals_popup.dart:301-311 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/utils/al_about_me.dart:507 — lib/utils/al_about_me.dart:507-516 | lib/widgets/non_widgets/activity_card.dart:1055-1065 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/widgets/media_items/media_peek_popup.dart:146 — lib/widgets/media_items/media_peek_popup.dart:146-156 | lib/widgets/non_widgets/reasons_sheet.dart:66-75 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×11
  • Duplicated block (26 lines × 2) lib/controllers/services/backup_restore/backup_restore_service.dart:1686 — lib/controllers/services/backup_restore/backup_restore_service.dart:1686-1711 | lib/controllers/services/backup_restore/backup_restore_service.dart:1756-1781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/backup_restore_service.dart:1686` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) lib/screens/anime/watch/controls/bottom_controls.dart:330 — lib/screens/anime/watch/controls/bottom_controls.dart:330-355 | lib/screens/anime/watch/controls/bottom_controls.dart:423-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/bottom_controls.dart:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1896 — lib/screens/anime/widgets/comments/comments_section.dart:1896-1921 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:377-402 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1896` 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 (26 lines × 2) lib/screens/downloads/widgets/download_server_selector.dart:651 — lib/screens/downloads/widgets/download_server_selector.dart:651-676 | lib/screens/downloads/widgets/download_server_selector.dart:692-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/download_server_selector.dart:651` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) lib/screens/library/editor/history_editor.dart:280 — lib/screens/library/editor/history_editor.dart:280-305 | lib/screens/library/editor/history_editor.dart:380-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/history_editor.dart:280` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (26 lines × 2) lib/screens/library/editor/history_editor.dart:307 — lib/screens/library/editor/history_editor.dart:307-332 | lib/screens/library/editor/history_editor.dart:407-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/history_editor.dart:307` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (26 lines × 2) lib/screens/profile/profile_page.dart:213 — lib/screens/profile/profile_page.dart:213-238 | lib/screens/profile/user_profile_page.dart:306-331 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 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 (26 lines × 2) lib/screens/profile/widgets/profile_header.dart:927 — lib/screens/profile/widgets/profile_header.dart:927-952 | lib/screens/profile/widgets/user_profile_app_bar.dart:447-472 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:927` 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 (26 lines × 2) lib/screens/settings/sub_settings/settings_network.dart:311 — lib/screens/settings/sub_settings/settings_network.dart:311-336 | lib/screens/settings/sub_settings/settings_network.dart:566-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:311` 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 (26 lines × 2) lib/screens/settings/sub_settings/settings_theme.dart:774 — lib/screens/settings/sub_settings/settings_theme.dart:774-799 | lib/screens/settings/sub_settings/settings_theme.dart:811-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_theme.dart:774` 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 (26 lines × 2) lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:66 — lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:66-91 | lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:201-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×11
  • Duplicated block (25 lines × 2) lib/screens/anime/widgets/character_staff_sheet.dart:1280 — lib/screens/anime/widgets/character_staff_sheet.dart:1280-1304 | lib/screens/anime/widgets/character_staff_sheet.dart:1310-1334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:627 — lib/screens/anime/widgets/comments/comments_section.dart:627-651 | lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:51-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (25 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1517 — lib/screens/anime/widgets/comments/comments_section.dart:1517-1541 | lib/screens/anime/widgets/comments/comments_section.dart:1870-1894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/comments/comments_section.dart:1869` calls `Spacer` and `lib/screens/anime/widgets/comments/comments_section.dart:1516` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (25 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1543 — lib/screens/anime/widgets/comments/comments_section.dart:1543-1567 | lib/screens/anime/widgets/comments/comments_section.dart:1922-1946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1543` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/comments/comments_section.dart:1542` calls `Spacer` and `lib/screens/anime/widgets/comments/comments_section.dart:1921` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (25 lines × 2) lib/screens/anime/widgets/list_editor.dart:622 — lib/screens/anime/widgets/list_editor.dart:622-646 | lib/screens/anime/widgets/list_editor.dart:741-765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/list_editor.dart:622` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) lib/screens/library/online/anime_list.dart:407 — lib/screens/library/online/anime_list.dart:407-431 | lib/screens/library/online/manga_list.dart:391-415 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:407` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) lib/screens/library/widgets/unified_history_card.dart:150 — lib/screens/library/widgets/unified_history_card.dart:150-174 | lib/screens/library/widgets/unified_history_card.dart:419-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:150` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) lib/screens/settings/sub_settings/player/settings_player_controls.dart:299 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:299-323 | lib/screens/settings/sub_settings/settings_reader.dart:447-471 — before extracting anything, compare `lib/screens/settings/sub_settings/player/settings_player_controls.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_controls.dart:299` 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 (25 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:178 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:178-202 | lib/screens/settings/sub_settings/settings_reader.dart:900-924 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:178` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) lib/utils/liquid.dart:623 — lib/utils/liquid.dart:623-647 | lib/utils/liquid.dart:655-679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/liquid.dart:623` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/utils/liquid.dart:654` calls `_loadMeshImage` and `lib/utils/liquid.dart:622` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (25 lines × 2) lib/widgets/non_widgets/recommend_sheet.dart:438 — lib/widgets/non_widgets/recommend_sheet.dart:438-462 | lib/widgets/non_widgets/recommend_sheet.dart:644-668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/recommend_sheet.dart:438` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×11
  • Duplicated block (24 lines × 2) lib/models/Media/media.dart:1068 — lib/models/Media/media.dart:1068-1091 | lib/models/Media/media.dart:1098-1121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:1068` 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 (24 lines × 2) lib/screens/anime/watch/controller/player_controller.dart:1155 — lib/screens/anime/watch/controller/player_controller.dart:1155-1178 | lib/screens/anime/watch/controller/player_controller.dart:2062-2085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controller/player_controller.dart:1155` 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 (24 lines × 2) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:181 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:181-204 | lib/widgets/common/anymex_slider_m3.dart:186-209 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart` and `lib/widgets/common/anymex_slider_m3.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (24 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:548 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:548-571 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:360-383 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:548` 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 (24 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:213 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:213-236 | lib/widgets/watchium/watchium_create_dialog.dart:699-722 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:213` 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 (24 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1954 — lib/screens/anime/widgets/comments/comments_section.dart:1954-1977 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:437-460 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1954` 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 (24 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1523 — lib/screens/anime/widgets/episode_list_builder.dart:1523-1546 | lib/screens/manga/widgets/chapter_list_builder.dart:1615-1638 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1523` 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 (24 lines × 2) lib/screens/downloads/controller/download_controller.dart:1430 — lib/screens/downloads/controller/download_controller.dart:1430-1453 | lib/screens/downloads/controller/download_controller.dart:2700-2723 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (24 lines × 2) lib/screens/profile/profile_page.dart:157 — lib/screens/profile/profile_page.dart:157-180 | lib/screens/profile/user_profile_page.dart:251-274 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:157` 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 (24 lines × 2) lib/screens/settings/sub_settings/player/settings_player_shaders.dart:355 — lib/screens/settings/sub_settings/player/settings_player_shaders.dart:355-378 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:498-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_shaders.dart:355` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (24 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:123 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:123-146 | lib/screens/settings/sub_settings/settings_reader.dart:305-328 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×11
  • Duplicated block (12–13 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:1775 — lib/controllers/services/anilist/anilist_auth.dart:1775-1786 | lib/controllers/services/anilist/anilist_auth.dart:1817-1829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1775` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) lib/controllers/services/community_service.dart:1024 — lib/controllers/services/community_service.dart:1024-1036 | lib/controllers/services/community_service.dart:1086-1097 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:1024` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) lib/controllers/services/community_service.dart:1055 — lib/controllers/services/community_service.dart:1055-1067 | lib/controllers/services/community_service.dart:1110-1121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:1055` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) lib/screens/anime/watch/controls/widgets/progress_slider.dart:88 — lib/screens/anime/watch/controls/widgets/progress_slider.dart:88-100 | lib/screens/anime/watch/controls/widgets/progress_slider.dart:105-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/progress_slider.dart:88` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) lib/screens/anime/widgets/character_staff_sheet.dart:261 — lib/screens/anime/widgets/character_staff_sheet.dart:261-272 | lib/screens/extensions/ExtensionItem.dart:184-196 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/character_staff_sheet.dart:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) lib/screens/profile/profile_page.dart:1192 — lib/screens/profile/profile_page.dart:1192-1203 | lib/screens/profile/user_profile_page.dart:1113-1125 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:1192` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) lib/screens/profile/widgets/user_media_list_page.dart:304 — lib/screens/profile/widgets/user_media_list_page.dart:304-315 | lib/widgets/non_widgets/recommend_sheet.dart:168-180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_media_list_page.dart:304` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) lib/screens/search/search_view.dart:363 — lib/screens/search/search_view.dart:363-375 | lib/screens/search/search_view.dart:391-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/search_view.dart:363` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) lib/widgets/anymex_widgets/anymex_button.dart:139 — lib/widgets/anymex_widgets/anymex_button.dart:139-150 | lib/widgets/anymex_widgets/anymex_container.dart:72-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_button.dart:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) lib/widgets/common/cards/card_components.dart:132 — lib/widgets/common/cards/card_components.dart:132-143 | lib/widgets/common/cards/card_components.dart:264-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/cards/card_components.dart:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) lib/widgets/helper/platform_builder.dart:184 — lib/widgets/helper/platform_builder.dart:184-195 | lib/widgets/helper/platform_builder.dart:198-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/helper/platform_builder.dart:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×10
  • Edited copy of a member (13 corresponding lines) lib/database/comments/model/user_customization.dart:89 — lib/database/comments/model/user_customization.dart:89-103 | lib/database/comments/model/user_customization.dart:123-135 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/screens/anime/widgets/comments/comments_section.dart:1357 — lib/screens/anime/widgets/comments/comments_section.dart:1357-1369 | lib/screens/anime/widgets/comments/comments_section.dart:1371-1383 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/controllers/settings/settings.dart:893 — lib/controllers/settings/settings.dart:893-905 | lib/controllers/settings/settings.dart:908-921 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/screens/downloads/controller/download_controller.dart:600 — lib/screens/downloads/controller/download_controller.dart:600-616 | lib/screens/downloads/controller/download_controller.dart:682-694 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/screens/anime/widgets/list_editor.dart:263 — lib/screens/anime/widgets/list_editor.dart:263-275 | lib/screens/anime/widgets/list_editor.dart:277-291 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/controllers/sync/gist_sync_service.dart:245 — lib/controllers/sync/gist_sync_service.dart:245-258 | lib/controllers/sync/gist_sync_service.dart:265-277 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/utils/external_font_loader.dart:291 — lib/utils/external_font_loader.dart:291-304 | lib/utils/external_font_loader.dart:325-337 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/controllers/network/anilist_interceptor.dart:24 — lib/controllers/network/anilist_interceptor.dart:24-36 | lib/controllers/network/anilist_interceptor.dart:38-50 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:759 — lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:759-771 | lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:773-785 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/screens/anime/watch/controls/widgets/speed_popup.dart:21 — lib/screens/anime/watch/controls/widgets/speed_popup.dart:21-33 | lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:19-31 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×10
  • Duplicated block (23 lines × 2) lib/screens/downloads/widgets/downloaded_media_view.dart:1061 — lib/screens/downloads/widgets/downloaded_media_view.dart:1061-1083 | lib/screens/downloads/widgets/downloaded_media_view.dart:1257-1279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:1061` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) lib/screens/manga/widgets/reader/auto_scroll_menu.dart:122 — lib/screens/manga/widgets/reader/auto_scroll_menu.dart:122-144 | lib/screens/novel/reader/novel_reader.dart:187-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/auto_scroll_menu.dart:122` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (23 lines × 2) lib/screens/manga/widgets/reader/top_controls.dart:39 — lib/screens/manga/widgets/reader/top_controls.dart:39-61 | lib/screens/novel/reader/widgets/top_controls.dart:28-50 — before extracting anything, compare `lib/screens/manga/widgets/reader/top_controls.dart` and `lib/screens/novel/reader/widgets/top_controls.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/top_controls.dart:39` 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 (23 lines × 2) lib/screens/profile/activity_details_page.dart:665 — lib/screens/profile/activity_details_page.dart:665-687 | lib/screens/profile/widgets/social_tab.dart:338-360 — before extracting anything, compare `lib/screens/profile/activity_details_page.dart` and `lib/screens/profile/widgets/social_tab.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/activity_details_page.dart:665` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (23 lines × 2) lib/screens/search/search_view.dart:975 — lib/screens/search/search_view.dart:975-997 | lib/screens/search/search_view.dart:1041-1063 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/search_view.dart:975` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (23 lines × 2) lib/screens/search/widgets/extension_filter_sheet.dart:273 — lib/screens/search/widgets/extension_filter_sheet.dart:273-295 | lib/screens/search/widgets/extension_filter_sheet.dart:767-789 — both copies are in the same file, so extract the 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 (23 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:516 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:516-538 | lib/screens/settings/sub_settings/settings_reader.dart:1411-1433 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:516` 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 (23 lines × 2) lib/screens/settings/sub_settings/settings_network.dart:338 — lib/screens/settings/sub_settings/settings_network.dart:338-360 | lib/screens/settings/sub_settings/settings_network.dart:593-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:338` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (23 lines × 2) lib/widgets/media_items/media_peek_popup.dart:457 — lib/widgets/media_items/media_peek_popup.dart:457-479 | lib/widgets/non_widgets/reasons_sheet.dart:431-453 — before extracting anything, compare `lib/widgets/media_items/media_peek_popup.dart` and `lib/widgets/non_widgets/reasons_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) lib/utils/compatibility/matchmaker.dart:702 — lib/utils/compatibility/matchmaker.dart:702-724 | lib/utils/compatibility/matchmaker.dart:968-990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/compatibility/matchmaker.dart:702` 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 (22 lines × 2) · ×10
  • Duplicated block (22 lines × 2) lib/controllers/services/backup_restore/backup_restore_service.dart:1099 — lib/controllers/services/backup_restore/backup_restore_service.dart:1099-1120 | lib/controllers/services/backup_restore/backup_restore_service.dart:1125-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/backup_restore_service.dart:1099` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/controllers/services/community_service.dart:227 — lib/controllers/services/community_service.dart:227-248 | lib/controllers/services/community_service.dart:311-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) lib/screens/anime/watch/controls/top_controls.dart:114 — lib/screens/anime/watch/controls/top_controls.dart:114-135 | lib/screens/anime/watch/controls/top_controls.dart:254-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/top_controls.dart:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/screens/anime/watch/controls/widgets/progress_slider.dart:364 — lib/screens/anime/watch/controls/widgets/progress_slider.dart:364-385 | lib/screens/anime/watch/controls/widgets/progress_slider.dart:484-505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/progress_slider.dart:364` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/screens/anime/watch/watch_view.dart:259 — lib/screens/anime/watch/watch_view.dart:259-280 | lib/screens/local_source/player/offline_player.dart:183-204 — before extracting anything, compare `lib/screens/anime/watch/watch_view.dart` and `lib/screens/local_source/player/offline_player.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/watch_view.dart:259` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:366 — lib/screens/anime/widgets/comments/comments_section.dart:366-387 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:689-710 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 175 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 (22 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1302 — lib/screens/anime/widgets/episode_list_builder.dart:1302-1323 | lib/screens/manga/widgets/chapter_list_builder.dart:1420-1441 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/screens/library/editor/history_editor.dart:238 — lib/screens/library/editor/history_editor.dart:238-259 | lib/screens/library/editor/list_editor.dart:142-163 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) lib/screens/local_source/local_source_view.dart:405 — lib/screens/local_source/local_source_view.dart:405-426 | lib/screens/local_source/local_source_view.dart:429-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) lib/screens/manga/widgets/reader/reader_color_overlay.dart:43 — lib/screens/manga/widgets/reader/reader_color_overlay.dart:43-64 | lib/screens/manga/widgets/reader/reader_view.dart:243-264 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×9
  • Edited copy of a member (18 corresponding lines) lib/screens/downloads/controller/download_controller.dart:728 — lib/screens/downloads/controller/download_controller.dart:728-745 | lib/screens/downloads/controller/download_controller.dart:747-765 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/screens/library/online/anime_list.dart:273 — lib/screens/library/online/anime_list.dart:273-290 | lib/screens/library/online/manga_list.dart:251-269 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/screens/downloads/controller/download_controller.dart:118 — lib/screens/downloads/controller/download_controller.dart:118-135 | lib/screens/downloads/controller/download_controller.dart:137-154 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/screens/manga/widgets/reader/bottom_controls.dart:78 — lib/screens/manga/widgets/reader/bottom_controls.dart:78-95 | lib/screens/manga/widgets/reader/bottom_controls.dart:118-135 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/widgets/anymex_widgets/anymex_icon_wrapper.dart:10 — lib/widgets/anymex_widgets/anymex_icon_wrapper.dart:10-32 | lib/widgets/anymex_widgets/anymex_icon_wrapper.dart:39-56 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/screens/profile/widgets/favorites_section.dart:172 — lib/screens/profile/widgets/favorites_section.dart:172-189 | lib/screens/profile/widgets/favorites_section.dart:287-310 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/utils/download_isolate_pool.dart:346 — lib/utils/download_isolate_pool.dart:346-364 | lib/widgets/subsampling_scale_image_view/ffi_image_decoder.dart:110-127 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/database/comments/model/commentum_role.dart:25 — lib/database/comments/model/commentum_role.dart:25-42 | lib/widgets/media_items/media_peek_popup.dart:568-587 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/screens/profile/widgets/activity_heatmap.dart:33 — lib/screens/profile/widgets/activity_heatmap.dart:33-50 | lib/screens/stats/user_stats_page.dart:80-97 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×9
  • Duplicated block (18–19 lines × 2) lib/controllers/services/backup_restore/backup_restore_service.dart:1365 — lib/controllers/services/backup_restore/backup_restore_service.dart:1365-1382 | lib/controllers/services/backup_restore/backup_restore_service.dart:1409-1427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/backup_restore_service.dart:1365` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18–19 lines × 2) lib/screens/anime/misc/calendar.dart:989 — lib/screens/anime/misc/calendar.dart:989-1007 | lib/widgets/media_items/media_item.dart:290-307 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/widgets/media_items/media_item.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:989` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:3140 — lib/screens/anime/widgets/comments/comments_section.dart:3140-3157 | lib/screens/anime/widgets/comments/comments_section.dart:3548-3566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:3140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:192 — lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:192-210 | lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:242-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:222 — lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:222-240 | lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:284-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18–19 lines × 2) lib/screens/library/widgets/unified_history_card.dart:66 — lib/screens/library/widgets/unified_history_card.dart:66-84 | lib/screens/library/widgets/unified_history_card.dart:337-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) lib/screens/profile/profile_page.dart:264 — lib/screens/profile/profile_page.dart:264-282 | lib/screens/profile/user_profile_page.dart:364-381 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:264` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18–19 lines × 2) lib/screens/settings/misc/sauce_finder_view.dart:253 — lib/screens/settings/misc/sauce_finder_view.dart:253-271 | lib/screens/settings/misc/sauce_finder_view.dart:461-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/misc/sauce_finder_view.dart:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) lib/screens/anime/misc/calendar.dart:91 — lib/screens/anime/misc/calendar.dart:91-108 | lib/screens/anime/misc/calendar.dart:111-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×9
  • Duplicated block (13 lines × 3) lib/controllers/watchium/watchium_sync_controller.dart:324 — lib/controllers/watchium/watchium_sync_controller.dart:324-336 | lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:635-647 | lib/widgets/watchium/watchium_create_dialog.dart:557-569 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/watchium/watchium_sync_controller.dart:324` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/screens/anime/widgets/comments/comments_section.dart:2423 — lib/screens/anime/widgets/comments/comments_section.dart:2423-2435 | lib/screens/anime/widgets/comments/comments_section.dart:2506-2518 | lib/screens/anime/widgets/comments/comments_section.dart:2638-2650 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2423` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/screens/anime/widgets/video_slider.dart:154 — lib/screens/anime/widgets/video_slider.dart:154-166 | lib/screens/anime/widgets/video_slider.dart:178-190 | lib/screens/anime/widgets/video_slider.dart:199-211 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/video_slider.dart:154` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 3) lib/screens/local_source/local_source_view.dart:407 — lib/screens/local_source/local_source_view.dart:407-419 | lib/screens/local_source/local_source_view.dart:431-443 | lib/screens/local_source/local_source_view.dart:796-808 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:407` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:199 — lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:199-211 | lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:251-263 | lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:304-316 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/screens/profile/activity_details_page.dart:543 — lib/screens/profile/activity_details_page.dart:543-555 | lib/widgets/non_widgets/activity_card.dart:167-179 | lib/widgets/non_widgets/activity_card.dart:291-303 — before extracting anything, compare `lib/screens/profile/activity_details_page.dart` and `lib/widgets/non_widgets/activity_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 190 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/activity_details_page.dart:543` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/screens/settings/sub_settings/player/settings_player_controls.dart:284 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:284-296 | lib/screens/settings/sub_settings/player/settings_player_controls.dart:438-450 | lib/screens/settings/sub_settings/settings_reader.dart:432-444 — before extracting anything, compare `lib/screens/settings/sub_settings/player/settings_player_controls.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_controls.dart:284` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/screens/settings/sub_settings/settings_moderation.dart:548 — lib/screens/settings/sub_settings/settings_moderation.dart:548-560 | lib/widgets/non_widgets/recommend_sheet.dart:1097-1109 | lib/widgets/non_widgets/recommend_sheet.dart:1176-1188 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_moderation.dart:548` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/widgets/common/navbar/styles/classic_navbar.dart:165 — lib/widgets/common/navbar/styles/classic_navbar.dart:165-177 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:144-156 | lib/widgets/header/header.dart:1056-1068 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:165` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/widgets/header/header.dart:1069` calls `symmetric` and `lib/widgets/common/navbar/styles/classic_navbar.dart:178` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×9
  • Swallowed exception (caught, then discarded) lib/widgets/subsampling_scale_image_view/ffi_image_decoder.dart:476 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/non_widgets/reasons_sheet.dart:830 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/media_items/media_peek_popup.dart:410 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/common/baked_blur_image.dart:107 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/common/baked_blur_image.dart:177 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/common/baked_blur_image.dart:283 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/common/baked_blur_image.dart:341 — `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/common/cloudflare_webview.dart:119 — `catch (_)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/widgets/anymex_widgets/anymex_animated_logo.dart:77 — `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×8
  • Edited copy of a member (26 corresponding lines) lib/controllers/services/mal/mal_api.dart:27 — lib/controllers/services/mal/mal_api.dart:27-52 | lib/controllers/services/mal/mal_service.dart:869-898 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) package_manager.dart:293 — package_manager.dart:293-319 | package_manager.dart:321-346 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/screens/anime/watch/controls/widgets/source_popup.dart:106 — lib/screens/anime/watch/controls/widgets/source_popup.dart:106-131 | lib/screens/anime/watch/controls/widgets/source_popup.dart:133-161 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/screens/profile/activity_details_page.dart:112 — lib/screens/profile/activity_details_page.dart:112-137 | lib/widgets/non_widgets/activity_card.dart:119-148 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/screens/manga/widgets/reader/reader_chapter_transition.dart:225 — lib/screens/manga/widgets/reader/reader_chapter_transition.dart:225-250 | lib/screens/manga/widgets/reader/reader_chapter_transition.dart:252-277 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/screens/anime/watch/controls/widgets/source_popup.dart:79 — lib/screens/anime/watch/controls/widgets/source_popup.dart:79-104 | lib/screens/anime/watch/controls/widgets/tracks_popup.dart:141-172 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/screens/novel/reader/widgets/bottom_controls.dart:413 — lib/screens/novel/reader/widgets/bottom_controls.dart:413-441 | lib/screens/novel/reader/widgets/bottom_controls.dart:443-468 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/screens/settings/sub_settings/card_customizer_page.dart:109 — lib/screens/settings/sub_settings/card_customizer_page.dart:109-138 | lib/screens/settings/sub_settings/settings_ui_components.dart:165-190 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×8
  • Edited copy of a member (19 corresponding lines) lib/controllers/services/anilist/anilist_auth.dart:2717 — lib/controllers/services/anilist/anilist_auth.dart:2717-2735 | lib/controllers/services/mal/mal_service.dart:1067-1086 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/controllers/services/storage/storage_manager_service.dart:50 — lib/controllers/services/storage/storage_manager_service.dart:50-68 | lib/controllers/services/storage/storage_manager_service.dart:99-117 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/utils/compatibility/matchmaker.dart:766 — lib/utils/compatibility/matchmaker.dart:766-784 | lib/utils/compatibility/matchmaker.dart:786-804 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/screens/settings/sub_settings/player/settings_player_engine.dart:281 — lib/screens/settings/sub_settings/player/settings_player_engine.dart:281-299 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:301-319 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/screens/profile/compatibility/compatibility_result_page.dart:1029 — lib/screens/profile/compatibility/compatibility_result_page.dart:1029-1047 | lib/screens/profile/compatibility/compatibility_result_page.dart:1049-1067 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/screens/profile/compatibility/compatibility_result_page.dart:1563 — lib/screens/profile/compatibility/compatibility_result_page.dart:1563-1581 | lib/screens/profile/compatibility/compatibility_result_page.dart:1583-1601 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/screens/profile/profile_page.dart:552 — lib/screens/profile/profile_page.dart:552-573 | lib/screens/profile/user_profile_page.dart:618-636 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/screens/downloads/download_screen.dart:1662 — lib/screens/downloads/download_screen.dart:1662-1680 | lib/screens/settings/sub_settings/settings_addons.dart:505-523 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×8
  • Edited copy of a member (12 corresponding lines) lib/utils/compatibility/matchmaker.dart:806 — lib/utils/compatibility/matchmaker.dart:806-819 | lib/utils/compatibility/matchmaker.dart:849-860 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/database/kv_helper.dart:115 — lib/database/kv_helper.dart:115-126 | lib/database/kv_helper.dart:128-139 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/database/kv_helper.dart:141 — lib/database/kv_helper.dart:141-152 | lib/database/kv_helper.dart:154-166 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/database/comments/comments_db.dart:264 — lib/database/comments/comments_db.dart:264-275 | lib/database/comments/comments_db.dart:399-410 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/controllers/services/mal/mal_api.dart:124 — lib/controllers/services/mal/mal_api.dart:124-135 | lib/controllers/services/mal/mal_service.dart:620-634 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/controllers/service_handler/service_handler.dart:29 — lib/controllers/service_handler/service_handler.dart:29-40 | lib/controllers/service_handler/service_handler.dart:42-53 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/screens/settings/sub_settings/settings_donation.dart:36 — lib/screens/settings/sub_settings/settings_donation.dart:36-47 | lib/widgets/dialogs/donation_dialog.dart:28-43 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/utils/media_share.dart:202 — lib/utils/media_share.dart:202-214 | lib/utils/media_share.dart:216-227 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×8
  • Edited copy of a member (9 corresponding lines) lib/controllers/discord/discord_rpc.dart:1042 — lib/controllers/discord/discord_rpc.dart:1042-1052 | lib/services/cast/widgets/cast_device_dialog.dart:368-376 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/controllers/watchium/watchium_models.dart:284 — lib/controllers/watchium/watchium_models.dart:284-293 | lib/controllers/watchium/watchium_models.dart:311-319 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/screens/novel/reader/controller/reader_controller.dart:1052 — lib/screens/novel/reader/controller/reader_controller.dart:1052-1060 | lib/screens/novel/reader/controller/reader_controller.dart:1062-1070 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/screens/search/search_view.dart:189 — lib/screens/search/search_view.dart:189-197 | lib/screens/search/widgets/inline_search_history.dart:36-44 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/screens/anime/widgets/comments/comments_section.dart:979 — lib/screens/anime/widgets/comments/comments_section.dart:979-987 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:113-125 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/screens/settings/sub_settings/settings_accounts.dart:78 — lib/screens/settings/sub_settings/settings_accounts.dart:78-90 | lib/screens/settings/sub_settings/settings_discord.dart:406-414 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/screens/anime/widgets/custom_list_dialog.dart:37 — lib/screens/anime/widgets/custom_list_dialog.dart:37-46 | lib/screens/library/editor/list_editor.dart:758-766 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/screens/manga/controller/reader_controller.dart:1717 — lib/screens/manga/controller/reader_controller.dart:1717-1725 | lib/screens/novel/reader/controller/reader_controller.dart:1243-1251 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×8
  • Edited copy of a member (8 corresponding lines) lib/screens/library/editor/history_editor.dart:176 — lib/screens/library/editor/history_editor.dart:176-189 | lib/widgets/watchium/watchium_party_popup.dart:1246-1253 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/utils/media_downloader.dart:315 — lib/utils/media_downloader.dart:315-322 | lib/utils/media_downloader.dart:324-331 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/controllers/watchium/watchium_models.dart:67 — lib/controllers/watchium/watchium_models.dart:67-77 | lib/database/isar_models/video.dart:91-98 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/services/fcm_service.dart:106 — lib/services/fcm_service.dart:106-113 | lib/utils/notification.dart:321-329 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/controllers/custom_logo/custom_logo_service.dart:70 — lib/controllers/custom_logo/custom_logo_service.dart:70-77 | lib/controllers/custom_logo/custom_logo_service.dart:79-86 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/screens/stats/controller/user_stats_controller.dart:251 — lib/screens/stats/controller/user_stats_controller.dart:251-258 | lib/screens/stats/controller/user_stats_controller.dart:260-267 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/models/Anilist/anilist_activity.dart:28 — lib/models/Anilist/anilist_activity.dart:28-36 | lib/models/Anilist/social_user.dart:14-21 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/screens/anime/misc/list_exporter.dart:240 — lib/screens/anime/misc/list_exporter.dart:240-248 | lib/services/cast/cast_service.dart:515-522 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×8
  • Duplicated block (30 lines × 2) lib/controllers/discord/discord_rpc.dart:729 — lib/controllers/discord/discord_rpc.dart:729-758 | lib/controllers/discord/discord_rpc.dart:858-887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:729` 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 (30 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1183 — lib/screens/anime/widgets/episode_list_builder.dart:1183-1212 | lib/screens/manga/widgets/chapter_list_builder.dart:1302-1331 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (30 lines × 2) lib/screens/manga/widgets/reader/continuous_reader.dart:390 — lib/screens/manga/widgets/reader/continuous_reader.dart:390-419 | lib/screens/manga/widgets/reader/reader_view.dart:335-364 — before extracting anything, compare `lib/screens/manga/widgets/reader/continuous_reader.dart` and `lib/screens/manga/widgets/reader/reader_view.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/continuous_reader.dart:390` 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 (30 lines × 2) lib/screens/profile/profile_page.dart:64 — lib/screens/profile/profile_page.dart:64-93 | lib/screens/profile/user_profile_page.dart:78-107 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 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 (30 lines × 2) lib/screens/profile/widgets/profile_header.dart:627 — lib/screens/profile/widgets/profile_header.dart:627-656 | lib/screens/profile/widgets/user_profile_app_bar.dart:76-105 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:627` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (30 lines × 2) lib/screens/settings/sub_settings/settings_comments.dart:359 — lib/screens/settings/sub_settings/settings_comments.dart:359-388 | lib/screens/settings/sub_settings/settings_comments.dart:398-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_comments.dart:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/settings/sub_settings/settings_comments.dart:428` calls `_buildBulletPoint` and `lib/screens/settings/sub_settings/settings_comments.dart:389` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (30 lines × 2) lib/widgets/media_items/media_peek_popup.dart:923 — lib/widgets/media_items/media_peek_popup.dart:923-952 | lib/widgets/non_widgets/reasons_sheet.dart:772-801 — before extracting anything, compare `lib/widgets/media_items/media_peek_popup.dart` and `lib/widgets/non_widgets/reasons_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/media_items/media_peek_popup.dart:923` 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 (30 lines × 2) lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:152 — lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:152-181 | lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:302-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:152` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×8
  • Duplicated block (8 lines × 3) lib/screens/anime/watch/controls/bottom_controls.dart:66 — lib/screens/anime/watch/controls/bottom_controls.dart:66-73 | lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:268-275 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:306-313 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/bottom_controls.dart:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:160 — lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:160-167 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:191-198 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:222-229 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:251 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:251-258 | lib/screens/anime/widgets/comments/comments_section.dart:347-354 | lib/screens/settings/widgets/style_picker_section.dart:121-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (8 lines × 3) lib/screens/profile/widgets/user_media_list_page.dart:530 — lib/screens/profile/widgets/user_media_list_page.dart:530-537 | lib/screens/profile/widgets/user_media_list_page.dart:546-553 | lib/screens/profile/widgets/user_media_list_page.dart:569-576 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) lib/screens/search/widgets/search_widgets.dart:1111 — lib/screens/search/widgets/search_widgets.dart:1111-1118 | lib/screens/search/widgets/search_widgets.dart:1130-1137 | lib/screens/search/widgets/search_widgets.dart:1147-1154 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) lib/widgets/common/anymex_scaffold.dart:373 — lib/widgets/common/anymex_scaffold.dart:373-380 | lib/widgets/common/anymex_scaffold.dart:386-393 | lib/widgets/common/anymex_scaffold.dart:399-406 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/anymex_scaffold.dart:373` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) lib/screens/stats/user_stats_page.dart:137 — lib/screens/stats/user_stats_page.dart:137-144 | lib/screens/stats/user_stats_page.dart:153-160 | lib/screens/stats/user_stats_page.dart:168-175 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/stats/user_stats_page.dart:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/stats/user_stats_page.dart:153` calls `toList` and `lib/screens/stats/user_stats_page.dart:168` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) lib/widgets/non_widgets/recommend_sheet.dart:728 — lib/widgets/non_widgets/recommend_sheet.dart:728-735 | lib/widgets/non_widgets/recommend_sheet.dart:740-747 | lib/widgets/non_widgets/recommend_sheet.dart:927-934 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×7
  • Edited copy of a member (25 corresponding lines) lib/widgets/common/baked_blur_image.dart:183 — lib/widgets/common/baked_blur_image.dart:183-207 | lib/widgets/common/baked_blur_image.dart:209-235 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:2091 — lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:2091-2117 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:2138-2162 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/controllers/watchium/watchium_service.dart:73 — lib/controllers/watchium/watchium_service.dart:73-103 | lib/widgets/watchium/watchium_party_popup.dart:247-271 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:582 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:582-606 | lib/widgets/header/header.dart:234-261 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/screens/manga/controller/reader_controller.dart:540 — lib/screens/manga/controller/reader_controller.dart:540-564 | lib/screens/manga/controller/reader_controller.dart:566-590 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/screens/downloads/widgets/downloaded_media_view.dart:117 — lib/screens/downloads/widgets/downloaded_media_view.dart:117-142 | lib/screens/downloads/widgets/downloaded_media_view.dart:144-168 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/screens/settings/misc/sauce_finder_view.dart:198 — lib/screens/settings/misc/sauce_finder_view.dart:198-222 | lib/screens/settings/misc/sauce_finder_view.dart:421-445 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×7
  • Edited copy of a member (20 corresponding lines) lib/controllers/services/simkl/simkl_service.dart:1069 — lib/controllers/services/simkl/simkl_service.dart:1069-1089 | lib/controllers/services/simkl/simkl_service.dart:1091-1110 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/screens/anime/widgets/episode_range.dart:23 — lib/screens/anime/widgets/episode_range.dart:23-42 | lib/screens/manga/widgets/chapter_ranges.dart:18-40 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/widgets/animation/staggered_animations.dart:31 — lib/widgets/animation/staggered_animations.dart:31-50 | lib/widgets/animation/staggered_animations.dart:98-118 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/screens/manga/widgets/reader/continuous_reader.dart:431 — lib/screens/manga/widgets/reader/continuous_reader.dart:431-450 | lib/screens/manga/widgets/reader/reader_view.dart:373-397 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/screens/settings/sub_settings/settings_performance.dart:52 — lib/screens/settings/sub_settings/settings_performance.dart:52-75 | lib/screens/settings/sub_settings/settings_performance.dart:77-96 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/screens/profile/profile_page.dart:182 — lib/screens/profile/profile_page.dart:182-202 | lib/screens/profile/user_profile_page.dart:276-295 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:613 — lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:613-640 | lib/screens/notifications/announcement_sheet.dart:289-308 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×7
  • Duplicated block (29 lines × 2) lib/screens/downloads/download_screen.dart:880 — lib/screens/downloads/download_screen.dart:880-908 | lib/screens/downloads/download_screen.dart:1221-1249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:880` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) lib/screens/library/editor/list_editor.dart:622 — lib/screens/library/editor/list_editor.dart:622-650 | lib/screens/library/editor/list_editor.dart:686-714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/list_editor.dart:622` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) lib/screens/profile/profile_page.dart:344 — lib/screens/profile/profile_page.dart:344-372 | lib/screens/profile/user_profile_page.dart:420-448 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:344` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (29 lines × 2) lib/services/commentum_service.dart:650 — lib/services/commentum_service.dart:650-678 | lib/services/commentum_service.dart:697-725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:650` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (29 lines × 2) lib/widgets/common/media_mode_selector.dart:520 — lib/widgets/common/media_mode_selector.dart:520-548 | lib/widgets/common/media_mode_selector.dart:645-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/media_mode_selector.dart:520` 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 (29 lines × 2) lib/widgets/common/navbar/styles/classic_navbar.dart:382 — lib/widgets/common/navbar/styles/classic_navbar.dart:382-410 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:432-460 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:382` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) lib/widgets/non_widgets/recommend_sheet.dart:1103 — lib/widgets/non_widgets/recommend_sheet.dart:1103-1131 | lib/widgets/non_widgets/recommend_sheet.dart:1182-1210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/recommend_sheet.dart:1103` 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 (16 lines × 3) · ×7
  • Duplicated block (16 lines × 3) lib/controllers/services/anilist/anilist_auth.dart:2122 — lib/controllers/services/anilist/anilist_auth.dart:2122-2137 | lib/controllers/services/anilist/anilist_auth.dart:2222-2237 | lib/controllers/services/anilist/anilist_auth.dart:2509-2524 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:2122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) lib/screens/downloads/widgets/downloaded_media_view.dart:603 — lib/screens/downloads/widgets/downloaded_media_view.dart:603-618 | lib/screens/downloads/widgets/downloaded_media_view.dart:1201-1216 | lib/screens/extensions/ExtensionItem.dart:234-249 — before extracting anything, compare `lib/screens/downloads/widgets/downloaded_media_view.dart` and `lib/screens/extensions/ExtensionItem.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:603` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) lib/screens/library/online/anime_list.dart:351 — lib/screens/library/online/anime_list.dart:351-366 | lib/screens/library/online/manga_list.dart:334-349 | lib/screens/profile/widgets/user_media_list_page.dart:316-331 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) lib/screens/library/online/anime_list.dart:400 — lib/screens/library/online/anime_list.dart:400-415 | lib/screens/library/online/manga_list.dart:384-399 | lib/screens/profile/widgets/user_media_list_page.dart:361-376 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:400` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 3) lib/screens/library/online/anime_list.dart:820 — lib/screens/library/online/anime_list.dart:820-835 | lib/screens/library/online/manga_list.dart:805-820 | lib/screens/profile/widgets/user_media_list_page.dart:749-764 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 3) lib/widgets/animation/animations.dart:63 — lib/widgets/animation/animations.dart:63-78 | lib/widgets/animation/animations.dart:162-177 | lib/widgets/animation/animations.dart:476-491 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/animation/animations.dart:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) lib/widgets/anymex_widgets/anymex_tile.dart:198 — lib/widgets/anymex_widgets/anymex_tile.dart:198-213 | lib/widgets/anymex_widgets/anymex_tile.dart:506-521 | lib/widgets/anymex_widgets/anymex_tile.dart:588-603 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_tile.dart:198` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×7
  • Duplicated block (12 lines × 3) lib/models/Media/media.dart:233 — lib/models/Media/media.dart:233-244 | lib/models/Media/media.dart:335-346 | lib/models/Media/media.dart:438-449 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) lib/screens/novel/reader/controller/reader_controller.dart:1087 — lib/screens/novel/reader/controller/reader_controller.dart:1087-1098 | lib/screens/novel/reader/controller/reader_controller.dart:1110-1121 | lib/screens/novel/reader/controller/reader_controller.dart:1129-1140 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) lib/screens/novel/reader/widgets/bottom_controls.dart:153 — lib/screens/novel/reader/widgets/bottom_controls.dart:153-164 | lib/screens/novel/reader/widgets/bottom_controls.dart:234-245 | lib/screens/novel/reader/widgets/bottom_controls.dart:300-311 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) lib/screens/profile/compatibility/compatibility_result_page.dart:882 — lib/screens/profile/compatibility/compatibility_result_page.dart:882-893 | lib/screens/profile/compatibility/compatibility_result_page.dart:951-962 | lib/screens/profile/compatibility/compatibility_result_page.dart:2338-2349 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:882` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 3) lib/screens/settings/sub_settings/settings_backup.dart:360 — lib/screens/settings/sub_settings/settings_backup.dart:360-371 | lib/screens/settings/sub_settings/settings_backup.dart:488-499 | lib/screens/settings/sub_settings/settings_backup.dart:769-780 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_backup.dart:360` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) lib/screens/settings/sub_settings/settings_backup.dart:822 — lib/screens/settings/sub_settings/settings_backup.dart:822-833 | lib/screens/settings/sub_settings/settings_common.dart:39-50 | lib/screens/settings/sub_settings/settings_ui_details.dart:123-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_backup.dart:822` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) lib/screens/settings/sub_settings/settings_theme.dart:744 — lib/screens/settings/sub_settings/settings_theme.dart:744-755 | lib/screens/settings/sub_settings/settings_theme.dart:786-797 | lib/screens/settings/sub_settings/settings_theme.dart:823-834 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_theme.dart:744` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) lib/controllers/source/source_controller.dart:192 — lib/controllers/source/source_controller.dart:192-208 | lib/screens/extensions/ExtensionList.dart:168-185 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) lib/controllers/offline/offline_storage_controller.dart:486 — lib/controllers/offline/offline_storage_controller.dart:486-504 | lib/controllers/offline/offline_storage_controller.dart:506-522 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) lib/screens/downloads/controller/download_controller.dart:287 — lib/screens/downloads/controller/download_controller.dart:287-305 | lib/screens/downloads/controller/download_controller.dart:307-323 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) lib/screens/manga/controller/reader_controller.dart:1844 — lib/screens/manga/controller/reader_controller.dart:1844-1860 | lib/screens/manga/controller/reader_controller.dart:1862-1878 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) lib/screens/anime/watch/controls/widgets/delay_row.dart:122 — lib/screens/anime/watch/controls/widgets/delay_row.dart:122-138 | lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:157-177 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) lib/screens/extensions/widgets/plugin_manager.dart:70 — lib/screens/extensions/widgets/plugin_manager.dart:70-86 | lib/screens/extensions/widgets/plugin_manager.dart:88-105 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×6
  • Edited copy of a member (15 corresponding lines) lib/screens/manga/widgets/reader/top_controls.dart:256 — lib/screens/manga/widgets/reader/top_controls.dart:256-270 | lib/screens/novel/reader/widgets/top_controls.dart:214-228 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/screens/downloads/controller/download_controller.dart:325 — lib/screens/downloads/controller/download_controller.dart:325-339 | lib/screens/downloads/controller/download_controller.dart:341-355 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/screens/downloads/controller/download_controller.dart:696 — lib/screens/downloads/controller/download_controller.dart:696-710 | lib/screens/downloads/controller/download_controller.dart:712-726 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/utils/media_syncer.dart:24 — lib/utils/media_syncer.dart:24-40 | lib/utils/media_syncer.dart:42-56 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:825 — lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:825-841 | lib/widgets/anymex_widgets/anymex_tile.dart:794-808 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/screens/novel/reader/widgets/bottom_controls.dart:323 — lib/screens/novel/reader/widgets/bottom_controls.dart:323-337 | lib/screens/novel/reader/widgets/bottom_controls.dart:397-411 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×6
  • Duplicated block (21–22 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:85 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:85-106 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:154-174 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `tooltip` to `'Player Settings'` in one and `'Settings'` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (21–22 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1415 — lib/screens/anime/widgets/comments/comments_section.dart:1415-1435 | lib/screens/anime/widgets/comments/comments_section.dart:1763-1784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21–22 lines × 2) lib/screens/downloads/widgets/download_server_selector.dart:238 — lib/screens/downloads/widgets/download_server_selector.dart:238-259 | lib/widgets/watchium/watchium_server_sheet.dart:72-92 — before extracting anything, compare `lib/screens/downloads/widgets/download_server_selector.dart` and `lib/widgets/watchium/watchium_server_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/download_server_selector.dart:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (21–22 lines × 2) lib/screens/profile/widgets/profile_header.dart:353 — lib/screens/profile/widgets/profile_header.dart:353-374 | lib/screens/profile/widgets/profile_header.dart:1005-1025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21–22 lines × 2) lib/screens/settings/sub_settings/contributors/contributors.dart:672 — lib/screens/settings/sub_settings/contributors/contributors.dart:672-692 | lib/screens/settings/sub_settings/contributors/contributors.dart:820-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/contributors/contributors.dart:672` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21–22 lines × 2) lib/widgets/anymex_widgets/anymex_animated_logo.dart:269 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:269-289 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:308-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_animated_logo.dart:269` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×6
  • Duplicated block (17–18 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:329 — lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:329-346 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:359-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:329` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:347` calls `SizedBox`, `_buildBottomSection` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:376` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17–18 lines × 2) lib/screens/extensions/ExtensionScreen.dart:98 — lib/screens/extensions/ExtensionScreen.dart:98-115 | lib/screens/extensions/ExtensionScreen.dart:191-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/extensions/ExtensionScreen.dart:191` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:879 — lib/screens/profile/compatibility/compatibility_result_page.dart:879-895 | lib/screens/profile/compatibility/compatibility_result_page.dart:947-964 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:879` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17–18 lines × 2) lib/screens/search/widgets/search_widgets.dart:755 — lib/screens/search/widgets/search_widgets.dart:755-771 | lib/screens/search/widgets/search_widgets.dart:2215-2232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/search_widgets.dart:755` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) lib/services/commentum_service.dart:762 — lib/services/commentum_service.dart:762-778 | lib/services/commentum_service.dart:1514-1531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:762` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17–18 lines × 2) lib/widgets/header/header.dart:118 — lib/widgets/header/header.dart:118-135 | lib/widgets/header/header.dart:202-218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/header/header.dart:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×6
  • Duplicated block (11–12 lines × 2) lib/controllers/services/mal/mal_api.dart:42 — lib/controllers/services/mal/mal_api.dart:42-52 | lib/controllers/services/mal/mal_service.dart:887-898 — before extracting anything, compare `lib/controllers/services/mal/mal_api.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_api.dart:42` 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–12 lines × 2) lib/screens/library/editor/history_editor.dart:192 — lib/screens/library/editor/history_editor.dart:192-203 | lib/screens/library/editor/history_editor.dart:480-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/history_editor.dart:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) lib/screens/manga/controller/reader_controller.dart:282 — lib/screens/manga/controller/reader_controller.dart:282-292 | lib/screens/manga/controller/reader_controller.dart:1944-1955 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) lib/screens/profile/profile_page.dart:95 — lib/screens/profile/profile_page.dart:95-105 | lib/screens/profile/user_profile_page.dart:109-120 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) lib/widgets/common/cards/styles/minimal_exotic_card.dart:88 — lib/widgets/common/cards/styles/minimal_exotic_card.dart:88-99 | lib/widgets/common/cards/styles/modern_card.dart:63-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/cards/styles/minimal_exotic_card.dart:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/widgets/common/cards/styles/minimal_exotic_card.dart:101` calls `buildCardBadgeV2` and `lib/widgets/common/cards/styles/modern_card.dart:74` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–12 lines × 2) lib/widgets/non_widgets/reasons_sheet.dart:672 — lib/widgets/non_widgets/reasons_sheet.dart:672-682 | lib/widgets/non_widgets/recommend_sheet.dart:986-997 — before extracting anything, compare `lib/widgets/non_widgets/reasons_sheet.dart` and `lib/widgets/non_widgets/recommend_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/reasons_sheet.dart:672` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/widgets/non_widgets/recommend_sheet.dart:998` calls `TextStyle` and `lib/widgets/non_widgets/reasons_sheet.dart:683` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×6
  • Duplicated block (10 lines × 3) lib/controllers/services/widgets/widgets_builders.dart:373 — lib/controllers/services/widgets/widgets_builders.dart:373-382 | lib/screens/community/community_recommendations_page.dart:412-421 | lib/screens/community/community_recommendations_page.dart:862-871 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/widgets/widgets_builders.dart:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) lib/screens/anime/studio_details_page.dart:361 — lib/screens/anime/studio_details_page.dart:361-370 | lib/screens/anime/widgets/character_staff_sheet.dart:906-918 | lib/screens/anime/widgets/character_staff_sheet.dart:941-953 — before extracting anything, compare `lib/screens/anime/studio_details_page.dart` and `lib/screens/anime/widgets/character_staff_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/studio_details_page.dart:361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 3) lib/screens/downloads/widgets/download_server_selector.dart:238 — lib/screens/downloads/widgets/download_server_selector.dart:238-247 | lib/widgets/watchium/watchium_create_dialog.dart:82-91 | lib/widgets/watchium/watchium_server_sheet.dart:72-81 — before extracting anything, compare `lib/screens/downloads/widgets/download_server_selector.dart` and `lib/widgets/watchium/watchium_server_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/download_server_selector.dart:238` 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 × 3) lib/screens/library/editor/history_editor.dart:321 — lib/screens/library/editor/history_editor.dart:321-330 | lib/screens/library/editor/history_editor.dart:421-430 | lib/screens/library/editor/history_editor.dart:819-828 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/history_editor.dart:321` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) lib/screens/manga/widgets/reader/color_filter_settings_page.dart:82 — lib/screens/manga/widgets/reader/color_filter_settings_page.dart:82-91 | lib/screens/manga/widgets/reader/color_filter_settings_page.dart:96-105 | lib/screens/manga/widgets/reader/color_filter_settings_page.dart:124-134 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/color_filter_settings_page.dart:82` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 3) lib/screens/anime/widgets/anime_stats.dart:931 — lib/screens/anime/widgets/anime_stats.dart:931-940 | lib/screens/manga/widgets/manga_stats.dart:841-850 | lib/screens/novel/details/widgets/novel_stats.dart:235-244 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×5
  • Repeated repair: lib/screens/anime/watch/watch_view.dart lib/screens/anime/watch/watch_view.dart:83 — lib/screens/anime/watch/watch_view.dart changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is _WatchScreenState.initState at line 83), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: fixed broken media color”; “fix(player): prevent keyboard focus traversal and grey tint overlay”; “fix: fixed torrent broken on mobile”; “fix: watchium comeback (#582)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/watch/watch_view.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/database/database.dart lib/database/database.dart:43 — lib/database/database.dart changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is Database.init at line 43), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: fixed login crash, torrserver issues”; “fix: ui changes and fixes”; “fix(macos): keep the database out of iCloud-synced Documents (#554)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/database/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.
  • Repeated repair: lib/screens/manga/widgets/chapter_section.dart lib/screens/manga/widgets/chapter_section.dart:115 — lib/screens/manga/widgets/chapter_section.dart changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ChapterSection._buildChapterListSliver at line 115), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: proper error handler on anime and manga pages”; “fix: synced scanlator with continue chapter button”; “fix: fixed manga chapter selector and chapter navigation logic”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/manga/widgets/chapter_section.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: lib/screens/anime/widgets/comments/controller/comments_controller.dart lib/screens/anime/widgets/comments/controller/comments_controller.dart:467 — lib/screens/anime/widgets/comments/controller/comments_controller.dart changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is CommentSectionController.formatCommentTimestamp at line 467), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: fixed inaccurate liquid background preview & useless commentum calls”; “fix: fixed comments showing input for non logged in user, bad lifecycle causing grey screens”; “fix: comments fixes and perf changes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/screens/anime/widgets/comments/controller/comments_controller.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/database/isar_models/episode.dart lib/database/isar_models/episode.dart:103 — lib/database/isar_models/episode.dart changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is Episode.clone at line 103), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: fixed bad logic for episode watch detection”; “fix: fixed season wise bindings for proper tracking across seasons”; “fix: fixed episode comparison logic to include season in the picture”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:46:33 +05:30' --until='2026-11-17 22:46:33 +05:30' --full-history --no-merges -- lib/database/isar_models/episode.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.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×5
  • Edited copy of a member (33 corresponding lines) lib/controllers/services/anilist/anilist_data.dart:367 — lib/controllers/services/anilist/anilist_data.dart:367-428 | lib/controllers/services/anilist/anilist_data.dart:623-870 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) lib/screens/manga/controller/reader_controller.dart:1614 — lib/screens/manga/controller/reader_controller.dart:1614-1646 | lib/screens/novel/reader/controller/reader_controller.dart:713-745 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:654 — lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:654-686 | lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:696-734 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) lib/controllers/sync/gist_sync_controller.dart:383 — lib/controllers/sync/gist_sync_controller.dart:383-421 | lib/controllers/sync/gist_sync_controller.dart:423-455 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) lib/widgets/animation/animations.dart:456 — lib/widgets/animation/animations.dart:456-491 | lib/widgets/animation/animations.dart:570-602 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×5
  • Edited copy of a member (22 corresponding lines) lib/controllers/services/anilist/anilist_data.dart:367 — lib/controllers/services/anilist/anilist_data.dart:367-428 | lib/controllers/services/anilist/anilist_data.dart:444-621 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/utils/compatibility/matchmaker.dart:538 — lib/utils/compatibility/matchmaker.dart:538-559 | lib/utils/compatibility/matchmaker.dart:561-582 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:539 — lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:539-560 | lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:562-587 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/screens/downloads/widgets/download_server_selector.dart:37 — lib/screens/downloads/widgets/download_server_selector.dart:37-59 | lib/screens/downloads/widgets/manga_chapter_download_confirm.dart:31-52 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/widgets/non_widgets/recommend_button.dart:25 — lib/widgets/non_widgets/recommend_button.dart:25-46 | lib/widgets/non_widgets/recommend_sheet.dart:25-47 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (5 members, 50+ identical tokens) lib/controllers/discord/discord_rpc.dart:538 — lib/controllers/discord/discord_rpc.dart:538-687 | lib/controllers/discord/discord_rpc.dart:689-792 | lib/controllers/discord/discord_rpc.dart:794-921 | lib/controllers/discord/discord_rpc.dart:923-1040 | lib/controllers/discord/discord_rpc.dart:1054-1136 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) lib/screens/anime/details/media_details_page.dart:266 — lib/screens/anime/details/media_details_page.dart:266-575 | lib/screens/profile/profile_page.dart:240-550 | lib/screens/profile/user_profile_page.dart:333-616 | lib/screens/settings/sub_settings/settings_ui_details.dart:354-742 | lib/widgets/anime/media_header.dart:46-501 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) lib/screens/library/editor/history_editor.dart:261 — lib/screens/library/editor/history_editor.dart:261-359 | lib/screens/library/editor/history_editor.dart:361-459 | lib/screens/library/editor/history_editor.dart:795-884 | lib/screens/library/editor/list_editor.dart:165-320 | lib/screens/library/editor/list_editor.dart:322-383 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) lib/screens/local_source/local_source_view.dart:492 — lib/screens/local_source/local_source_view.dart:492-575 | lib/screens/local_source/local_source_view.dart:577-643 | lib/screens/local_source/local_source_view.dart:645-711 | lib/screens/local_source/local_source_view.dart:713-768 | lib/screens/local_source/local_source_view.dart:1131-1259 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) lib/services/commentum_service.dart:388 — lib/services/commentum_service.dart:388-454 | lib/services/commentum_service.dart:509-555 | lib/services/commentum_service.dart:596-647 | lib/services/commentum_service.dart:862-905 | lib/services/commentum_service.dart:952-1011 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×5
  • Edited copy of a member (24 corresponding lines) lib/models/Anilist/anilist_profile.dart:336 — lib/models/Anilist/anilist_profile.dart:336-362 | lib/models/Anilist/anilist_profile.dart:408-431 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) lib/screens/anime/watch/controls/widgets/speed_popup.dart:403 — lib/screens/anime/watch/controls/widgets/speed_popup.dart:403-426 | lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:227-251 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) lib/screens/anime/misc/list_exporter.dart:30 — lib/screens/anime/misc/list_exporter.dart:30-53 | lib/screens/anime/misc/list_exporter.dart:55-80 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) lib/screens/downloads/download_screen.dart:714 — lib/screens/downloads/download_screen.dart:714-741 | lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:146-169 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) lib/screens/extensions/ExtensionTesting/extension_test_item.dart:370 — lib/screens/extensions/ExtensionTesting/extension_test_item.dart:370-393 | lib/screens/extensions/ExtensionTesting/extension_test_page.dart:391-414 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×5
  • Edited copy of a member (42 corresponding lines) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:105 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:105-146 | lib/screens/settings/sub_settings/settings_reader.dart:282-328 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) lib/widgets/common/cards/styles/exotic_card.dart:123 — lib/widgets/common/cards/styles/exotic_card.dart:123-164 | lib/widgets/common/cards/styles/minimal_exotic_card.dart:128-174 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) lib/screens/manga/widgets/manga_stats.dart:336 — lib/screens/manga/widgets/manga_stats.dart:336-384 | lib/screens/profile/widgets/profile_stats_tab.dart:409-450 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) lib/screens/downloads/download_screen.dart:302 — lib/screens/downloads/download_screen.dart:302-347 | lib/screens/downloads/download_screen.dart:349-390 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) lib/screens/anime/widgets/episode_section.dart:119 — lib/screens/anime/widgets/episode_section.dart:119-160 | lib/screens/manga/widgets/chapter_section.dart:61-113 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×5
  • Edited copy of a member (47 corresponding lines) lib/screens/search/widgets/extension_filter_sheet.dart:271 — lib/screens/search/widgets/extension_filter_sheet.dart:271-328 | lib/screens/search/widgets/extension_filter_sheet.dart:766-812 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) lib/widgets/common/navbar/styles/classic_navbar.dart:382 — lib/widgets/common/navbar/styles/classic_navbar.dart:382-430 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:432-478 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) lib/screens/anime/misc/calendar.dart:536 — lib/screens/anime/misc/calendar.dart:536-586 | lib/screens/search/search_view.dart:1360-1406 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) lib/screens/library/editor/list_editor.dart:620 — lib/screens/library/editor/list_editor.dart:620-666 | lib/screens/library/editor/list_editor.dart:684-732 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) lib/widgets/animation/animations.dart:32 — lib/widgets/animation/animations.dart:32-78 | lib/widgets/animation/animations.dart:131-177 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×5
  • Edited copy of a member (32 corresponding lines) lib/screens/local_source/controller/local_source_controller.dart:351 — lib/screens/local_source/controller/local_source_controller.dart:351-382 | lib/screens/local_source/controller/local_source_controller.dart:384-415 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) lib/widgets/anymex_widgets/anymex_animated_logo.dart:258 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:258-289 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:292-329 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) lib/screens/anime/widgets/comments/comments_section.dart:2811 — lib/screens/anime/widgets/comments/comments_section.dart:2811-2844 | lib/screens/settings/sub_settings/settings_moderation.dart:2223-2254 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) lib/screens/extensions/ExtensionTesting/extension_test_page.dart:122 — lib/screens/extensions/ExtensionTesting/extension_test_page.dart:122-156 | lib/screens/extensions/ExtensionTesting/extension_test_page.dart:191-222 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) lib/screens/extensions/ExtensionTesting/extension_test_page.dart:74 — lib/screens/extensions/ExtensionTesting/extension_test_page.dart:74-120 | lib/screens/extensions/ExtensionTesting/extension_test_page.dart:158-189 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×5
  • Edited copy of a member (28 corresponding lines) lib/screens/anime/widgets/comments/comments_section.dart:626 — lib/screens/anime/widgets/comments/comments_section.dart:626-653 | lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:46-78 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart:1995 — lib/screens/anime/widgets/episode_list_builder.dart:1995-2022 | lib/screens/anime/widgets/episode_watch_screen.dart:274-304 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) lib/screens/anime/misc/calendar.dart:865 — lib/screens/anime/misc/calendar.dart:865-892 | lib/widgets/common/cards/card_components.dart:257-291 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) lib/screens/settings/sub_settings/settings_extension_manager.dart:156 — lib/screens/settings/sub_settings/settings_extension_manager.dart:156-183 | lib/screens/settings/sub_settings/settings_extension_manager.dart:302-333 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) lib/screens/notifications/notification_controller.dart:248 — lib/screens/notifications/notification_controller.dart:248-275 | lib/screens/notifications/notification_controller.dart:277-304 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×5
  • Edited copy of a member (16 corresponding lines) lib/controllers/services/mal/mal_api.dart:137 — lib/controllers/services/mal/mal_api.dart:137-152 | lib/controllers/services/mal/mal_api.dart:154-174 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) lib/controllers/services/mal/mal_api.dart:176 — lib/controllers/services/mal/mal_api.dart:176-193 | lib/controllers/services/mal/mal_api.dart:195-210 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) lib/controllers/sync/progress_sync_section.dart:808 — lib/controllers/sync/progress_sync_section.dart:808-823 | lib/widgets/common/source_selector.dart:331-349 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) lib/screens/notifications/notification_controller.dart:223 — lib/screens/notifications/notification_controller.dart:223-240 | lib/services/anilist_notification_service.dart:19-34 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) lib/models/Anilist/anilist_media_user.dart:414 — lib/models/Anilist/anilist_media_user.dart:414-429 | lib/widgets/common/content_error_widget.dart:22-37 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×5
  • Edited copy of a member (11 corresponding lines) lib/controllers/services/mal/mal_service.dart:560 — lib/controllers/services/mal/mal_service.dart:560-570 | lib/controllers/services/mal/mal_service.dart:572-582 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:371 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:371-381 | lib/widgets/watchium/watchium_create_dialog.dart:205-215 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/utils/notification.dart:481 — lib/utils/notification.dart:481-491 | lib/utils/notification.dart:493-506 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/controllers/services/anilist/anilist_data.dart:324 — lib/controllers/services/anilist/anilist_data.dart:324-334 | lib/controllers/services/mal/mal_service.dart:185-195 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/screens/search/widgets/search_filter_selector.dart:61 — lib/screens/search/widgets/search_filter_selector.dart:61-71 | lib/widgets/common/navbar.dart:117-127 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×5
  • Duplicated block (37 lines × 2) lib/screens/anime/widgets/anime_stats.dart:719 — lib/screens/anime/widgets/anime_stats.dart:719-755 | lib/screens/manga/widgets/manga_stats.dart:761-797 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (37 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:791 — lib/screens/anime/widgets/episode_list_builder.dart:791-827 | lib/screens/manga/widgets/chapter_list_builder.dart:317-353 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (37 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:216 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:216-252 | lib/screens/settings/sub_settings/settings_reader.dart:940-976 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:216` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `icon` to `Icons.image_search_rounded` in one and `Iconsax.book_1` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (37 lines × 2) lib/services/commentum_service.dart:558 — lib/services/commentum_service.dart:558-594 | lib/services/commentum_service.dart:1676-1712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (37 lines × 2) lib/widgets/common/navbar/styles/classic_navbar.dart:151 — lib/widgets/common/navbar/styles/classic_navbar.dart:151-187 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:130-166 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×5
  • Duplicated block (28 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:608 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:608-635 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:566-593 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (28 lines × 2) lib/screens/library/widgets/library_deps.dart:43 — lib/screens/library/widgets/library_deps.dart:43-70 | lib/widgets/common/search_bar.dart:59-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (28 lines × 2) lib/utils/lanczos_image.dart:150 — lib/utils/lanczos_image.dart:150-177 | lib/utils/lanczos_image.dart:255-282 — both copies are in the same file, so extract the 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 (28 lines × 2) lib/widgets/media_items/media_peek_popup.dart:221 — lib/widgets/media_items/media_peek_popup.dart:221-248 | lib/widgets/non_widgets/reasons_sheet.dart:169-196 — before extracting anything, compare `lib/widgets/media_items/media_peek_popup.dart` and `lib/widgets/non_widgets/reasons_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/media_items/media_peek_popup.dart:221` 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 (28 lines × 2) lib/screens/extensions/ExtensionTesting/extension_test_page.dart:129 — lib/screens/extensions/ExtensionTesting/extension_test_page.dart:129-156 | lib/screens/extensions/ExtensionTesting/extension_test_page.dart:195-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/extensions/ExtensionTesting/extension_test_page.dart:129` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×5
  • Duplicated block (15 lines × 3) lib/controllers/discord/discord_rpc.dart:607 — lib/controllers/discord/discord_rpc.dart:607-621 | lib/controllers/discord/discord_rpc.dart:723-737 | lib/controllers/discord/discord_rpc.dart:852-866 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:607` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) lib/screens/settings/sub_settings/player/settings_player_controls.dart:1069 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:1069-1083 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:552-566 | lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:342-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_controls.dart:1069` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:357` calls `_buildSubtitlePreviewCard` and `lib/screens/settings/sub_settings/player/settings_player_controls.dart:1084` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 3) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:145 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:145-159 | lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:244-258 | lib/screens/settings/sub_settings/settings_reader.dart:1446-1460 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:259` calls `_buildNovelPreviewCard` and `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:160` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 3) lib/services/commentum_service.dart:651 — lib/services/commentum_service.dart:651-665 | lib/services/commentum_service.dart:698-712 | lib/services/commentum_service.dart:908-922 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:651` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 3) lib/widgets/anymex_widgets/anymex_tile.dart:197 — lib/widgets/anymex_widgets/anymex_tile.dart:197-211 | lib/widgets/anymex_widgets/anymex_tile.dart:367-381 | lib/widgets/anymex_widgets/anymex_tile.dart:439-453 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_tile.dart:197` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/widgets/anymex_widgets/anymex_tile.dart:454` calls `onChanged` and `lib/widgets/anymex_widgets/anymex_tile.dart:212` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×5
  • Duplicated block (12–14 lines × 2) lib/screens/anime/watch/controls/bottom_controls.dart:294 — lib/screens/anime/watch/controls/bottom_controls.dart:294-307 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:499-510 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–14 lines × 2) lib/screens/downloads/widgets/downloaded_media_view.dart:1331 — lib/screens/downloads/widgets/downloaded_media_view.dart:1331-1342 | lib/screens/search/widgets/search_widgets.dart:794-807 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/search_widgets.dart:794` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) lib/screens/manga/widgets/reader/continuous_reader.dart:433 — lib/screens/manga/widgets/reader/continuous_reader.dart:433-444 | lib/screens/manga/widgets/reader/reader_view.dart:378-391 — before extracting anything, compare `lib/screens/manga/widgets/reader/continuous_reader.dart` and `lib/screens/manga/widgets/reader/reader_view.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/continuous_reader.dart:433` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–14 lines × 2) lib/screens/profile/widgets/profile_header.dart:163 — lib/screens/profile/widgets/profile_header.dart:163-176 | lib/screens/profile/widgets/user_profile_header.dart:137-148 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 179 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–14 lines × 2) lib/screens/settings/sub_settings/settings_extensions.dart:349 — lib/screens/settings/sub_settings/settings_extensions.dart:349-360 | lib/widgets/anymex_widgets/anymex_tabbar.dart:94-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_extensions.dart:349` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `children` to `tabs.map((t` in one and `selectTabs.asMap().entries.map((e` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×5
  • Duplicated block (11–12 lines × 3) lib/controllers/services/anilist/anilist_auth.dart:238 — lib/controllers/services/anilist/anilist_auth.dart:238-248 | lib/controllers/services/mal/mal_service.dart:721-731 | lib/controllers/services/simkl/simkl_service.dart:953-964 — `lib/controllers/services/mal/mal_service.dart` and `lib/controllers/services/simkl/simkl_service.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 3) lib/screens/anime/widgets/comments/comments_section.dart:3140 — lib/screens/anime/widgets/comments/comments_section.dart:3140-3150 | lib/screens/anime/widgets/comments/comments_section.dart:3336-3347 | lib/screens/anime/widgets/comments/comments_section.dart:3548-3558 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:3140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 3) lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:137 — lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:137-147 | lib/widgets/anime/visuals/visuals_popup.dart:214-225 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:79-90 — before extracting anything, compare `lib/widgets/anime/visuals/visuals_popup.dart` and `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 3) lib/widgets/common/navbar/styles/classic_navbar.dart:153 — lib/widgets/common/navbar/styles/classic_navbar.dart:153-164 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:132-143 | lib/widgets/header/header.dart:1039-1049 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 3) lib/screens/anime/details/media_details_page.dart:982 — lib/screens/anime/details/media_details_page.dart:982-993 | lib/screens/anime/details/media_details_page.dart:996-1007 | lib/screens/anime/details/media_details_page.dart:1008-1018 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:982` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/details/media_details_page.dart:982` calls `Icon` and `lib/screens/anime/details/media_details_page.dart:1008` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×5
  • Duplicated block (10–11 lines × 2) lib/controllers/services/mal/mal_api.dart:28 — lib/controllers/services/mal/mal_api.dart:28-37 | lib/controllers/services/mal/mal_service.dart:870-880 — before extracting anything, compare `lib/controllers/services/mal/mal_api.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/mal/mal_api.dart:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) lib/controllers/stats/stats_tracker.dart:32 — lib/controllers/stats/stats_tracker.dart:32-41 | lib/controllers/stats/stats_tracker.dart:83-93 — both copies are in the same file, so extract the block into 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) lib/screens/anime/watch/controls/widgets/tracks_popup.dart:222 — lib/screens/anime/watch/controls/widgets/tracks_popup.dart:222-232 | lib/widgets/anymex_widgets/anymex_tile_builder.dart:112-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10–11 lines × 2) lib/screens/notifications/notification_screen.dart:259 — lib/screens/notifications/notification_screen.dart:259-268 | lib/screens/notifications/notification_screen.dart:295-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/notifications/notification_screen.dart:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) lib/widgets/common/cards/styles/simple_card.dart:124 — lib/widgets/common/cards/styles/simple_card.dart:124-134 | lib/widgets/history/tap_history_cards.dart:197-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/cards/styles/simple_card.dart:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) lib/screens/anime/misc/calendar.dart:262 — lib/screens/anime/misc/calendar.dart:262-270 | lib/screens/library/online/anime_list.dart:555-563 | lib/screens/library/online/manga_list.dart:539-547 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/screens/library/online/anime_list.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:262` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:608 — lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:608-616 | lib/screens/anime/watch/controls/widgets/episodes_pane.dart:283-291 | lib/screens/anime/watch/controls/widgets/episodes_pane.dart:319-327 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) lib/screens/anime/widgets/episode_list_builder.dart:1340 — lib/screens/anime/widgets/episode_list_builder.dart:1340-1348 | lib/screens/manga/widgets/chapter_list_builder.dart:1450-1458 | lib/widgets/watchium/watchium_party_popup.dart:552-561 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1340` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 3) lib/screens/downloads/widgets/downloaded_media_view.dart:1124 — lib/screens/downloads/widgets/downloaded_media_view.dart:1124-1132 | lib/screens/manga/controller/reader_controller.dart:283-291 | lib/screens/manga/controller/reader_controller.dart:1945-1953 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) lib/widgets/anymex_widgets/linked_accounts_badges.dart:39 — lib/widgets/anymex_widgets/linked_accounts_badges.dart:39-47 | lib/widgets/anymex_widgets/linked_accounts_badges.dart:50-58 | lib/widgets/anymex_widgets/linked_accounts_badges.dart:61-69 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/linked_accounts_badges.dart:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×5
  • Duplicated block (7 lines × 3) lib/controllers/offline/offline_storage_controller.dart:628 — lib/controllers/offline/offline_storage_controller.dart:628-634 | lib/controllers/offline/offline_storage_controller.dart:694-700 | lib/controllers/offline/offline_storage_controller.dart:759-765 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/offline/offline_storage_controller.dart:628` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/models/Anilist/anilist_media_user.dart:63 — lib/models/Anilist/anilist_media_user.dart:63-69 | lib/models/Anilist/anilist_media_user.dart:74-80 | lib/screens/anime/details/controller/media_details_controller.dart:444-450 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) lib/screens/anime/misc/calendar.dart:343 — lib/screens/anime/misc/calendar.dart:343-349 | lib/screens/library/online/anime_list.dart:587-593 | lib/screens/library/online/manga_list.dart:571-577 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/screens/library/online/anime_list.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:343` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:673 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:673-679 | lib/widgets/watchium/watchium_create_dialog.dart:592-598 | lib/widgets/watchium/watchium_create_dialog.dart:659-665 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:673` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/models/Media/media.dart:1171 — lib/models/Media/media.dart:1171-1177 | lib/models/Media/media.dart:1398-1404 | lib/models/Media/media.dart:1496-1502 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
X2 · Cancellation propagation · Function without a CancelToken · ×5
  • Function without a CancelToken: _downloadAndInstallAndroid lib/utils/updater.dart:418 — `_downloadAndInstallAndroid` calls `dio.download(…)` 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`.
  • Function without a CancelToken: _downloadWindows lib/utils/updater.dart:463 — `_downloadWindows` calls `dio.download(…)` 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`.
  • Function without a CancelToken: _downloadShaders lib/screens/settings/sub_settings/player/settings_player_shaders.dart:85 — `_downloadShaders` calls `dio.download(…)` 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`.
  • Function without a CancelToken: getDetails REDACTED:22 — `getDetails` calls `Dio(…).get(…)` 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`.
  • Function without a CancelToken: urlToDcAsset lib/controllers/discord/discord_rpc.dart:464 — `urlToDcAsset` calls `Dio(…).post(…)` 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`.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×4
  • Edited copy of a member (37 corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart:1110 — lib/screens/anime/widgets/episode_list_builder.dart:1110-1148 | lib/screens/manga/widgets/chapter_list_builder.dart:468-797 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) lib/models/Anilist/anilist_media_user.dart:291 — lib/models/Anilist/anilist_media_user.dart:291-330 | lib/models/Anilist/anilist_media_user.dart:332-368 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) lib/controllers/sync/gist_sync_controller.dart:739 — lib/controllers/sync/gist_sync_controller.dart:739-775 | lib/controllers/sync/gist_sync_controller.dart:777-819 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) lib/screens/downloads/controller/download_controller.dart:156 — lib/screens/downloads/controller/download_controller.dart:156-194 | lib/screens/downloads/controller/download_controller.dart:196-232 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×4
  • Edited copy of a member (38 corresponding lines) lib/screens/settings/sub_settings/settings_comments.dart:358 — lib/screens/settings/sub_settings/settings_comments.dart:358-395 | lib/screens/settings/sub_settings/settings_comments.dart:397-435 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) lib/screens/extensions/widgets/plugin_manager.dart:107 — lib/screens/extensions/widgets/plugin_manager.dart:107-160 | lib/screens/extensions/widgets/plugin_manager.dart:162-199 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) lib/screens/library/online/anime_list.dart:292 — lib/screens/library/online/anime_list.dart:292-329 | lib/screens/profile/widgets/user_media_list_page.dart:237-277 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) lib/services/commentum_service.dart:743 — lib/services/commentum_service.dart:743-789 | lib/services/commentum_service.dart:791-828 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×4
  • Edited copy of a member (44 corresponding lines) lib/screens/community/community_recommendations_page.dart:127 — lib/screens/community/community_recommendations_page.dart:127-174 | lib/widgets/non_widgets/reasons_sheet.dart:153-196 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) lib/controllers/services/simkl/simkl_service.dart:437 — lib/controllers/services/simkl/simkl_service.dart:437-480 | lib/controllers/services/simkl/simkl_service.dart:482-526 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) lib/screens/settings/sub_settings/settings_addons.dart:144 — lib/screens/settings/sub_settings/settings_addons.dart:144-196 | lib/screens/settings/sub_settings/settings_donation.dart:185-228 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) lib/widgets/watchium/watchium_party_settings.dart:95 — lib/widgets/watchium/watchium_party_settings.dart:95-144 | lib/widgets/watchium/watchium_party_settings.dart:146-189 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×4
  • Edited copy of a member (29 corresponding lines) lib/screens/downloads/controller/download_controller.dart:1429 — lib/screens/downloads/controller/download_controller.dart:1429-1457 | lib/screens/downloads/controller/download_controller.dart:2699-2727 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) lib/services/cast/cast_proxy_server.dart:230 — lib/services/cast/cast_proxy_server.dart:230-259 | lib/services/cast/cast_proxy_server.dart:315-343 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) lib/models/Media/media.dart:1067 — lib/models/Media/media.dart:1067-1095 | lib/models/Media/media.dart:1097-1126 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) lib/screens/search/search_view.dart:442 — lib/screens/search/search_view.dart:442-470 | lib/screens/search/search_view.dart:472-500 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) lib/controllers/services/mal/mal_api.dart:76 — lib/controllers/services/mal/mal_api.dart:76-98 | lib/controllers/services/mal/mal_service.dart:407-432 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) lib/screens/anime/themes/anime_theme_dialog.dart:72 — lib/screens/anime/themes/anime_theme_dialog.dart:72-105 | lib/screens/anime/themes/anime_theme_view.dart:76-98 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) lib/screens/downloads/widgets/downloaded_media_view.dart:449 — lib/screens/downloads/widgets/downloaded_media_view.dart:449-471 | lib/screens/downloads/widgets/downloaded_media_view.dart:473-495 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) lib/utils/background_service_handler.dart:197 — lib/utils/background_service_handler.dart:197-219 | lib/utils/background_service_handler.dart:221-243 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×4
  • Edited copy of a member (30 corresponding lines) lib/services/cast/cast_proxy_server.dart:199 — lib/services/cast/cast_proxy_server.dart:199-228 | lib/services/cast/cast_proxy_server.dart:378-412 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart:401 — lib/screens/anime/widgets/episode_list_builder.dart:401-430 | lib/screens/downloads/controller/download_search_controller.dart:316-347 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:158 — lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:158-187 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:189-218 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) lib/screens/anime/widgets/comments/controller/comments_controller.dart:516 — lib/screens/anime/widgets/comments/controller/comments_controller.dart:516-553 | lib/screens/anime/widgets/comments/controller/comments_controller.dart:555-584 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×4
  • Edited copy of a member (14 corresponding lines) lib/controllers/services/backup_restore/backup_restore_service.dart:246 — lib/controllers/services/backup_restore/backup_restore_service.dart:246-259 | lib/controllers/services/backup_restore/backup_restore_service.dart:308-321 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/utils/compatibility/matchmaker.dart:902 — lib/utils/compatibility/matchmaker.dart:902-916 | lib/utils/compatibility/matchmaker.dart:918-931 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:56 — lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:56-71 | lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:73-86 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/screens/local_source/local_source_view.dart:793 — lib/screens/local_source/local_source_view.dart:793-816 | lib/screens/novel/reader/widgets/novel_content.dart:113-126 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×4
  • Edited copy of a member (21 corresponding lines) lib/controllers/sync/gist_sync_controller.dart:831 — lib/controllers/sync/gist_sync_controller.dart:831-852 | lib/controllers/sync/gist_sync_controller.dart:854-874 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) lib/screens/profile/compatibility/compatibility_result_page.dart:1729 — lib/screens/profile/compatibility/compatibility_result_page.dart:1729-1749 | lib/screens/profile/compatibility/compatibility_result_page.dart:2026-2046 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) lib/widgets/dialogs/donation_dialog.dart:127 — lib/widgets/dialogs/donation_dialog.dart:127-151 | lib/widgets/media_items/media_peek_popup.dart:589-609 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) lib/screens/anime/widgets/comments/controller/comments_controller.dart:736 — lib/screens/anime/widgets/comments/controller/comments_controller.dart:736-756 | lib/screens/anime/widgets/comments/controller/comments_controller.dart:813-837 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×4
  • Edited copy of a member (4 corresponding lines) lib/screens/stats/controller/user_stats_controller.dart:96 — lib/screens/stats/controller/user_stats_controller.dart:96-99 | lib/screens/stats/controller/user_stats_controller.dart:101-104 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/screens/anime/widgets/episode/styles/compact_style.dart:46 — lib/screens/anime/widgets/episode/styles/compact_style.dart:46-49 | lib/screens/anime/widgets/episode/styles/detailed_style.dart:46-49 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/screens/library/editor/history_editor.dart:171 — lib/screens/library/editor/history_editor.dart:171-174 | lib/screens/manga/widgets/reader/themes/reader_control_themes/ios_reader_control_theme.dart:188-191 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/screens/profile/widgets/activity_heatmap.dart:28 — lib/screens/profile/widgets/activity_heatmap.dart:28-31 | lib/screens/stats/user_stats_page.dart:75-78 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×4
  • Edited copy of a member (7 corresponding lines) lib/widgets/dialogs/alert_dialog_builder.dart:80 — lib/widgets/dialogs/alert_dialog_builder.dart:80-86 | lib/widgets/dialogs/alert_dialog_builder.dart:95-106 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/utils/media_downloader.dart:456 — lib/utils/media_downloader.dart:456-462 | lib/screens/downloads/controller/download_controller.dart:1339-1345 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/widgets/common/cards/media_card_registry.dart:51 — lib/widgets/common/cards/media_card_registry.dart:51-57 | lib/widgets/common/navbar/navbar_registry.dart:44-50 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/screens/anime/widgets/watch_order_page.dart:311 — lib/screens/anime/widgets/watch_order_page.dart:311-317 | lib/screens/downloads/controller/download_controller.dart:2597-2603 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×4
  • Duplicated block (42 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:751 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:751-792 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:663-704 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:751` 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 (42 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:463 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:463-504 | lib/widgets/watchium/watchium_create_dialog.dart:387-428 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:463` 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 (42 lines × 2) lib/widgets/animation/animations.dart:32 — lib/widgets/animation/animations.dart:32-73 | lib/widgets/animation/animations.dart:131-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/animation/animations.dart:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (42 lines × 2) lib/widgets/common/navbar/styles/classic_navbar.dart:199 — lib/widgets/common/navbar/styles/classic_navbar.dart:199-240 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:193-234 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:199` 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 (41 lines × 2) · ×4
  • Duplicated block (41 lines × 2) lib/models/Media/media.dart:1174 — lib/models/Media/media.dart:1174-1214 | lib/models/Media/media.dart:1401-1441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (41 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:24 — lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:24-64 | lib/screens/anime/watch/controls/themes/player_control_themes/netflix_mobile_player_theme.dart:39-79 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_mobile_player_theme.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (41 lines × 2) lib/screens/library/online/anime_list.dart:652 — lib/screens/library/online/anime_list.dart:652-692 | lib/screens/library/online/manga_list.dart:636-676 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 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 (41 lines × 2) lib/screens/search/widgets/search_widgets.dart:1867 — lib/screens/search/widgets/search_widgets.dart:1867-1907 | lib/screens/search/widgets/search_widgets.dart:2047-2087 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/search_widgets.dart:1867` 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 (34 lines × 2) · ×4
  • Duplicated block (34 lines × 2) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:376 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:376-409 | lib/widgets/common/anymex_slider_m3.dart:405-438 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart` and `lib/widgets/common/anymex_slider_m3.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:376` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (34 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:245 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:245-278 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:283-316 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:245` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (34 lines × 2) lib/screens/downloads/widgets/download_server_selector.dart:517 — lib/screens/downloads/widgets/download_server_selector.dart:517-550 | lib/widgets/watchium/watchium_server_sheet.dart:240-273 — before extracting anything, compare `lib/screens/downloads/widgets/download_server_selector.dart` and `lib/widgets/watchium/watchium_server_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/download_server_selector.dart:517` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/downloads/widgets/download_server_selector.dart:515` calls `SizedBox` and `lib/widgets/watchium/watchium_server_sheet.dart:239` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (34 lines × 2) lib/screens/profile/profile_page.dart:576 — lib/screens/profile/profile_page.dart:576-609 | lib/screens/profile/user_profile_page.dart:1211-1244 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:576` 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 (31 lines × 2) · ×4
  • Duplicated block (31 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:1558 — lib/controllers/services/anilist/anilist_auth.dart:1558-1588 | lib/controllers/services/anilist/anilist_auth.dart:1657-1687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (31 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:2007 — lib/screens/anime/widgets/comments/comments_section.dart:2007-2037 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:726-756 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2007` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (31 lines × 2) lib/screens/search/widgets/extension_filter_sheet.dart:479 — lib/screens/search/widgets/extension_filter_sheet.dart:479-509 | lib/screens/search/widgets/extension_filter_sheet.dart:837-867 — both copies are in the same file, so extract the 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 (31 lines × 2) lib/screens/settings/sub_settings/settings_network.dart:449 — lib/screens/settings/sub_settings/settings_network.dart:449-479 | lib/screens/settings/sub_settings/settings_network.dart:771-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:449` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×4
  • Duplicated block (17 lines × 3) lib/screens/anime/widgets/episode_list_builder.dart:636 — lib/screens/anime/widgets/episode_list_builder.dart:636-652 | lib/screens/anime/widgets/episode_list_builder.dart:669-685 | lib/screens/anime/widgets/episode_list_builder.dart:765-781 — 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 (17 lines × 3) lib/screens/community/community_recommendations_page.dart:667 — lib/screens/community/community_recommendations_page.dart:667-683 | lib/widgets/media_items/media_peek_popup.dart:1220-1236 | lib/widgets/non_widgets/reasons_sheet.dart:900-916 — before extracting anything, compare `lib/screens/community/community_recommendations_page.dart` and `lib/widgets/media_items/media_peek_popup.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/community/community_recommendations_page.dart:667` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 3) lib/screens/library/stats_page.dart:35 — lib/screens/library/stats_page.dart:35-51 | lib/screens/library/stats_page.dart:54-70 | lib/screens/library/stats_page.dart:73-89 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/stats_page.dart:35` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 3) lib/screens/local_source/local_source_view.dart:523 — lib/screens/local_source/local_source_view.dart:523-539 | lib/screens/local_source/local_source_view.dart:606-622 | lib/screens/local_source/local_source_view.dart:674-690 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:523` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×4
  • Duplicated block (14–15 lines × 3) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:38 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:38-52 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:40-54 | lib/screens/anime/watch/controls/top_controls.dart:49-62 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:38` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14–15 lines × 3) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:90 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:90-104 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:159-172 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1271-1284 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:90` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 3) lib/screens/anime/widgets/anime_stats.dart:648 — lib/screens/anime/widgets/anime_stats.dart:648-662 | lib/screens/manga/widgets/manga_stats.dart:351-365 | lib/screens/settings/widgets/style_picker_section.dart:126-139 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:648` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 3) lib/screens/community/community_recommendations_page.dart:691 — lib/screens/community/community_recommendations_page.dart:691-705 | lib/widgets/media_items/media_peek_popup.dart:1245-1258 | lib/widgets/non_widgets/reasons_sheet.dart:925-938 — before extracting anything, compare `lib/screens/community/community_recommendations_page.dart` and `lib/widgets/media_items/media_peek_popup.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/community/community_recommendations_page.dart:691` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:1015 — lib/controllers/services/anilist/anilist_auth.dart:1015-1028 | lib/controllers/services/anilist/anilist_auth.dart:1173-1187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1015` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) lib/controllers/source/source_controller.dart:595 — lib/controllers/source/source_controller.dart:595-608 | lib/screens/extensions/widgets/plugin_manager.dart:204-218 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/source/source_controller.dart:595` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14–15 lines × 2) lib/screens/anime/watch/controls/widgets/control_button.dart:165 — lib/screens/anime/watch/controls/widgets/control_button.dart:165-178 | lib/screens/anime/watch/controls/widgets/control_button.dart:181-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/control_button.dart:181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) lib/screens/settings/sub_settings/settings_extensions.dart:624 — lib/screens/settings/sub_settings/settings_extensions.dart:624-638 | lib/screens/settings/sub_settings/settings_extensions.dart:673-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_extensions.dart:624` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/settings/sub_settings/settings_extensions.dart:640` calls `Obx` and `lib/screens/settings/sub_settings/settings_extensions.dart:688` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×4
  • Duplicated block (13 lines × 4) lib/controllers/services/widgets/widgets_builders.dart:304 — lib/controllers/services/widgets/widgets_builders.dart:304-316 | lib/screens/anime/watch/controls/widgets/shader_osd.dart:31-43 | lib/screens/community/community_recommendations_page.dart:537-549 | lib/screens/community/community_recommendations_page.dart:780-792 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/widgets/widgets_builders.dart:304` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 4) lib/screens/anime/widgets/anime_stats.dart:688 — lib/screens/anime/widgets/anime_stats.dart:688-700 | lib/screens/anime/widgets/anime_stats.dart:725-737 | lib/screens/manga/widgets/manga_stats.dart:730-742 | lib/screens/manga/widgets/manga_stats.dart:767-779 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:688` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 4) lib/screens/search/widgets/search_widgets.dart:1432 — lib/screens/search/widgets/search_widgets.dart:1432-1444 | lib/screens/search/widgets/search_widgets.dart:1523-1535 | lib/screens/search/widgets/search_widgets.dart:1605-1617 | lib/screens/search/widgets/search_widgets.dart:1679-1691 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/search_widgets.dart:1432` 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 (13 lines × 4) lib/screens/settings/sub_settings/settings_network.dart:351 — lib/screens/settings/sub_settings/settings_network.dart:351-363 | lib/screens/settings/sub_settings/settings_network.dart:606-618 | lib/screens/settings/sub_settings/settings_network.dart:643-655 | lib/screens/settings/sub_settings/settings_network.dart:681-693 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:351` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×4
  • Duplicated block (11–13 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1204 — lib/screens/anime/widgets/comments/comments_section.dart:1204-1214 | lib/screens/anime/widgets/comments/comments_section.dart:1288-1300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–13 lines × 2) lib/screens/anime/widgets/video_slider.dart:71 — lib/screens/anime/widgets/video_slider.dart:71-83 | lib/widgets/common/slider_semantics.dart:299-309 — before extracting anything, compare `lib/screens/anime/widgets/video_slider.dart` and `lib/widgets/common/slider_semantics.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/video_slider.dart:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–13 lines × 2) lib/screens/settings/sub_settings/settings_moderation.dart:1545 — lib/screens/settings/sub_settings/settings_moderation.dart:1545-1557 | lib/screens/settings/sub_settings/settings_moderation.dart:1569-1579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_moderation.dart:1545` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–13 lines × 2) lib/screens/settings/sub_settings/settings_network.dart:392 — lib/screens/settings/sub_settings/settings_network.dart:392-404 | lib/screens/settings/sub_settings/settings_ui_details.dart:340-350 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:392` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×4
  • Duplicated block (9–10 lines × 3) lib/screens/anime/misc/calendar.dart:206 — lib/screens/anime/misc/calendar.dart:206-215 | lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:66-74 | lib/widgets/header/header.dart:687-695 — before extracting anything, compare `lib/screens/manga/widgets/reader/tabbed_reader_settings.dart` and `lib/widgets/header/header.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 3) lib/screens/library/editor/history_editor.dart:292 — lib/screens/library/editor/history_editor.dart:292-301 | lib/screens/library/editor/history_editor.dart:392-401 | lib/screens/library/editor/history_editor.dart:843-851 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/history_editor.dart:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 3) lib/screens/library/widgets/unified_history_card.dart:122 — lib/screens/library/widgets/unified_history_card.dart:122-131 | lib/screens/library/widgets/unified_history_card.dart:268-276 | lib/screens/library/widgets/unified_history_card.dart:392-401 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 3) lib/screens/profile/activity_details_page.dart:355 — lib/screens/profile/activity_details_page.dart:355-364 | lib/screens/profile/activity_details_page.dart:383-392 | lib/widgets/non_widgets/activity_card.dart:656-664 — before extracting anything, compare `lib/screens/profile/activity_details_page.dart` and `lib/widgets/non_widgets/activity_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 190 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/activity_details_page.dart:355` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×4
  • Duplicated block (9–10 lines × 2) lib/screens/downloads/controller/download_controller.dart:2288 — lib/screens/downloads/controller/download_controller.dart:2288-2296 | lib/screens/downloads/controller/download_controller.dart:2300-2309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:2300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) lib/screens/library/widgets/library_deps.dart:247 — lib/screens/library/widgets/library_deps.dart:247-255 | lib/widgets/anime/media_header.dart:419-428 — before extracting anything, compare `lib/screens/library/widgets/library_deps.dart` and `lib/widgets/anime/media_header.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/library_deps.dart:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) lib/screens/search/widgets/extension_filter_sheet.dart:311 — lib/screens/search/widgets/extension_filter_sheet.dart:311-320 | lib/screens/search/widgets/extension_filter_sheet.dart:797-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/widgets/extension_filter_sheet.dart:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:122 — lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:122-131 | lib/screens/settings/sub_settings/settings_fonts.dart:69-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:122` 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 (8 lines × 6) · ×4
  • Duplicated block (8 lines × 6) lib/screens/anime/details/media_details_page.dart:894 — lib/screens/anime/details/media_details_page.dart:894-902 | lib/screens/anime/widgets/comments/comments_section.dart:370-379 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:693-702 | lib/screens/library/widgets/library_deps.dart:247-254 | lib/widgets/anime/media_header.dart:419-427 | lib/widgets/anime/media_header.dart:441-449 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/anime/widgets/comments/comments_section.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 6) lib/screens/anime/details/media_details_page.dart:894 — lib/screens/anime/details/media_details_page.dart:894-902 | lib/screens/anime/widgets/comments/comments_section.dart:370-379 | lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:146-154 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:693-702 | lib/screens/library/widgets/library_deps.dart:247-254 | lib/widgets/anime/media_header.dart:441-449 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/anime/widgets/comments/comments_section.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:691` calls `symmetric` and `lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:145` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 6) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:827 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:827-834 | lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:885-892 | lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:986-993 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:730-737 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:778-785 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:879-886 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:827` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 6) lib/screens/anime/widgets/episode_list_builder.dart:1187 — lib/screens/anime/widgets/episode_list_builder.dart:1187-1194 | lib/screens/anime/widgets/episode_list_builder.dart:1219-1226 | lib/screens/manga/widgets/chapter_list_builder.dart:1306-1313 | lib/screens/manga/widgets/chapter_list_builder.dart:1338-1345 | lib/screens/search/widgets/search_widgets.dart:2249-2258 | lib/widgets/watchium/watchium_party_popup.dart:764-771 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 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 (7–8 lines × 2) · ×4
  • Duplicated block (7–8 lines × 2) lib/controllers/services/simkl/simkl_service.dart:872 — lib/controllers/services/simkl/simkl_service.dart:872-879 | lib/controllers/services/simkl/simkl_service.dart:1030-1036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/simkl/simkl_service.dart:872` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) lib/screens/downloads/widgets/downloaded_media_view.dart:667 — lib/screens/downloads/widgets/downloaded_media_view.dart:667-673 | lib/screens/downloads/widgets/track_sheet.dart:511-518 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:667` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1146 — lib/screens/profile/compatibility/compatibility_result_page.dart:1146-1152 | lib/screens/profile/compatibility/compatibility_result_page.dart:2653-2660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) lib/screens/profile/widgets/decoration_closet_sheet.dart:518 — lib/screens/profile/widgets/decoration_closet_sheet.dart:518-525 | lib/screens/profile/widgets/decoration_closet_sheet.dart:549-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×4
  • Duplicated block (5 lines × 3) lib/controllers/watchium/watchium_sync_controller.dart:318 — lib/controllers/watchium/watchium_sync_controller.dart:318-322 | lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:629-633 | lib/widgets/watchium/watchium_create_dialog.dart:551-555 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/watchium/watchium_sync_controller.dart:318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (5 lines × 3) lib/models/Media/media.dart:502 — lib/models/Media/media.dart:502-506 | lib/models/Media/media.dart:1151-1155 | lib/models/Media/media.dart:1366-1370 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:502` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:212 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:212-217 | lib/widgets/watchium/watchium_create_dialog.dart:697-703 | lib/widgets/watchium/watchium_overlay.dart:118-122 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 3) lib/controllers/services/widgets/widgets_builders.dart:247 — lib/controllers/services/widgets/widgets_builders.dart:247-251 | lib/screens/community/community_recommendations_page.dart:396-400 | lib/screens/community/community_recommendations_page.dart:837-841 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×3
  • Edited copy of a member (63 corresponding lines) lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:21 — lib/screens/anime/watch/controls/themes/player_control_themes/netflix_desktop_player_theme.dart.dart:21-83 | lib/screens/anime/watch/controls/themes/player_control_themes/netflix_mobile_player_theme.dart:20-98 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (63 corresponding lines) lib/screens/manga/widgets/reader/top_controls.dart:106 — lib/screens/manga/widgets/reader/top_controls.dart:106-168 | lib/screens/novel/reader/widgets/top_controls.dart:73-136 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (63 corresponding lines) lib/screens/local_source/local_source_view.dart:76 — lib/screens/local_source/local_source_view.dart:76-185 | lib/screens/settings/misc/sauce_finder_view.dart:100-162 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) lib/controllers/services/anilist/anilist_auth.dart:2002 — lib/controllers/services/anilist/anilist_auth.dart:2002-2029 | lib/controllers/services/anilist/anilist_auth.dart:2403-2429 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/widgets/non_widgets/in_app_notification_banner.dart:128 — lib/widgets/non_widgets/in_app_notification_banner.dart:128-155 | lib/widgets/non_widgets/torrent_server_overlay.dart:108-134 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/screens/profile/compatibility/compatibility_result_page.dart:1603 — lib/screens/profile/compatibility/compatibility_result_page.dart:1603-1629 | lib/screens/profile/compatibility/compatibility_result_page.dart:2048-2081 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 14+ corresponding lines) lib/screens/stats/controller/user_stats_controller.dart:200 — lib/screens/stats/controller/user_stats_controller.dart:200-216 | lib/screens/stats/controller/user_stats_controller.dart:218-234 | lib/screens/stats/controller/user_stats_controller.dart:236-249 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) lib/screens/anime/watch/controls/widgets/progress_slider.dart:348 — lib/screens/anime/watch/controls/widgets/progress_slider.dart:348-362 | lib/screens/anime/widgets/video_slider.dart:93-106 | lib/widgets/common/slider_semantics.dart:178-194 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) lib/controllers/offline/offline_storage_controller.dart:167 — lib/controllers/offline/offline_storage_controller.dart:167-180 | lib/controllers/offline/offline_storage_controller.dart:182-195 | lib/controllers/offline/offline_storage_controller.dart:197-210 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×3
  • Edited copy of a member (5 corresponding lines) lib/screens/anime/themes/anime_theme_dialog.dart:163 — lib/screens/anime/themes/anime_theme_dialog.dart:163-167 | lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:57-63 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) lib/controllers/services/mal/mal_service.dart:397 — lib/controllers/services/mal/mal_service.dart:397-405 | lib/controllers/services/mal/mal_api.dart:70-74 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) lib/widgets/common/cards/media_card_registry.dart:38 — lib/widgets/common/cards/media_card_registry.dart:38-42 | lib/widgets/common/navbar/navbar_registry.dart:31-35 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (65 lines × 2) · ×3
  • Duplicated block (65 lines × 2) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:246 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:246-310 | lib/widgets/common/anymex_slider_m3.dart:275-339 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart` and `lib/widgets/common/anymex_slider_m3.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:246` 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 (65 lines × 2) lib/screens/anime/widgets/episode/styles/compact_style.dart:80 — lib/screens/anime/widgets/episode/styles/compact_style.dart:80-144 | lib/screens/anime/widgets/episode/styles/detailed_style.dart:80-144 — before extracting anything, compare `lib/screens/anime/widgets/episode/styles/compact_style.dart` and `lib/screens/anime/widgets/episode/styles/detailed_style.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode/styles/compact_style.dart:80` 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 (65 lines × 2) lib/screens/profile/profile_page.dart:1074 — lib/screens/profile/profile_page.dart:1074-1138 | lib/screens/profile/user_profile_page.dart:997-1061 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:1074` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/profile/user_profile_page.dart:1064` calls `SizedBox` and `lib/screens/profile/profile_page.dart:1141` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (35–36 lines × 2) · ×3
  • Duplicated block (35–36 lines × 2) lib/screens/anime/studio_details_page.dart:193 — lib/screens/anime/studio_details_page.dart:193-227 | lib/screens/anime/widgets/character_staff_sheet.dart:366-401 — before extracting anything, compare `lib/screens/anime/studio_details_page.dart` and `lib/screens/anime/widgets/character_staff_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/studio_details_page.dart:193` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (35–36 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:577 — lib/screens/anime/widgets/episode_list_builder.dart:577-611 | lib/screens/anime/widgets/episode_list_builder.dart:714-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:577` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/episode_list_builder.dart:713` calls `NeverScrollableScrollPhysics` and `lib/screens/anime/widgets/episode_list_builder.dart:576` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (35–36 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1112 — lib/screens/anime/widgets/episode_list_builder.dart:1112-1146 | lib/screens/manga/widgets/chapter_list_builder.dart:655-690 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 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 (36 lines × 2) · ×3
  • Duplicated block (36 lines × 2) lib/screens/anime/widgets/anime_stats.dart:682 — lib/screens/anime/widgets/anime_stats.dart:682-717 | lib/screens/manga/widgets/manga_stats.dart:724-759 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (36 lines × 2) lib/screens/profile/activity_details_page.dart:608 — lib/screens/profile/activity_details_page.dart:608-643 | lib/widgets/non_widgets/activity_card.dart:357-392 — before extracting anything, compare `lib/screens/profile/activity_details_page.dart` and `lib/widgets/non_widgets/activity_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 190 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/activity_details_page.dart:608` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (36 lines × 2) lib/widgets/common/carousel/themes/big_carousel_classic.dart:37 — lib/widgets/common/carousel/themes/big_carousel_classic.dart:37-72 | lib/widgets/common/carousel/themes/big_carousel_portrait.dart:71-106 — before extracting anything, compare `lib/widgets/common/carousel/themes/big_carousel_classic.dart` and `lib/widgets/common/carousel/themes/big_carousel_portrait.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/carousel/themes/big_carousel_classic.dart:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (34–35 lines × 2) · ×3
  • Duplicated block (34–35 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:658 — lib/screens/anime/widgets/episode_list_builder.dart:658-692 | lib/screens/anime/widgets/episode_list_builder.dart:754-787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:658` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/episode_list_builder.dart:753` calls `NeverScrollableScrollPhysics` and `lib/screens/anime/widgets/episode_list_builder.dart:657` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (34–35 lines × 2) lib/screens/library/online/anime_list.dart:157 — lib/screens/library/online/anime_list.dart:157-191 | lib/screens/library/online/manga_list.dart:136-169 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:157` 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 (34–35 lines × 2) lib/screens/library/widgets/library_deps.dart:138 — lib/screens/library/widgets/library_deps.dart:138-171 | lib/widgets/common/custom_tiles.dart:319-353 — before extracting anything, compare `lib/screens/library/widgets/library_deps.dart` and `lib/widgets/common/custom_tiles.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/library_deps.dart:138` 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 (35 lines × 2) · ×3
  • Duplicated block (35 lines × 2) lib/screens/library/online/anime_list.dart:374 — lib/screens/library/online/anime_list.dart:374-408 | lib/screens/profile/widgets/user_media_list_page.dart:335-369 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/profile/widgets/user_media_list_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:374` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (35 lines × 2) lib/screens/profile/profile_page.dart:408 — lib/screens/profile/profile_page.dart:408-442 | lib/screens/profile/user_profile_page.dart:475-509 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:408` 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 (35 lines × 2) lib/utils/download_isolate_pool.dart:110 — lib/utils/download_isolate_pool.dart:110-144 | lib/utils/download_isolate_pool.dart:177-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/download_isolate_pool.dart:110` 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 (33 lines × 2) · ×3
  • Duplicated block (33 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:908 — lib/screens/anime/widgets/episode_list_builder.dart:908-940 | lib/screens/manga/widgets/chapter_list_builder.dart:434-466 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (33 lines × 2) lib/screens/downloads/download_screen.dart:1129 — lib/screens/downloads/download_screen.dart:1129-1161 | lib/screens/downloads/download_screen.dart:1409-1441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:1129` 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 (33 lines × 2) lib/utils/media_share.dart:123 — lib/utils/media_share.dart:123-155 | lib/utils/media_share.dart:158-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/media_share.dart:123` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×3
  • Duplicated block (27–28 lines × 2) lib/screens/manga/controller/reader_controller.dart:741 — lib/screens/manga/controller/reader_controller.dart:741-767 | lib/screens/manga/controller/reader_controller.dart:1585-1612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/controller/reader_controller.dart:741` 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 (27–28 lines × 2) lib/widgets/common/cards/styles/exotic_card.dart:123 — lib/widgets/common/cards/styles/exotic_card.dart:123-149 | lib/widgets/common/cards/styles/minimal_exotic_card.dart:128-155 — before extracting anything, compare `lib/widgets/common/cards/styles/exotic_card.dart` and `lib/widgets/common/cards/styles/minimal_exotic_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/cards/styles/exotic_card.dart:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (27–28 lines × 2) lib/widgets/common/navbar/styles/classic_navbar.dart:350 — lib/widgets/common/navbar/styles/classic_navbar.dart:350-377 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:402-428 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×3
  • Duplicated block (24 lines × 3) lib/controllers/discord/discord_rpc.dart:627 — lib/controllers/discord/discord_rpc.dart:627-650 | lib/controllers/discord/discord_rpc.dart:738-761 | lib/controllers/discord/discord_rpc.dart:867-890 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:627` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (24 lines × 3) lib/controllers/discord/discord_rpc.dart:664 — lib/controllers/discord/discord_rpc.dart:664-687 | lib/controllers/discord/discord_rpc.dart:769-792 | lib/controllers/discord/discord_rpc.dart:898-921 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:664` 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 (24 lines × 3) lib/screens/settings/sub_settings/settings_theme.dart:765 — lib/screens/settings/sub_settings/settings_theme.dart:765-788 | lib/screens/settings/sub_settings/settings_theme.dart:802-825 | lib/screens/settings/sub_settings/settings_theme.dart:840-863 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_theme.dart:765` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×3
  • Duplicated block (20 lines × 3) lib/database/comments/comments_db.dart:243 — lib/database/comments/comments_db.dart:243-262 | lib/database/comments/comments_db.dart:420-439 | lib/database/comments/comments_db.dart:459-478 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/database/comments/comments_db.dart:243` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 3) lib/services/commentum_service.dart:667 — lib/services/commentum_service.dart:667-686 | lib/services/commentum_service.dart:714-733 | lib/services/commentum_service.dart:923-942 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:667` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 3) lib/widgets/non_widgets/reasons_sheet.dart:296 — lib/widgets/non_widgets/reasons_sheet.dart:296-315 | lib/widgets/non_widgets/recommend_sheet.dart:442-461 | lib/widgets/non_widgets/recommend_sheet.dart:648-667 — before extracting anything, compare `lib/widgets/non_widgets/reasons_sheet.dart` and `lib/widgets/non_widgets/recommend_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/reasons_sheet.dart:296` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/widgets/non_widgets/recommend_sheet.dart:441` calls `_runCheck` and `lib/widgets/non_widgets/reasons_sheet.dart:295` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×3
  • Duplicated block (18 lines × 3) lib/screens/anime/watch/controls/widgets/audio_popup.dart:261 — lib/screens/anime/watch/controls/widgets/audio_popup.dart:261-278 | lib/screens/anime/watch/controls/widgets/source_popup.dart:163-180 | lib/screens/anime/watch/controls/widgets/tracks_popup.dart:426-443 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/source_popup.dart` and `lib/screens/anime/watch/controls/widgets/tracks_popup.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 3) lib/screens/anime/widgets/anime_stats.dart:614 — lib/screens/anime/widgets/anime_stats.dart:614-631 | lib/screens/anime/widgets/anime_stats.dart:663-680 | lib/screens/manga/widgets/manga_stats.dart:317-334 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:614` 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 (18 lines × 3) lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:245 — lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:245-262 | lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:177-194 | lib/screens/settings/sub_settings/settings_reader.dart:359-376 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_subtitles.dart:245` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×3
  • Duplicated block (16–17 lines × 3) lib/screens/anime/watch/controls/widgets/episodes_pane.dart:260 — lib/screens/anime/watch/controls/widgets/episodes_pane.dart:260-275 | lib/screens/anime/widgets/episode_list_builder.dart:528-543 | lib/screens/anime/widgets/episode_list_builder.dart:614-630 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/episodes_pane.dart:260` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–17 lines × 3) lib/screens/anime/widgets/anime_stats.dart:282 — lib/screens/anime/widgets/anime_stats.dart:282-298 | lib/screens/anime/widgets/anime_stats.dart:347-362 | lib/screens/manga/widgets/manga_stats.dart:398-413 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 3) lib/services/commentum_service.dart:434 — lib/services/commentum_service.dart:434-450 | lib/services/commentum_service.dart:627-643 | lib/services/commentum_service.dart:992-1007 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:434` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:590 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:590-606 | lib/widgets/watchium/watchium_create_dialog.dart:512-527 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:590` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:589` calls `all`, `opaque` and `lib/widgets/watchium/watchium_create_dialog.dart:511` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16–17 lines × 2) lib/screens/profile/widgets/profile_header.dart:213 — lib/screens/profile/widgets/profile_header.dart:213-228 | lib/screens/profile/widgets/user_profile_header.dart:185-201 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 179 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:213` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16–17 lines × 2) lib/screens/stats/user_stats_page.dart:455 — lib/screens/stats/user_stats_page.dart:455-470 | lib/screens/stats/user_stats_page.dart:954-970 — both copies are in the same file, so extract the 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 × 4) · ×3
  • Duplicated block (16 lines × 4) lib/controllers/discord/discord_rpc.dart:724 — lib/controllers/discord/discord_rpc.dart:724-739 | lib/controllers/discord/discord_rpc.dart:853-868 | lib/controllers/discord/discord_rpc.dart:972-987 | lib/controllers/discord/discord_rpc.dart:1083-1098 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:724` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/controllers/discord/discord_rpc.dart:852` calls `_processImageUrl` and `lib/controllers/discord/discord_rpc.dart:1081` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 4) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:549 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:549-564 | lib/screens/watchium/watchium_page.dart:377-392 | lib/widgets/watchium/watchium_create_dialog.dart:475-490 | lib/widgets/watchium/watchium_party_popup.dart:705-720 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 4) lib/screens/settings/sub_settings/settings_comments.dart:74 — lib/screens/settings/sub_settings/settings_comments.dart:74-89 | lib/screens/settings/sub_settings/settings_donation.dart:372-387 | lib/screens/settings/sub_settings/settings_moderation.dart:56-71 | lib/screens/settings/sub_settings/settings_network.dart:49-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_comments.dart:74` 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 (15–16 lines × 3) · ×3
  • Duplicated block (15–16 lines × 3) lib/screens/anime/widgets/voice_actor.dart:81 — lib/screens/anime/widgets/voice_actor.dart:81-95 | lib/screens/anime/widgets/voice_actor.dart:204-219 | lib/screens/anime/widgets/voice_actor.dart:348-363 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/voice_actor.dart:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 3) lib/screens/library/online/anime_list.dart:372 — lib/screens/library/online/anime_list.dart:372-386 | lib/screens/library/online/manga_list.dart:355-370 | lib/screens/profile/widgets/user_media_list_page.dart:333-347 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:372` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15–16 lines × 3) lib/screens/search/search_view.dart:425 — lib/screens/search/search_view.dart:425-440 | lib/screens/search/search_view.dart:456-470 | lib/screens/search/search_view.dart:486-500 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/search/search_view.dart:425` 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 (15–16 lines × 2) · ×3
  • Duplicated block (15–16 lines × 2) lib/screens/anime/watch/controls/widgets/episodes_pane.dart:272 — lib/screens/anime/watch/controls/widgets/episodes_pane.dart:272-287 | lib/screens/anime/watch/controls/widgets/episodes_pane.dart:309-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/episodes_pane.dart:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) lib/screens/profile/widgets/activity_heatmap.dart:86 — lib/screens/profile/widgets/activity_heatmap.dart:86-101 | lib/screens/stats/user_stats_page.dart:590-604 — before extracting anything, compare `lib/screens/profile/widgets/activity_heatmap.dart` and `lib/screens/stats/user_stats_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15–16 lines × 2) lib/widgets/media_items/media_peek_popup.dart:419 — lib/widgets/media_items/media_peek_popup.dart:419-433 | lib/widgets/non_widgets/reasons_sheet.dart:381-396 — before extracting anything, compare `lib/widgets/media_items/media_peek_popup.dart` and `lib/widgets/non_widgets/reasons_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/media_items/media_peek_popup.dart:419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×3
  • Duplicated block (14 lines × 4) lib/controllers/offline/offline_storage_controller.dart:569 — lib/controllers/offline/offline_storage_controller.dart:569-582 | lib/controllers/offline/offline_storage_controller.dart:654-667 | lib/controllers/offline/offline_storage_controller.dart:718-731 | lib/controllers/offline/offline_storage_controller.dart:782-795 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/offline/offline_storage_controller.dart:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 4) lib/screens/anime/widgets/episode_list_builder.dart:581 — lib/screens/anime/widgets/episode_list_builder.dart:581-594 | lib/screens/anime/widgets/episode_list_builder.dart:661-674 | lib/screens/anime/widgets/episode_list_builder.dart:718-731 | lib/screens/anime/widgets/episode_list_builder.dart:757-770 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:581` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 4) lib/utils/color_profiler.dart:366 — lib/utils/color_profiler.dart:366-379 | lib/utils/color_profiler.dart:388-401 | lib/utils/color_profiler.dart:408-421 | lib/utils/color_profiler.dart:436-449 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/color_profiler.dart:366` 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 × 3) · ×3
  • Duplicated block (10–11 lines × 3) lib/screens/anime/home_page.dart:132 — lib/screens/anime/home_page.dart:132-141 | lib/screens/manga/home_page.dart:52-62 | lib/screens/novel/home_page.dart:42-52 — `lib/screens/anime/home_page.dart` and `lib/screens/manga/home_page.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/home_page.dart:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/home_page.dart:131` calls `put`, `MediaModeController` and `lib/screens/novel/home_page.dart:41` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 3) lib/screens/settings/sub_settings/settings_downloads.dart:24 — lib/screens/settings/sub_settings/settings_downloads.dart:24-33 | lib/screens/settings/sub_settings/settings_ui.dart:56-66 | lib/screens/settings/sub_settings/settings_ui_components.dart:169-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_downloads.dart:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/settings/sub_settings/settings_ui_components.dart:167` calls `sizeOf` and `lib/screens/settings/sub_settings/settings_ui.dart:55` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 3) lib/services/commentum_service.dart:1069 — lib/services/commentum_service.dart:1069-1078 | lib/services/commentum_service.dart:1103-1112 | lib/services/commentum_service.dart:1223-1233 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:1069` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×3
  • Duplicated block (9 lines × 4) lib/controllers/services/anilist/anilist_auth.dart:2393 — lib/controllers/services/anilist/anilist_auth.dart:2393-2401 | lib/controllers/services/anilist/anilist_auth.dart:2534-2542 | lib/controllers/services/anilist/anilist_auth.dart:2591-2599 | lib/controllers/services/anilist/anilist_auth.dart:2648-2656 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:2393` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) lib/screens/downloads/download_screen.dart:1070 — lib/screens/downloads/download_screen.dart:1070-1078 | lib/screens/downloads/download_screen.dart:1348-1356 | lib/screens/downloads/download_screen.dart:1571-1579 | lib/screens/downloads/widgets/download_server_selector.dart:397-405 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:1070` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) lib/screens/novel/reader/widgets/bottom_controls.dart:75 — lib/screens/novel/reader/widgets/bottom_controls.dart:75-83 | lib/screens/novel/reader/widgets/bottom_controls.dart:153-161 | lib/screens/novel/reader/widgets/bottom_controls.dart:234-242 | lib/screens/novel/reader/widgets/bottom_controls.dart:300-308 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/novel/reader/widgets/bottom_controls.dart:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×3
  • Duplicated block (8–9 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:642 — lib/controllers/services/anilist/anilist_auth.dart:642-649 | lib/controllers/services/anilist/anilist_auth.dart:803-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:642` 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 (8–9 lines × 2) lib/screens/library/widgets/unified_history_card.dart:207 — lib/screens/library/widgets/unified_history_card.dart:207-214 | lib/widgets/anime/continue_watching_cards.dart:39-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) lib/screens/profile/user_profile_page.dart:1073 — lib/screens/profile/user_profile_page.dart:1073-1081 | lib/screens/profile/widgets/activity_heatmap.dart:147-154 — 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 (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) lib/models/Media/media.dart:258 — lib/models/Media/media.dart:258-265 | lib/models/Media/media.dart:463-470 | lib/models/Media/media.dart:1222-1227 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:258` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) lib/screens/extensions/ExtensionScreen.dart:418 — lib/screens/extensions/ExtensionScreen.dart:418-423 | lib/screens/extensions/ExtensionScreen.dart:451-456 | lib/widgets/common/source_selector.dart:499-504 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/extensions/ExtensionScreen.dart:418` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) lib/controllers/services/widgets/widgets_builders.dart:240 — lib/controllers/services/widgets/widgets_builders.dart:240-245 | lib/screens/community/community_recommendations_page.dart:389-394 | lib/screens/community/community_recommendations_page.dart:830-835 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (115 shared lines) · ×2
  • Near-duplicate member pair (115 shared lines) lib/screens/library/widgets/unified_history_card.dart:19 — lib/screens/library/widgets/unified_history_card.dart:19-180 | lib/screens/library/widgets/unified_history_card.dart:321-447 — These two members are variants of one another: 115 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (115 shared lines) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:244 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:244-555 | lib/screens/settings/sub_settings/settings_reader.dart:1122-1444 — These two members are variants of one another: 115 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (73 shared lines) · ×2
  • Near-duplicate member pair (73 shared lines) lib/screens/anime/widgets/comments/comments_section.dart:2458 — lib/screens/anime/widgets/comments/comments_section.dart:2458-2538 | lib/screens/anime/widgets/comments/comments_section.dart:2540-2674 — These two members are variants of one another: 73 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (73 shared lines) lib/widgets/common/carousel/themes/big_carousel_classic.dart:32 — lib/widgets/common/carousel/themes/big_carousel_classic.dart:32-155 | lib/widgets/common/carousel/themes/big_carousel_portrait.dart:58-177 — These two members are variants of one another: 73 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (57 shared lines) · ×2
  • Near-duplicate member pair (57 shared lines) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:608 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:608-679 | lib/widgets/watchium/watchium_create_dialog.dart:529-598 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (57 shared lines) lib/utils/compatibility/matchmaker.dart:668 — lib/utils/compatibility/matchmaker.dart:668-764 | lib/utils/compatibility/matchmaker.dart:933-1023 — These two members are variants of one another: 57 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 (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:374 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:374-409 | lib/screens/anime/watch/controls/widgets/progress_slider.dart:291-344 | lib/screens/anime/widgets/video_slider.dart:53-87 | lib/widgets/common/anymex_slider_m3.dart:403-438 | lib/widgets/common/slider_semantics.dart:139-172 | lib/widgets/common/slider_semantics.dart:284-313 — 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) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:815 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:815-857 | lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:873-928 | lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:967-1035 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:723-750 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:766-821 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:860-928 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (84 corresponding lines) · ×2
  • Edited copy of a member (84 corresponding lines) lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:79 — lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:79-162 | lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:164-248 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (84 corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart:1441 — lib/screens/anime/widgets/episode_list_builder.dart:1441-1546 | lib/screens/manga/widgets/chapter_list_builder.dart:1555-1638 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) lib/widgets/non_widgets/recommend_sheet.dart:263 — lib/widgets/non_widgets/recommend_sheet.dart:263-303 | lib/widgets/non_widgets/recommend_sheet.dart:305-351 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:691 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:691-737 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:609-649 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (68 corresponding lines) · ×2
  • Edited copy of a member (68 corresponding lines) lib/widgets/anymex_widgets/anymex_animated_logo.dart:522 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:522-589 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:818-900 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (68 corresponding lines) lib/screens/library/online/anime_list.dart:104 — lib/screens/library/online/anime_list.dart:104-191 | lib/screens/library/online/manga_list.dart:102-169 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×2
  • Edited copy of a member (43 corresponding lines) lib/screens/search/widgets/search_widgets.dart:995 — lib/screens/search/widgets/search_widgets.dart:995-1038 | lib/screens/search/widgets/search_widgets.dart:1040-1082 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) lib/controllers/stats/stats_tracker.dart:13 — lib/controllers/stats/stats_tracker.dart:13-63 | lib/controllers/stats/stats_tracker.dart:65-107 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×2
  • Edited copy of a member (50 corresponding lines) lib/widgets/common/baked_blur_image.dart:237 — lib/widgets/common/baked_blur_image.dart:237-286 | lib/widgets/common/baked_blur_image.dart:288-347 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (50 corresponding lines) lib/controllers/services/anilist/anilist_auth.dart:210 — lib/controllers/services/anilist/anilist_auth.dart:210-259 | lib/controllers/services/mal/mal_service.dart:682-740 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×2
  • Edited copy of a member (49 corresponding lines) lib/widgets/media_items/media_peek_popup.dart:1220 — lib/widgets/media_items/media_peek_popup.dart:1220-1268 | lib/widgets/non_widgets/reasons_sheet.dart:900-948 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) lib/widgets/media_items/media_peek_popup.dart:923 — lib/widgets/media_items/media_peek_popup.dart:923-971 | lib/widgets/non_widgets/reasons_sheet.dart:772-820 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) lib/screens/settings/sub_settings/player/settings_player_engine.dart:80 — lib/screens/settings/sub_settings/player/settings_player_engine.dart:80-115 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:142-213 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) lib/screens/profile/profile_page.dart:139 — lib/screens/profile/profile_page.dart:139-180 | lib/screens/profile/user_profile_page.dart:239-274 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 23+ corresponding lines) lib/database/comments/model/user_customization.dart:156 — lib/database/comments/model/user_customization.dart:156-181 | lib/database/comments/model/user_customization.dart:183-208 | lib/database/comments/model/user_customization.dart:210-232 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) lib/controllers/services/anilist/anilist_data.dart:276 — lib/controllers/services/anilist/anilist_data.dart:276-298 | lib/controllers/services/anilist/anilist_data.dart:300-322 | lib/controllers/services/mal/mal_service.dart:123-150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) lib/screens/downloads/widgets/downloaded_media_view.dart:1285 — lib/screens/downloads/widgets/downloaded_media_view.dart:1285-1319 | lib/screens/local_source/local_source_view.dart:452-490 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) lib/screens/novel/reader/widgets/dictionary_popup.dart:125 — lib/screens/novel/reader/widgets/dictionary_popup.dart:125-160 | lib/screens/novel/reader/widgets/settings_view.dart:107-141 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) lib/screens/settings/sub_settings/player/settings_player_engine.dart:239 — lib/screens/settings/sub_settings/player/settings_player_engine.dart:239-251 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:253-265 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:267-279 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) lib/screens/extensions/ExtensionItem.dart:41 — lib/screens/extensions/ExtensionItem.dart:41-53 | lib/screens/extensions/ExtensionItem.dart:55-68 | lib/screens/extensions/ExtensionItem.dart:70-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) version_manager.dart:299 — version_manager.dart:299-310 | version_manager.dart:312-323 | version_manager.dart:325-336 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:189 — lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:189-201 | lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:203-214 | lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:216-227 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) lib/database/comments/comments_db.dart:39 — lib/database/comments/comments_db.dart:39-44 | lib/services/commentum_service.dart:236-241 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) lib/widgets/common/cards/media_card_registry.dart:44 — lib/widgets/common/cards/media_card_registry.dart:44-49 | lib/widgets/common/navbar/navbar_registry.dart:37-42 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (78 lines × 2) · ×2
  • Duplicated block (78 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:829 — lib/screens/anime/widgets/episode_list_builder.dart:829-906 | lib/screens/manga/widgets/chapter_list_builder.dart:355-432 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 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 (78 lines × 2) lib/screens/library/online/anime_list.dart:772 — lib/screens/library/online/anime_list.dart:772-849 | lib/screens/library/online/manga_list.dart:757-834 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:772` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×2
  • Duplicated block (45 lines × 2) lib/screens/anime/watch/watch_view.dart:206 — lib/screens/anime/watch/watch_view.dart:206-250 | lib/screens/local_source/player/offline_player.dart:130-174 — before extracting anything, compare `lib/screens/anime/watch/watch_view.dart` and `lib/screens/local_source/player/offline_player.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/watch_view.dart:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/watch/watch_view.dart:205` calls `BufferingOverlay` and `lib/screens/local_source/player/offline_player.dart:129` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (45 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1469 — lib/screens/anime/widgets/comments/comments_section.dart:1469-1513 | lib/screens/anime/widgets/comments/comments_section.dart:1803-1847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1469` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×2
  • Duplicated block (44 lines × 2) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:312 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:312-355 | lib/widgets/common/anymex_slider_m3.dart:341-384 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart` and `lib/widgets/common/anymex_slider_m3.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 237 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 (44 lines × 2) lib/screens/anime/widgets/episode_section.dart:270 — lib/screens/anime/widgets/episode_section.dart:270-313 | lib/screens/manga/widgets/chapter_section.dart:270-313 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_section.dart:270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `BuildContext` in one and `context` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (43–44 lines × 2) · ×2
  • Duplicated block (43–44 lines × 2) lib/screens/library/online/anime_list.dart:342 — lib/screens/library/online/anime_list.dart:342-384 | lib/screens/library/online/manga_list.dart:325-368 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (43–44 lines × 2) lib/screens/profile/profile_page.dart:880 — lib/screens/profile/profile_page.dart:880-922 | lib/screens/profile/user_profile_page.dart:841-884 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:880` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×2
  • Duplicated block (43 lines × 2) lib/screens/anime/widgets/anime_stats.dart:228 — lib/screens/anime/widgets/anime_stats.dart:228-270 | lib/screens/manga/widgets/manga_stats.dart:681-723 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (43 lines × 2) lib/screens/settings/sub_settings/settings_moderation.dart:333 — lib/screens/settings/sub_settings/settings_moderation.dart:333-375 | lib/screens/settings/sub_settings/settings_moderation.dart:377-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/settings/sub_settings/settings_moderation.dart:331` calls `Row` and `lib/screens/settings/sub_settings/settings_moderation.dart:376` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×2
  • Duplicated block (40 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:388 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:388-427 | lib/widgets/watchium/watchium_create_dialog.dart:221-260 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:388` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (40 lines × 2) lib/widgets/media_items/media_peek_popup.dart:1229 — lib/widgets/media_items/media_peek_popup.dart:1229-1268 | lib/widgets/non_widgets/reasons_sheet.dart:909-948 — before extracting anything, compare `lib/widgets/media_items/media_peek_popup.dart` and `lib/widgets/non_widgets/reasons_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/media_items/media_peek_popup.dart:1229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×2
  • Duplicated block (39 lines × 2) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:206 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:206-244 | lib/widgets/common/anymex_slider_m3.dart:211-249 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart` and `lib/widgets/common/anymex_slider_m3.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (39 lines × 2) lib/screens/profile/profile_page.dart:953 — lib/screens/profile/profile_page.dart:953-991 | lib/screens/profile/user_profile_page.dart:912-950 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:953` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) lib/controllers/sync/gist_sync_controller.dart:603 — lib/controllers/sync/gist_sync_controller.dart:603-640 | lib/controllers/sync/gist_sync_controller.dart:700-737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/sync/gist_sync_controller.dart:603` 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 (38 lines × 2) lib/screens/community/user_recommendations_page.dart:115 — lib/screens/community/user_recommendations_page.dart:115-152 | lib/screens/community/user_recommendations_page.dart:160-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/community/user_recommendations_page.dart:115` 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 (32–33 lines × 2) · ×2
  • Duplicated block (32–33 lines × 2) lib/controllers/services/anilist/anilist_data.dart:393 — lib/controllers/services/anilist/anilist_data.dart:393-425 | lib/controllers/services/anilist/anilist_data.dart:626-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_data.dart:393` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (32–33 lines × 2) lib/screens/profile/widgets/activity_heatmap.dart:111 — lib/screens/profile/widgets/activity_heatmap.dart:111-143 | lib/screens/stats/user_stats_page.dart:614-645 — before extracting anything, compare `lib/screens/profile/widgets/activity_heatmap.dart` and `lib/screens/stats/user_stats_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/activity_heatmap.dart:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) lib/screens/profile/widgets/decoration_closet_sheet.dart:696 — lib/screens/profile/widgets/decoration_closet_sheet.dart:696-727 | lib/screens/profile/widgets/decoration_closet_sheet.dart:1160-1191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/decoration_closet_sheet.dart:696` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (32 lines × 2) lib/screens/settings/sub_settings/settings_addons.dart:326 — lib/screens/settings/sub_settings/settings_addons.dart:326-357 | lib/screens/settings/sub_settings/settings_addons.dart:437-468 — both copies are in the same file, so extract the 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 (25–31 lines × 2) · ×2
  • Duplicated block (25–31 lines × 2) lib/screens/profile/widgets/social_tab.dart:300 — lib/screens/profile/widgets/social_tab.dart:300-330 | lib/widgets/non_widgets/activity_card.dart:383-407 — before extracting anything, compare `lib/screens/profile/widgets/social_tab.dart` and `lib/widgets/non_widgets/activity_card.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/social_tab.dart:300` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (25–31 lines × 2) lib/utils/anime_themes_api.dart:12 — lib/utils/anime_themes_api.dart:12-42 | lib/utils/anime_themes_api.dart:105-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/anime_themes_api.dart:12` 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 (28–29 lines × 2) · ×2
  • Duplicated block (28–29 lines × 2) lib/screens/library/online/anime_list.dart:302 — lib/screens/library/online/anime_list.dart:302-329 | lib/screens/profile/widgets/user_media_list_page.dart:249-277 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/profile/widgets/user_media_list_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:302` 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 (28–29 lines × 2) lib/screens/profile/profile_page.dart:803 — lib/screens/profile/profile_page.dart:803-830 | lib/screens/profile/user_profile_page.dart:761-789 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:803` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) lib/controllers/discord/discord_rpc.dart:593 — lib/controllers/discord/discord_rpc.dart:593-619 | lib/controllers/discord/discord_rpc.dart:838-864 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:593` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) lib/utils/compatibility/matchmaker.dart:738 — lib/utils/compatibility/matchmaker.dart:738-764 | lib/utils/compatibility/matchmaker.dart:997-1023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/compatibility/matchmaker.dart:738` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×2
  • Duplicated block (25 lines × 3) lib/widgets/non_widgets/reasons_sheet.dart:320 — lib/widgets/non_widgets/reasons_sheet.dart:320-344 | lib/widgets/non_widgets/recommend_sheet.dart:465-489 | lib/widgets/non_widgets/recommend_sheet.dart:512-536 — before extracting anything, compare `lib/widgets/non_widgets/reasons_sheet.dart` and `lib/widgets/non_widgets/recommend_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 159 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 (25 lines × 3) lib/screens/anime/misc/calendar.dart:380 — lib/screens/anime/misc/calendar.dart:380-404 | lib/screens/library/online/anime_list.dart:622-646 | lib/screens/library/online/manga_list.dart:606-630 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/screens/library/online/anime_list.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/calendar.dart:380` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 3) · ×2
  • Duplicated block (23–24 lines × 3) lib/screens/anime/widgets/comments/comments_section.dart:2371 — lib/screens/anime/widgets/comments/comments_section.dart:2371-2394 | lib/screens/anime/widgets/comments/comments_section.dart:2460-2482 | lib/screens/anime/widgets/comments/comments_section.dart:2544-2567 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:2371` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23–24 lines × 3) lib/screens/library/online/anime_list.dart:746 — lib/screens/library/online/anime_list.dart:746-768 | lib/screens/library/online/manga_list.dart:730-753 | lib/screens/profile/widgets/user_media_list_page.dart:627-649 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:746` 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 (23 lines × 3) · ×2
  • Duplicated block (23 lines × 3) lib/screens/anime/widgets/anime_stats.dart:305 — lib/screens/anime/widgets/anime_stats.dart:305-327 | lib/screens/anime/widgets/anime_stats.dart:368-390 | lib/screens/anime/widgets/anime_stats.dart:431-453 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:305` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (23 lines × 3) lib/screens/library/widgets/manga_card.dart:83 — lib/screens/library/widgets/manga_card.dart:83-105 | lib/screens/library/widgets/unified_history_card.dart:46-68 | lib/widgets/media_items/media_item.dart:281-303 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/manga_card.dart:83` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×2
  • Duplicated block (22–23 lines × 2) lib/screens/anime/details/media_details_page.dart:934 — lib/screens/anime/details/media_details_page.dart:934-955 | lib/screens/anime/widgets/comments/comments_section.dart:462-484 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/anime/widgets/comments/comments_section.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:934` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (22–23 lines × 2) lib/widgets/common/media_mode_selector.dart:115 — lib/widgets/common/media_mode_selector.dart:115-136 | lib/widgets/common/media_mode_selector.dart:237-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–22 lines × 3) · ×2
  • Duplicated block (20–22 lines × 3) lib/screens/downloads/widgets/downloaded_media_view.dart:620 — lib/screens/downloads/widgets/downloaded_media_view.dart:620-639 | lib/screens/downloads/widgets/downloaded_media_view.dart:1218-1239 | lib/screens/extensions/ExtensionItem.dart:253-272 — before extracting anything, compare `lib/screens/downloads/widgets/downloaded_media_view.dart` and `lib/screens/extensions/ExtensionItem.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:620` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20–22 lines × 3) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:51 — lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:51-70 | lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1316-1337 | lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1379-1400 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×2
  • Duplicated block (20–22 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:273 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:273-294 | lib/widgets/watchium/watchium_create_dialog.dart:754-773 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20–22 lines × 2) lib/screens/profile/widgets/profile_header.dart:140 — lib/screens/profile/widgets/profile_header.dart:140-161 | lib/screens/profile/widgets/profile_header.dart:849-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:140` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×2
  • Duplicated block (21 lines × 3) lib/controllers/discord/discord_rpc.dart:724 — lib/controllers/discord/discord_rpc.dart:724-744 | lib/controllers/discord/discord_rpc.dart:853-873 | lib/controllers/discord/discord_rpc.dart:972-992 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:724` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 3) lib/screens/profile/widgets/decoration_closet_sheet.dart:719 — lib/screens/profile/widgets/decoration_closet_sheet.dart:719-739 | lib/screens/profile/widgets/decoration_closet_sheet.dart:850-870 | lib/screens/profile/widgets/decoration_closet_sheet.dart:1183-1203 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/decoration_closet_sheet.dart:719` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/profile/widgets/decoration_closet_sheet.dart:718` calls `only` and `lib/screens/profile/widgets/decoration_closet_sheet.dart:849` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19–21 lines × 3) · ×2
  • Duplicated block (19–21 lines × 3) lib/screens/anime/watch/controls/top_controls.dart:174 — lib/screens/anime/watch/controls/top_controls.dart:174-193 | lib/screens/anime/watch/controls/top_controls.dart:313-333 | lib/screens/anime/watch/controls/top_controls.dart:522-540 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/top_controls.dart:174` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19–21 lines × 3) lib/screens/anime/widgets/episode_list_builder.dart:551 — lib/screens/anime/widgets/episode_list_builder.dart:551-571 | lib/screens/anime/widgets/episode_list_builder.dart:589-607 | lib/screens/anime/widgets/episode_list_builder.dart:726-744 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:551` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–21 lines × 3) · ×2
  • Duplicated block (18–21 lines × 3) lib/screens/library/online/anime_list.dart:292 — lib/screens/library/online/anime_list.dart:292-309 | lib/screens/library/online/manga_list.dart:271-288 | lib/screens/profile/widgets/user_media_list_page.dart:237-257 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–21 lines × 3) lib/screens/profile/activity_details_page.dart:620 — lib/screens/profile/activity_details_page.dart:620-637 | lib/screens/profile/widgets/social_tab.dart:274-294 | lib/widgets/non_widgets/activity_card.dart:369-386 — before extracting anything, compare `lib/screens/profile/activity_details_page.dart` and `lib/screens/profile/widgets/social_tab.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/activity_details_page.dart:620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×2
  • Duplicated block (20–21 lines × 2) lib/screens/anime/details/media_details_page.dart:1276 — lib/screens/anime/details/media_details_page.dart:1276-1296 | lib/widgets/common/home_continue_button.dart:151-170 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (20–21 lines × 2) lib/screens/anime/watch/controls/top_controls.dart:383 — lib/screens/anime/watch/controls/top_controls.dart:383-403 | lib/screens/anime/watch/controls/top_controls.dart:462-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/top_controls.dart:383` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×2
  • Duplicated block (20 lines × 4) lib/models/notification/notification_item.dart:107 — lib/models/notification/notification_item.dart:107-126 | lib/screens/anime/misc/list_exporter.dart:216-235 | lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1570-1589 | lib/screens/search/widgets/search_widgets.dart:36-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 4) lib/utils/color_profiler.dart:745 — lib/utils/color_profiler.dart:745-764 | lib/utils/color_profiler.dart:1002-1021 | lib/utils/color_profiler.dart:1165-1184 | lib/utils/color_profiler.dart:1356-1375 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/color_profiler.dart:745` 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 (19–20 lines × 4) · ×2
  • Duplicated block (19–20 lines × 4) lib/screens/downloads/controller/download_controller.dart:2612 — lib/screens/downloads/controller/download_controller.dart:2612-2631 | lib/screens/downloads/controller/download_controller.dart:2659-2678 | lib/screens/downloads/controller/download_controller.dart:2758-2776 | lib/screens/downloads/controller/download_controller.dart:2803-2821 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:2612` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19–20 lines × 4) lib/screens/library/editor/list_editor.dart:548 — lib/screens/library/editor/list_editor.dart:548-567 | lib/screens/local_source/local_source_view.dart:831-849 | lib/screens/local_source/local_source_view.dart:884-902 | lib/screens/local_source/local_source_view.dart:936-954 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/list_editor.dart:548` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×2
  • Duplicated block (16–20 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:1009 — lib/screens/profile/compatibility/compatibility_result_page.dart:1009-1024 | lib/screens/profile/compatibility/compatibility_result_page.dart:1858-1877 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/compatibility/compatibility_result_page.dart:1858` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–20 lines × 2) lib/utils/color_profiler.dart:667 — lib/utils/color_profiler.dart:667-682 | lib/utils/color_profiler.dart:854-873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/color_profiler.dart:667` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×2
  • Duplicated block (15–19 lines × 2) lib/main.dart:768 — lib/main.dart:768-786 | lib/widgets/header/header.dart:401-415 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/main.dart:768` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–19 lines × 2) lib/screens/anime/studio_details_page.dart:313 — lib/screens/anime/studio_details_page.dart:313-327 | lib/screens/anime/widgets/character_staff_sheet.dart:826-844 — before extracting anything, compare `lib/screens/anime/studio_details_page.dart` and `lib/screens/anime/widgets/character_staff_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×2
  • Duplicated block (14–16 lines × 2) lib/database/kv_helper.dart:35 — lib/database/kv_helper.dart:35-48 | lib/database/kv_helper.dart:75-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–16 lines × 2) lib/widgets/common/cards/styles/exotic_card.dart:151 — lib/widgets/common/cards/styles/exotic_card.dart:151-164 | lib/widgets/common/cards/styles/minimal_exotic_card.dart:159-174 — before extracting anything, compare `lib/widgets/common/cards/styles/exotic_card.dart` and `lib/widgets/common/cards/styles/minimal_exotic_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/cards/styles/exotic_card.dart:151` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) lib/screens/anime/misc/calendar.dart:225 — lib/screens/anime/misc/calendar.dart:225-238 | lib/screens/library/online/anime_list.dart:222-235 | lib/screens/library/online/manga_list.dart:200-213 — before extracting anything, compare `lib/screens/anime/misc/calendar.dart` and `lib/screens/library/online/anime_list.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 3) lib/utils/color_profiler.dart:817 — lib/utils/color_profiler.dart:817-830 | lib/utils/color_profiler.dart:1051-1064 | lib/utils/color_profiler.dart:1329-1342 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/color_profiler.dart:817` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×2
  • Duplicated block (11 lines × 4) lib/screens/anime/widgets/episode_list_builder.dart:1254 — lib/screens/anime/widgets/episode_list_builder.dart:1254-1264 | lib/screens/anime/widgets/episode_list_builder.dart:1342-1352 | lib/screens/manga/widgets/chapter_list_builder.dart:1373-1383 | lib/screens/manga/widgets/chapter_list_builder.dart:1452-1462 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 4) lib/screens/downloads/widgets/downloaded_media_view.dart:607 — lib/screens/downloads/widgets/downloaded_media_view.dart:607-617 | lib/screens/downloads/widgets/downloaded_media_view.dart:994-1005 | lib/screens/downloads/widgets/downloaded_media_view.dart:1205-1215 | lib/screens/extensions/ExtensionItem.dart:238-248 — before extracting anything, compare `lib/screens/downloads/widgets/downloaded_media_view.dart` and `lib/screens/extensions/ExtensionItem.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:607` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×2
  • Duplicated block (9–11 lines × 3) lib/controllers/services/anilist/anilist_auth.dart:178 — lib/controllers/services/anilist/anilist_auth.dart:178-188 | lib/controllers/services/anilist/anilist_auth.dart:346-354 | lib/controllers/services/anilist/anilist_auth.dart:402-410 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:178` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/controllers/services/anilist/anilist_auth.dart:176` calls `prefetchSettings` and `lib/controllers/services/anilist/anilist_auth.dart:345` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–11 lines × 3) lib/screens/anime/widgets/episode_list_builder.dart:1187 — lib/screens/anime/widgets/episode_list_builder.dart:1187-1195 | lib/screens/manga/widgets/chapter_list_builder.dart:1306-1314 | lib/screens/search/widgets/search_widgets.dart:2249-2259 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) lib/screens/anime/widgets/list_editor.dart:633 — lib/screens/anime/widgets/list_editor.dart:633-642 | lib/screens/anime/widgets/list_editor.dart:752-761 | lib/widgets/common/source_selector.dart:639-649 | lib/widgets/header/header.dart:586-596 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/list_editor.dart:633` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 4) lib/screens/downloads/widgets/downloaded_media_view.dart:629 — lib/screens/downloads/widgets/downloaded_media_view.dart:629-638 | lib/screens/downloads/widgets/downloaded_media_view.dart:1019-1028 | lib/screens/downloads/widgets/downloaded_media_view.dart:1229-1238 | lib/screens/extensions/ExtensionItem.dart:262-271 — before extracting anything, compare `lib/screens/downloads/widgets/downloaded_media_view.dart` and `lib/screens/extensions/ExtensionItem.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/downloaded_media_view.dart:629` 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 (8–9 lines × 3) · ×2
  • Duplicated block (8–9 lines × 3) lib/screens/extensions/ExtensionScreen.dart:416 — lib/screens/extensions/ExtensionScreen.dart:416-423 | lib/screens/extensions/ExtensionScreen.dart:448-456 | lib/screens/extensions/ExtensionScreen.dart:542-550 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8–9 lines × 3) lib/screens/settings/sub_settings/player/settings_player_controls.dart:398 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:398-405 | lib/screens/settings/sub_settings/player/settings_player_controls.dart:519-527 | lib/screens/settings/sub_settings/settings_reader.dart:554-561 — before extracting anything, compare `lib/screens/settings/sub_settings/player/settings_player_controls.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_controls.dart:398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×2
  • Duplicated block (7–9 lines × 2) lib/screens/extensions/widgets/plugin_manager.dart:123 — lib/screens/extensions/widgets/plugin_manager.dart:123-131 | lib/screens/extensions/widgets/plugin_manager.dart:172-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7–9 lines × 2) lib/screens/profile/compatibility/compatibility_result_page.dart:915 — lib/screens/profile/compatibility/compatibility_result_page.dart:915-923 | lib/screens/profile/compatibility/compatibility_result_page.dart:981-987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) lib/screens/anime/widgets/anime_stats.dart:605 — lib/screens/anime/widgets/anime_stats.dart:605-615 | lib/screens/anime/widgets/anime_stats.dart:731-740 | lib/screens/manga/widgets/manga_stats.dart:308-318 | lib/screens/manga/widgets/manga_stats.dart:773-782 | lib/screens/profile/widgets/profile_stats_tab.dart:428-435 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:605` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 5) lib/screens/anime/widgets/episode_list_builder.dart:1253 — lib/screens/anime/widgets/episode_list_builder.dart:1253-1260 | lib/screens/anime/widgets/episode_list_builder.dart:1341-1348 | lib/screens/manga/widgets/chapter_list_builder.dart:1372-1379 | lib/screens/manga/widgets/chapter_list_builder.dart:1451-1458 | lib/widgets/watchium/watchium_party_popup.dart:553-561 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×2
  • Duplicated block (7–8 lines × 3) lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:197 — lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:197-204 | lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:246-253 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:171-177 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 3) lib/screens/local_source/controller/local_source_controller.dart:320 — lib/screens/local_source/controller/local_source_controller.dart:320-327 | lib/screens/local_source/controller/local_source_controller.dart:329-336 | lib/screens/local_source/controller/local_source_controller.dart:337-343 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/controller/local_source_controller.dart:320` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) lib/screens/anime/widgets/comments/comments_section.dart:3169 — lib/screens/anime/widgets/comments/comments_section.dart:3169-3174 | lib/screens/anime/widgets/comments/comments_section.dart:3179-3184 | lib/screens/settings/sub_settings/settings_moderation.dart:1779-1784 | lib/screens/settings/sub_settings/settings_moderation.dart:1796-1801 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/settings/sub_settings/settings_moderation.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/screens/anime/widgets/comments/comments_section.dart:3175` calls `toString` and `lib/screens/settings/sub_settings/settings_moderation.dart:1785` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 4) lib/controllers/offline/offline_storage_controller.dart:700 — lib/controllers/offline/offline_storage_controller.dart:700-705 | lib/controllers/offline/offline_storage_controller.dart:765-770 | lib/controllers/offline/offline_storage_controller.dart:922-927 | lib/screens/manga/controller/reader_controller.dart:843-848 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/offline/offline_storage_controller.dart:700` 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.
C2 · Access Controls · No authorization · ×1
  • No authorization lib/services/cast/cast_proxy_server.dart:29 — This repository serves requests — an HTTP server (HttpServer.bind) (lib/services/cast/cast_proxy_server.dart:29) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected.
D1 · Cyclomatic Complexity · Media.fromSimkl (cyclomatic 101) · ×1
  • Media.fromSimkl (cyclomatic 101) lib/models/Media/media.dart:559 — Media.fromSimkl has cyclomatic complexity 101 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TachiyomiBackupParser.parseBytes (cyclomatic 90) · ×1
  • TachiyomiBackupParser.parseBytes (cyclomatic 90) lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:31 — TachiyomiBackupParser.parseBytes has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CharacterStaffSheetContentState.build (cyclomatic 78) · ×1
  • _CharacterStaffSheetContentState.build (cyclomatic 78) lib/screens/anime/widgets/character_staff_sheet.dart:140 — _CharacterStaffSheetContentState.build has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceMapper.mapMedia (cyclomatic 74) · ×1
  • SourceMapper.mapMedia (cyclomatic 74) lib/controllers/source/source_mapper.dart:86 — SourceMapper.mapMedia 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 · Media.fromJson (cyclomatic 66) · ×1
  • Media.fromJson (cyclomatic 66) lib/models/Media/media.dart:1128 — Media.fromJson has cyclomatic complexity 66 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BackupRestoreService._applyExternalMangaAndAnime (cyclomatic 63) · ×1
  • BackupRestoreService._applyExternalMangaAndAnime (cyclomatic 63) lib/controllers/services/backup_restore/backup_restore_service.dart:1679 — BackupRestoreService._applyExternalMangaAndAnime has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BackupRestoreService._applyBackupData (cyclomatic 62) · ×1
  • BackupRestoreService._applyBackupData (cyclomatic 62) lib/controllers/services/backup_restore/backup_restore_service.dart:581 — BackupRestoreService._applyBackupData has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DownloadController._syncMediaFolderMeta (cyclomatic 56) · ×1
  • DownloadController._syncMediaFolderMeta (cyclomatic 56) lib/screens/downloads/controller/download_controller.dart:2337 — DownloadController._syncMediaFolderMeta 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 · PlayerController._bindPlayerStreams (cyclomatic 54) · ×1
  • PlayerController._bindPlayerStreams (cyclomatic 54) lib/screens/anime/watch/controller/player_controller.dart:1303 — PlayerController._bindPlayerStreams has cyclomatic complexity 54 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Media.fromFullMAL (cyclomatic 52) · ×1
  • Media.fromFullMAL (cyclomatic 52) lib/models/Media/media.dart:397 — Media.fromFullMAL has cyclomatic complexity 52 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _UserProfileHeaderState.build (cyclomatic 52) · ×1
  • _UserProfileHeaderState.build (cyclomatic 52) lib/screens/profile/widgets/user_profile_header.dart:62 — _UserProfileHeaderState.build has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KotatsuBackupParser.parse (cyclomatic 51) · ×1
  • KotatsuBackupParser.parse (cyclomatic 51) lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:18 — KotatsuBackupParser.parse 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 · MediaHeader.build (cyclomatic 51) · ×1
  • MediaHeader.build (cyclomatic 51) lib/widgets/anime/media_header.dart:46 — MediaHeader.build has cyclomatic complexity 51 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BackupRestoreService.getBackupInfo (cyclomatic 49) · ×1
  • BackupRestoreService.getBackupInfo (cyclomatic 49) lib/controllers/services/backup_restore/backup_restore_service.dart:1331 — BackupRestoreService.getBackupInfo 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 · ReaderSettings.showSettings (cyclomatic 48) · ×1
  • ReaderSettings.showSettings (cyclomatic 48) lib/screens/manga/widgets/reader/settings_view.dart:19 — ReaderSettings.showSettings has cyclomatic complexity 48 (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 · Media.fromMAL (cyclomatic 46) · ×1
  • Media.fromMAL (cyclomatic 46) lib/models/Media/media.dart:192 — Media.fromMAL has cyclomatic complexity 46 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _CommentsRepliesSheetState._buildCommentCard (cyclomatic 45) · ×1
  • _CommentsRepliesSheetState._buildCommentCard (cyclomatic 45) lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:159 — _CommentsRepliesSheetState._buildCommentCard has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DubService.fetchDubSources (cyclomatic 43) · ×1
  • DubService.fetchDubSources (cyclomatic 43) lib/screens/anime/misc/dub_service.dart:10 — DubService.fetchDubSources 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 · DownloadController._mergeMediaDirectory (cyclomatic 43) · ×1
  • DownloadController._mergeMediaDirectory (cyclomatic 43) lib/screens/downloads/controller/download_controller.dart:2019 — DownloadController._mergeMediaDirectory 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 · _SettingsExtensionManagerState._buildPluginStatusCard (cyclomatic 42) · ×1
  • _SettingsExtensionManagerState._buildPluginStatusCard (cyclomatic 42) lib/screens/settings/sub_settings/settings_extension_manager.dart:449 — _SettingsExtensionManagerState._buildPluginStatusCard has cyclomatic complexity 42 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MediaDetailsController._fetchContentFromSource (cyclomatic 40) · ×1
  • MediaDetailsController._fetchContentFromSource (cyclomatic 40) lib/screens/anime/details/controller/media_details_controller.dart:561 — MediaDetailsController._fetchContentFromSource 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 · _ControlButtonState.build (cyclomatic 40) · ×1
  • _ControlButtonState.build (cyclomatic 40) lib/screens/anime/watch/controls/widgets/control_button.dart:76 — _ControlButtonState.build has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _AnilistAboutMeState.build (cyclomatic 40) · ×1
  • _AnilistAboutMeState.build (cyclomatic 40) lib/utils/al_about_me.dart:205 — _AnilistAboutMeState.build has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Media.fromSmallJson (cyclomatic 39) · ×1
  • Media.fromSmallJson (cyclomatic 39) lib/models/Media/media.dart:1393 — Media.fromSmallJson has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _MediaDetailsPageState.build (cyclomatic 39) · ×1
  • _MediaDetailsPageState.build (cyclomatic 39) lib/screens/anime/details/media_details_page.dart:266 — _MediaDetailsPageState.build has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _UserSearchSheetState.build (cyclomatic 39) · ×1
  • _UserSearchSheetState.build (cyclomatic 39) lib/screens/settings/sub_settings/settings_moderation.dart:303 — _UserSearchSheetState.build has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TrackedMedia.effectiveProgress (cyclomatic 38) · ×1
  • TrackedMedia.effectiveProgress (cyclomatic 38) lib/models/Anilist/anilist_media_user.dart:54 — TrackedMedia.effectiveProgress 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 · MediaDetailsController.getContinueChapter (cyclomatic 38) · ×1
  • MediaDetailsController.getContinueChapter (cyclomatic 38) lib/screens/anime/details/controller/media_details_controller.dart:1027 — MediaDetailsController.getContinueChapter 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 · _ActiveDownloadsState._buildMediaExpandableCard (cyclomatic 36) · ×1
  • _ActiveDownloadsState._buildMediaExpandableCard (cyclomatic 36) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:171 — _ActiveDownloadsState._buildMediaExpandableCard has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _DownloadedMediaViewState._buildContinueFab (cyclomatic 36) · ×1
  • _DownloadedMediaViewState._buildContinueFab (cyclomatic 36) lib/screens/downloads/widgets/downloaded_media_view.dart:239 — _DownloadedMediaViewState._buildContinueFab 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 · _UserProfilePageState._buildBody (cyclomatic 36) · ×1
  • _UserProfilePageState._buildBody (cyclomatic 36) lib/screens/profile/user_profile_page.dart:333 — _UserProfilePageState._buildBody has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _RestorePreviewSheetState._buildGroupedOptions (cyclomatic 36) · ×1
  • _RestorePreviewSheetState._buildGroupedOptions (cyclomatic 36) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:592 — _RestorePreviewSheetState._buildGroupedOptions 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 · ActivityComposerSheetState.build (cyclomatic 36) · ×1
  • ActivityComposerSheetState.build (cyclomatic 36) lib/widgets/non_widgets/activity_composer_sheet.dart:438 — ActivityComposerSheetState.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 · AnilistData.fetchFilterData (cyclomatic 35) · ×1
  • AnilistData.fetchFilterData (cyclomatic 35) lib/controllers/services/anilist/anilist_data.dart:1409 — AnilistData.fetchFilterData 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 · _DownloadScreenState._buildEpisodeStep (cyclomatic 34) · ×1
  • _DownloadScreenState._buildEpisodeStep (cyclomatic 34) lib/screens/downloads/download_screen.dart:870 — _DownloadScreenState._buildEpisodeStep has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReaderController.handleMouseScroll (cyclomatic 34) · ×1
  • ReaderController.handleMouseScroll (cyclomatic 34) lib/screens/manga/controller/reader_controller.dart:1195 — ReaderController.handleMouseScroll 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 · _ProfilePageState._buildBody (cyclomatic 34) · ×1
  • _ProfilePageState._buildBody (cyclomatic 34) lib/screens/profile/profile_page.dart:240 — _ProfilePageState._buildBody has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BackupRestoreService._buildBackupData (cyclomatic 33) · ×1
  • BackupRestoreService._buildBackupData (cyclomatic 33) lib/controllers/services/backup_restore/backup_restore_service.dart:448 — BackupRestoreService._buildBackupData 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 · _UserProfileAppBarState.build (cyclomatic 33) · ×1
  • _UserProfileAppBarState.build (cyclomatic 33) lib/screens/profile/widgets/user_profile_app_bar.dart:60 — _UserProfileAppBarState.build has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _RecommendSheetState._buildAlreadyAdded (cyclomatic 33) · ×1
  • _RecommendSheetState._buildAlreadyAdded (cyclomatic 33) lib/widgets/non_widgets/recommend_sheet.dart:709 — _RecommendSheetState._buildAlreadyAdded 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 · CookieManager.parseSingleCookie (cyclomatic 32) · ×1
  • CookieManager.parseSingleCookie (cyclomatic 32) lib/controllers/network/cookie_manager.dart:268 — CookieManager.parseSingleCookie 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 · _MediaDetailsPageState._buildContinueButton (cyclomatic 32) · ×1
  • _MediaDetailsPageState._buildContinueButton (cyclomatic 32) lib/screens/anime/details/media_details_page.dart:1130 — _MediaDetailsPageState._buildContinueButton 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 · ThemeRenderer._doAction (cyclomatic 32) · ×1
  • ThemeRenderer._doAction (cyclomatic 32) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1167 — ThemeRenderer._doAction has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ThemeRenderer._getDynamicColor (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _BackupRestorePageState._buildImportSection (cyclomatic 32) · ×1
  • _BackupRestorePageState._buildImportSection (cyclomatic 32) lib/screens/settings/sub_settings/settings_backup.dart:405 — _BackupRestorePageState._buildImportSection 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 · _SubsamplingScaleImageViewState.build (cyclomatic 31) · ×1
  • _SubsamplingScaleImageViewState.build (cyclomatic 31) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:1397 — _SubsamplingScaleImageViewState.build has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MainActivity.configureFlutterEngine (cyclomatic 31) · ×1
  • MainActivity.configureFlutterEngine (cyclomatic 31) android/app/src/main/kotlin/com/ryan/anymex/MainActivity.kt:81 — MainActivity.configureFlutterEngine 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 · KvHelper.get (cyclomatic 30) · ×1
  • KvHelper.get (cyclomatic 30) lib/database/kv_helper.dart:32 — KvHelper.get 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 · BottomControls._buildLayout (cyclomatic 30) · ×1
  • BottomControls._buildLayout (cyclomatic 30) lib/screens/anime/watch/controls/bottom_controls.dart:226 — BottomControls._buildLayout 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 · _CommentSectionState._showUserHistoryDialog (cyclomatic 30) · ×1
  • _CommentSectionState._showUserHistoryDialog (cyclomatic 30) lib/screens/anime/widgets/comments/comments_section.dart:3538 — _CommentSectionState._showUserHistoryDialog has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _ActiveDownloadsState._buildChildTaskCard (cyclomatic 30) · ×1
  • _ActiveDownloadsState._buildChildTaskCard (cyclomatic 30) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:515 — _ActiveDownloadsState._buildChildTaskCard 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 · MobileProfileHeaderSliver.build (cyclomatic 30) · ×1
  • MobileProfileHeaderSliver.build (cyclomatic 30) lib/screens/profile/widgets/profile_header.dart:583 — MobileProfileHeaderSliver.build has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SearchPageState._performSearch (cyclomatic 30) · ×1
  • _SearchPageState._performSearch (cyclomatic 30) lib/screens/search/search_view.dart:228 — _SearchPageState._performSearch 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 · AnymeXSheet.build (cyclomatic 30) · ×1
  • AnymeXSheet.build (cyclomatic 30) lib/widgets/anymex_widgets/anymex_bottomsheet.dart:137 — AnymeXSheet.build has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OfflineStorageController.addOrUpdateAnime (cyclomatic 29) · ×1
  • OfflineStorageController.addOrUpdateAnime (cyclomatic 29) lib/controllers/offline/offline_storage_controller.dart:624 — OfflineStorageController.addOrUpdateAnime 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 · CompatibilityController.runMatch (cyclomatic 29) · ×1
  • CompatibilityController.runMatch (cyclomatic 29) lib/controllers/services/anilist/compatibility_controller.dart:30 — CompatibilityController.runMatch 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 · BackupRestoreService.restoreBackup (cyclomatic 29) · ×1
  • BackupRestoreService.restoreBackup (cyclomatic 29) lib/controllers/services/backup_restore/backup_restore_service.dart:1157 — BackupRestoreService.restoreBackup 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 · MediaDetailsController._initOfflineAndTrackedData (cyclomatic 29) · ×1
  • MediaDetailsController._initOfflineAndTrackedData (cyclomatic 29) lib/screens/anime/details/controller/media_details_controller.dart:377 — MediaDetailsController._initOfflineAndTrackedData 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 · _CommentSectionState._buildCommentItem (cyclomatic 29) · ×1
  • _CommentSectionState._buildCommentItem (cyclomatic 29) lib/screens/anime/widgets/comments/comments_section.dart:1745 — _CommentSectionState._buildCommentItem has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _UserStatsPageState._buildHeatmapSection (cyclomatic 29) · ×1
  • _UserStatsPageState._buildHeatmapSection (cyclomatic 29) lib/screens/stats/user_stats_page.dart:550 — _UserStatsPageState._buildHeatmapSection 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 · _VisualsPopupState._saveImage (cyclomatic 29) · ×1
  • _VisualsPopupState._saveImage (cyclomatic 29) lib/widgets/anime/visuals/visuals_popup.dart:162 — _VisualsPopupState._saveImage 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 · _FullscreenImageViewerState._saveImage (cyclomatic 29) · ×1
  • _FullscreenImageViewerState._saveImage (cyclomatic 29) lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:27 — _FullscreenImageViewerState._saveImage 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 · AnymeXTile.build (cyclomatic 29) · ×1
  • AnymeXTile.build (cyclomatic 29) lib/widgets/anymex_widgets/anymex_tile.dart:620 — AnymeXTile.build has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MediaModeSelector.build (cyclomatic 29) · ×1
  • MediaModeSelector.build (cyclomatic 29) lib/widgets/common/media_mode_selector.dart:109 — MediaModeSelector.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 · OfflineStorageController.addMedia (cyclomatic 28) · ×1
  • OfflineStorageController.addMedia (cyclomatic 28) lib/controllers/offline/offline_storage_controller.dart:547 — OfflineStorageController.addMedia 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 · OfflineStorageController.addOrUpdateManga (cyclomatic 28) · ×1
  • OfflineStorageController.addOrUpdateManga (cyclomatic 28) lib/controllers/offline/offline_storage_controller.dart:690 — OfflineStorageController.addOrUpdateManga has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OfflineStorageController.addOrUpdateNovel) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · OfflineStorageController.addOrUpdateNovel (cyclomatic 28) · ×1
  • OfflineStorageController.addOrUpdateNovel (cyclomatic 28) lib/controllers/offline/offline_storage_controller.dart:754 — OfflineStorageController.addOrUpdateNovel has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OfflineStorageController.addOrUpdateManga) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · _LeaderboardSheetState._buildLeaderboardTile (cyclomatic 28) · ×1
  • _LeaderboardSheetState._buildLeaderboardTile (cyclomatic 28) lib/screens/anime/widgets/comments/widgets/leaderboard_sheet.dart:324 — _LeaderboardSheetState._buildLeaderboardTile has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DesktopProfileHeader.build (cyclomatic 28) · ×1
  • DesktopProfileHeader.build (cyclomatic 28) lib/screens/profile/widgets/profile_header.dart:72 — DesktopProfileHeader.build has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NotificationService._navigateFromNotification (cyclomatic 28) · ×1
  • NotificationService._navigateFromNotification (cyclomatic 28) lib/utils/notification.dart:345 — NotificationService._navigateFromNotification 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 · _ActivityCardState.build (cyclomatic 28) · ×1
  • _ActivityCardState.build (cyclomatic 28) lib/widgets/non_widgets/activity_card.dart:522 — _ActivityCardState.build has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ActivityComposerSheetState._buildFormatButton (cyclomatic 28) · ×1
  • ActivityComposerSheetState._buildFormatButton (cyclomatic 28) lib/widgets/non_widgets/activity_composer_sheet.dart:191 — ActivityComposerSheetState._buildFormatButton 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 · AnilistData.anilistSearch (cyclomatic 27) · ×1
  • AnilistData.anilistSearch (cyclomatic 27) lib/controllers/services/anilist/anilist_data.dart:1098 — AnilistData.anilistSearch 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 · _SyncSubsContentState._buildCueViewer (cyclomatic 27) · ×1
  • _SyncSubsContentState._buildCueViewer (cyclomatic 27) lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:194 — _SyncSubsContentState._buildCueViewer 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 · _WrongTitleModalState.build (cyclomatic 27) · ×1
  • _WrongTitleModalState.build (cyclomatic 27) lib/screens/anime/widgets/wrongtitle_modal.dart:87 — _WrongTitleModalState.build has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DownloadController.resyncDownloads (cyclomatic 27) · ×1
  • DownloadController.resyncDownloads (cyclomatic 27) lib/screens/downloads/controller/download_controller.dart:2230 — DownloadController.resyncDownloads 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 · ReaderController._onPositionChanged (cyclomatic 27) · ×1
  • ReaderController._onPositionChanged (cyclomatic 27) lib/screens/manga/controller/reader_controller.dart:1322 — ReaderController._onPositionChanged 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 · _ReadingModePage.build (cyclomatic 27) · ×1
  • _ReadingModePage.build (cyclomatic 27) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:163 — _ReadingModePage.build has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _ProfilePageState._buildOverviewTab (cyclomatic 27) · ×1
  • _ProfilePageState._buildOverviewTab (cyclomatic 27) lib/screens/profile/profile_page.dart:946 — _ProfilePageState._buildOverviewTab 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 · _UserProfilePageState._buildOverviewTab (cyclomatic 27) · ×1
  • _UserProfilePageState._buildOverviewTab (cyclomatic 27) lib/screens/profile/user_profile_page.dart:908 — _UserProfilePageState._buildOverviewTab 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 · _FuturisticFilterSheetState._loadCurrentFilters (cyclomatic 27) · ×1
  • _FuturisticFilterSheetState._loadCurrentFilters (cyclomatic 27) lib/screens/search/widgets/search_widgets.dart:520 — _FuturisticFilterSheetState._loadCurrentFilters 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 · MangaAnimeUtil.getNextChapterPrediction (cyclomatic 27) · ×1
  • MangaAnimeUtil.getNextChapterPrediction (cyclomatic 27) lib/utils/anime_adaptation_util.dart:98 — MangaAnimeUtil.getNextChapterPrediction 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 · _BakedBlurImageState._requestBackdrop (cyclomatic 27) · ×1
  • _BakedBlurImageState._requestBackdrop (cyclomatic 27) lib/widgets/common/baked_blur_image.dart:375 — _BakedBlurImageState._requestBackdrop 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 · _FilterScreenState._getNavItemForTab (cyclomatic 26) · ×1
  • _FilterScreenState._getNavItemForTab (cyclomatic 26) lib/main.dart:576 — _FilterScreenState._getNavItemForTab 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 · BackupRestoreService.exportBackupToExternal (cyclomatic 26) · ×1
  • BackupRestoreService.exportBackupToExternal (cyclomatic 26) lib/controllers/services/backup_restore/backup_restore_service.dart:924 — BackupRestoreService.exportBackupToExternal 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 · ReaderController._initTracking (cyclomatic 26) · ×1
  • ReaderController._initTracking (cyclomatic 26) lib/screens/manga/controller/reader_controller.dart:1544 — ReaderController._initTracking 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 · _CompatibilityResultPageState._buildSectionGrid (cyclomatic 26) · ×1
  • _CompatibilityResultPageState._buildSectionGrid (cyclomatic 26) lib/screens/profile/compatibility/compatibility_result_page.dart:621 — _CompatibilityResultPageState._buildSectionGrid 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 · _SettingsPerformanceState.build (cyclomatic 26) · ×1
  • _SettingsPerformanceState.build (cyclomatic 26) lib/screens/settings/sub_settings/settings_performance.dart:98 — _SettingsPerformanceState.build has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _AnymeXExpansionTileState.build (cyclomatic 26) · ×1
  • _AnymeXExpansionTileState.build (cyclomatic 26) lib/widgets/anymex_widgets/anymex_expansion_tile.dart:109 — _AnymeXExpansionTileState.build has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnymeXTileBuilder.build (cyclomatic 26) · ×1
  • AnymeXTileBuilder.build (cyclomatic 26) lib/widgets/anymex_widgets/anymex_tile_builder.dart:63 — AnymeXTileBuilder.build has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BackupFormatDetector.detectFromBytes (cyclomatic 25) · ×1
  • BackupFormatDetector.detectFromBytes (cyclomatic 25) lib/controllers/services/backup_restore/backup_format_detector.dart:15 — BackupFormatDetector.detectFromBytes has cyclomatic complexity 25 (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 · Character.fromJson (cyclomatic 25) · ×1
  • Character.fromJson (cyclomatic 25) lib/models/Media/character.dart:38 — Character.fromJson 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 · AnimeTheme.fromJson (cyclomatic 25) · ×1
  • AnimeTheme.fromJson (cyclomatic 25) lib/models/animethemes/anime_theme.dart:20 — AnimeTheme.fromJson 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 · PlayerController._trackOnline (cyclomatic 25) · ×1
  • PlayerController._trackOnline (cyclomatic 25) lib/screens/anime/watch/controller/player_controller.dart:3050 — PlayerController._trackOnline 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 · _ListEditorModalState.initState (cyclomatic 25) · ×1
  • _ListEditorModalState.initState (cyclomatic 25) lib/screens/anime/widgets/list_editor.dart:157 — _ListEditorModalState.initState 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 · DownloadController._onForegroundReceiveData (cyclomatic 25) · ×1
  • DownloadController._onForegroundReceiveData (cyclomatic 25) lib/screens/downloads/controller/download_controller.dart:486 — DownloadController._onForegroundReceiveData 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 · _HomePageState._buildNewEpisodesSection (cyclomatic 25) · ×1
  • _HomePageState._buildNewEpisodesSection (cyclomatic 25) lib/screens/home_page.dart:40 — _HomePageState._buildNewEpisodesSection 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 · _ChapterListBuilderState._buildChapterDownloadButton (cyclomatic 25) · ×1
  • _ChapterListBuilderState._buildChapterDownloadButton (cyclomatic 25) lib/screens/manga/widgets/chapter_list_builder.dart:1217 — _ChapterListBuilderState._buildChapterDownloadButton 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 · _PressableHighlightCardState.build (cyclomatic 25) · ×1
  • _PressableHighlightCardState.build (cyclomatic 25) lib/screens/profile/widgets/stats_overview_cards.dart:460 — _PressableHighlightCardState.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 · _FuturisticFilterSheetState._applyFilters (cyclomatic 25) · ×1
  • _FuturisticFilterSheetState._applyFilters (cyclomatic 25) lib/screens/search/widgets/search_widgets.dart:2345 — _FuturisticFilterSheetState._applyFilters 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 · _SettingsUiDetailsState._buildLivePreviewCard (cyclomatic 25) · ×1
  • _SettingsUiDetailsState._buildLivePreviewCard (cyclomatic 25) lib/screens/settings/sub_settings/settings_ui_details.dart:354 — _SettingsUiDetailsState._buildLivePreviewCard 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 · _WatchiumPageState._buildRoomCard (cyclomatic 25) · ×1
  • _WatchiumPageState._buildRoomCard (cyclomatic 25) lib/screens/watchium/watchium_page.dart:1137 — _WatchiumPageState._buildRoomCard 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 · Matchmaker._computeReleaseYearOverlap (cyclomatic 25) · ×1
  • Matchmaker._computeReleaseYearOverlap (cyclomatic 25) lib/utils/compatibility/matchmaker.dart:584 — Matchmaker._computeReleaseYearOverlap 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 · AnymeXSectionBuilder.build (cyclomatic 25) · ×1
  • AnymeXSectionBuilder.build (cyclomatic 25) lib/widgets/anymex_widgets/anymex_section_builder.dart:63 — AnymeXSectionBuilder.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 · GridAnimeCard.build (cyclomatic 25) · ×1
  • GridAnimeCard.build (cyclomatic 25) lib/widgets/media_items/media_item.dart:115 — GridAnimeCard.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 · _RecommendSheetState._userHasReason (cyclomatic 25) · ×1
  • _RecommendSheetState._userHasReason (cyclomatic 25) lib/widgets/non_widgets/recommend_sheet.dart:263 — _RecommendSheetState._userHasReason 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 shape REPEATS in the file: one other method here (_RecommendSheetState._findUserReason) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · _RecommendSheetState._findUserReason (cyclomatic 25) · ×1
  • _RecommendSheetState._findUserReason (cyclomatic 25) lib/widgets/non_widgets/recommend_sheet.dart:305 — _RecommendSheetState._findUserReason 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 shape REPEATS in the file: one other method here (_RecommendSheetState._userHasReason) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · DiscordRPCController.updateAnimePresence (cyclomatic 24) · ×1
  • DiscordRPCController.updateAnimePresence (cyclomatic 24) lib/controllers/discord/discord_rpc.dart:538 — DiscordRPCController.updateAnimePresence 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 · AnilistAuth.updateListEntry (cyclomatic 24) · ×1
  • AnilistAuth.updateListEntry (cyclomatic 24) lib/controllers/services/anilist/anilist_auth.dart:2267 — AnilistAuth.updateListEntry 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 · _ChapterListSheetState.build (cyclomatic 24) · ×1
  • _ChapterListSheetState.build (cyclomatic 24) lib/screens/manga/widgets/reader/top_controls.dart:288 — _ChapterListSheetState.build has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NovelReaderController.onScrollNotification (cyclomatic 24) · ×1
  • NovelReaderController.onScrollNotification (cyclomatic 24) lib/screens/novel/reader/controller/reader_controller.dart:1307 — NovelReaderController.onScrollNotification 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 · _DecorationClosetSheetState._onSavePressed (cyclomatic 24) · ×1
  • _DecorationClosetSheetState._onSavePressed (cyclomatic 24) lib/screens/profile/widgets/decoration_closet_sheet.dart:125 — _DecorationClosetSheetState._onSavePressed 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 · MalService.updateListEntry (cyclomatic 23) · ×1
  • MalService.updateListEntry (cyclomatic 23) lib/controllers/services/mal/mal_service.dart:900 — MalService.updateListEntry 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 · ThemeRenderer._buildTitleAreaThing (cyclomatic 23) · ×1
  • ThemeRenderer._buildTitleAreaThing (cyclomatic 23) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:405 — ThemeRenderer._buildTitleAreaThing 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. This is NOT this file's highest cyclomatic complexity: ThemeRenderer._getDynamicColor (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ThemeRenderer._buildItem (cyclomatic 23) · ×1
  • ThemeRenderer._buildItem (cyclomatic 23) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:500 — ThemeRenderer._buildItem 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. This is NOT this file's highest cyclomatic complexity: ThemeRenderer._getDynamicColor (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _DownloadScreenState._buildChapterStep (cyclomatic 23) · ×1
  • _DownloadScreenState._buildChapterStep (cyclomatic 23) lib/screens/downloads/download_screen.dart:1219 — _DownloadScreenState._buildChapterStep 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 · ChapterListItem.build (cyclomatic 23) · ×1
  • ChapterListItem.build (cyclomatic 23) lib/screens/novel/details/widgets/chapter_item.dart:34 — ChapterListItem.build has cyclomatic complexity 23 (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 · DesktopStatsGrid.build (cyclomatic 23) · ×1
  • DesktopStatsGrid.build (cyclomatic 23) lib/screens/profile/widgets/stats_overview_cards.dart:15 — DesktopStatsGrid.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 · AppAbiDetector.getCurrentAppAbi (cyclomatic 23) · ×1
  • AppAbiDetector.getCurrentAppAbi (cyclomatic 23) lib/utils/abi_checker.dart:8 — AppAbiDetector.getCurrentAppAbi 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 · UpdateManager.checkForUpdates (cyclomatic 23) · ×1
  • UpdateManager.checkForUpdates (cyclomatic 23) lib/utils/updater.dart:64 — UpdateManager.checkForUpdates 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 · UpdateManager._shouldUpdate (cyclomatic 23) · ×1
  • UpdateManager._shouldUpdate (cyclomatic 23) lib/utils/updater.dart:180 — UpdateManager._shouldUpdate 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 · _SubsamplingImageProviderState.build (cyclomatic 23) · ×1
  • _SubsamplingImageProviderState.build (cyclomatic 23) lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:69 — _SubsamplingImageProviderState.build has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SubsamplingScaleImageViewState._loadFromProvider (cyclomatic 23) · ×1
  • _SubsamplingScaleImageViewState._loadFromProvider (cyclomatic 23) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:612 — _SubsamplingScaleImageViewState._loadFromProvider 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 · AnilistAuth.deleteMediaFromList (cyclomatic 22) · ×1
  • AnilistAuth.deleteMediaFromList (cyclomatic 22) lib/controllers/services/anilist/anilist_auth.dart:2157 — AnilistAuth.deleteMediaFromList 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 · TrackedMedia.formattedProgress (cyclomatic 22) · ×1
  • TrackedMedia.formattedProgress (cyclomatic 22) lib/models/Anilist/anilist_media_user.dart:149 — TrackedMedia.formattedProgress has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _CalendarState.build (cyclomatic 22) · ×1
  • _CalendarState.build (cyclomatic 22) lib/screens/anime/misc/calendar.dart:434 — _CalendarState.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 · PlayerController._loadLocalSubtitles (cyclomatic 22) · ×1
  • PlayerController._loadLocalSubtitles (cyclomatic 22) lib/screens/anime/watch/controller/player_controller.dart:1539 — PlayerController._loadLocalSubtitles 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 · MinimalEpisodeWidget.build (cyclomatic 22) · ×1
  • MinimalEpisodeWidget.build (cyclomatic 22) lib/screens/anime/widgets/episode/styles/minimal_style.dart:30 — MinimalEpisodeWidget.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 · _DownloadedMediaViewState._syncBoundTrackersAfterPlay (cyclomatic 22) · ×1
  • _DownloadedMediaViewState._syncBoundTrackersAfterPlay (cyclomatic 22) lib/screens/downloads/widgets/downloaded_media_view.dart:406 — _DownloadedMediaViewState._syncBoundTrackersAfterPlay 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 · ReaderController.loadNextChapterInline (cyclomatic 22) · ×1
  • ReaderController.loadNextChapterInline (cyclomatic 22) lib/screens/manga/controller/reader_controller.dart:306 — ReaderController.loadNextChapterInline 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 · _LogoAnimationPreviewDialogState._showAddCustomLogoDialog (cyclomatic 22) · ×1
  • _LogoAnimationPreviewDialogState._showAddCustomLogoDialog (cyclomatic 22) lib/widgets/dialogs/logo_animation_preview_dialog.dart:96 — _LogoAnimationPreviewDialogState._showAddCustomLogoDialog 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 · MalService.homeWidgets (cyclomatic 21) · ×1
  • MalService.homeWidgets (cyclomatic 21) lib/controllers/services/mal/mal_service.dart:434 — MalService.homeWidgets 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 · SimklService.updateListEntry (cyclomatic 21) · ×1
  • SimklService.updateListEntry (cyclomatic 21) lib/controllers/services/simkl/simkl_service.dart:619 — SimklService.updateListEntry 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 · TorrentService._findFileForEpisode (cyclomatic 21) · ×1
  • TorrentService._findFileForEpisode (cyclomatic 21) lib/controllers/services/torrent/torrent_service.dart:210 — TorrentService._findFileForEpisode 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 · Media.fromSmallSimkl (cyclomatic 21) · ×1
  • Media.fromSmallSimkl (cyclomatic 21) lib/models/Media/media.dart:977 — Media.fromSmallSimkl 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 · Ios26PlayerControlTheme.buildBottomControls (cyclomatic 21) · ×1
  • Ios26PlayerControlTheme.buildBottomControls (cyclomatic 21) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:229 — Ios26PlayerControlTheme.buildBottomControls 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 · _DoubleTapSeekWidgetState.build (cyclomatic 21) · ×1
  • _DoubleTapSeekWidgetState.build (cyclomatic 21) lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:840 — _DoubleTapSeekWidgetState.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 · _CommentSectionState._buildReplyItem (cyclomatic 21) · ×1
  • _CommentSectionState._buildReplyItem (cyclomatic 21) lib/screens/anime/widgets/comments/comments_section.dart:1385 — _CommentSectionState._buildReplyItem 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 · ReaderController._performFinalSave (cyclomatic 21) · ×1
  • ReaderController._performFinalSave (cyclomatic 21) lib/screens/manga/controller/reader_controller.dart:704 — ReaderController._performFinalSave 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 · _ActivityHeatmapState.build (cyclomatic 21) · ×1
  • _ActivityHeatmapState.build (cyclomatic 21) lib/screens/profile/widgets/activity_heatmap.dart:52 — _ActivityHeatmapState.build has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ListStatusCard.build (cyclomatic 21) · ×1
  • ListStatusCard.build (cyclomatic 21) lib/screens/profile/widgets/list_status_card.dart:28 — ListStatusCard.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 · SocialTabState.build (cyclomatic 21) · ×1
  • SocialTabState.build (cyclomatic 21) lib/screens/profile/widgets/social_tab.dart:153 — SocialTabState.build has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _WatchiumPageState._joinByCode (cyclomatic 21) · ×1
  • _WatchiumPageState._joinByCode (cyclomatic 21) lib/screens/watchium/watchium_page.dart:132 — _WatchiumPageState._joinByCode 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 · AnymeXScaffold.build (cyclomatic 21) · ×1
  • AnymeXScaffold.build (cyclomatic 21) lib/widgets/common/anymex_scaffold.dart:148 — AnymeXScaffold.build has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FloatingPillNavBarState._buildMobileLayout (cyclomatic 21) · ×1
  • _FloatingPillNavBarState._buildMobileLayout (cyclomatic 21) lib/widgets/common/navbar/styles/floating_pill_navbar.dart:187 — _FloatingPillNavBarState._buildMobileLayout 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 · _WatchiumPartyPopupContentState._buildChat (cyclomatic 21) · ×1
  • _WatchiumPartyPopupContentState._buildChat (cyclomatic 21) lib/widgets/watchium/watchium_party_popup.dart:305 — _WatchiumPartyPopupContentState._buildChat 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 · AnilistApi.getStaffDetails (cyclomatic 20) · ×1
  • AnilistApi.getStaffDetails (cyclomatic 20) lib/controllers/services/anilist/anilist_api.dart:96 — AnilistApi.getStaffDetails 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 · ReasonUserProfile.matchesUser (cyclomatic 20) · ×1
  • ReasonUserProfile.matchesUser (cyclomatic 20) lib/controllers/services/community_service.dart:124 — ReasonUserProfile.matchesUser 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 · WatchiumService._connectSocket (cyclomatic 20) · ×1
  • WatchiumService._connectSocket (cyclomatic 20) lib/controllers/watchium/watchium_service.dart:172 — WatchiumService._connectSocket 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 · ThemeRenderer._makeButtonThing (cyclomatic 20) · ×1
  • ThemeRenderer._makeButtonThing (cyclomatic 20) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:716 — ThemeRenderer._makeButtonThing 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. This is NOT this file's highest cyclomatic complexity: ThemeRenderer._getDynamicColor (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · EpisodesPane.build (cyclomatic 20) · ×1
  • EpisodesPane.build (cyclomatic 20) lib/screens/anime/watch/controls/widgets/episodes_pane.dart:197 — EpisodesPane.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 · _CommentSectionState._showUserInfoDialog (cyclomatic 20) · ×1
  • _CommentSectionState._showUserInfoDialog (cyclomatic 20) lib/screens/anime/widgets/comments/comments_section.dart:3131 — _CommentSectionState._showUserInfoDialog 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 · _UserCommentsSheetContentState.build (cyclomatic 20) · ×1
  • _UserCommentsSheetContentState.build (cyclomatic 20) lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:80 — _UserCommentsSheetContentState.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 · DownloadController._consolidateDownloads (cyclomatic 20) · ×1
  • DownloadController._consolidateDownloads (cyclomatic 20) lib/screens/downloads/controller/download_controller.dart:1944 — DownloadController._consolidateDownloads 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 · _DownloadedMediaViewState._buildEpisodeTile (cyclomatic 20) · ×1
  • _DownloadedMediaViewState._buildEpisodeTile (cyclomatic 20) lib/screens/downloads/widgets/downloaded_media_view.dart:824 — _DownloadedMediaViewState._buildEpisodeTile 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 · __ListMediaEditorBottomSheetState.build (cyclomatic 20) · ×1
  • __ListMediaEditorBottomSheetState.build (cyclomatic 20) lib/screens/library/editor/list_editor.dart:833 — __ListMediaEditorBottomSheetState.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 · _ChapterListBuilderState.build (cyclomatic 20) · ×1
  • _ChapterListBuilderState.build (cyclomatic 20) lib/screens/manga/widgets/chapter_list_builder.dart:468 — _ChapterListBuilderState.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 · _CompatibilityInputPageState._buildMatchupHero (cyclomatic 20) · ×1
  • _CompatibilityInputPageState._buildMatchupHero (cyclomatic 20) lib/screens/profile/compatibility/compatibility_input_page.dart:333 — _CompatibilityInputPageState._buildMatchupHero 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 · _UserMediaListPageState.build (cyclomatic 20) · ×1
  • _UserMediaListPageState.build (cyclomatic 20) lib/screens/profile/widgets/user_media_list_page.dart:522 — _UserMediaListPageState.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 · _SearchPageState._buildFilterChips (cyclomatic 20) · ×1
  • _SearchPageState._buildFilterChips (cyclomatic 20) lib/screens/search/search_view.dart:1139 — _SearchPageState._buildFilterChips 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 · Header.build (cyclomatic 20) · ×1
  • Header.build (cyclomatic 20) lib/widgets/header/legacy_header.dart:41 — Header.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 · BackupRestoreService.pickBackupFile (cyclomatic 19) · ×1
  • BackupRestoreService.pickBackupFile (cyclomatic 19) lib/controllers/services/backup_restore/backup_restore_service.dart:1255 — BackupRestoreService.pickBackupFile 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 · CommunityService._buildSubmitBody (cyclomatic 19) · ×1
  • CommunityService._buildSubmitBody (cyclomatic 19) lib/controllers/services/community_service.dart:953 — CommunityService._buildSubmitBody 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 · SimklService.getEpisodesBySeason (cyclomatic 19) · ×1
  • SimklService.getEpisodesBySeason (cyclomatic 19) lib/controllers/services/simkl/simkl_service.dart:560 — SimklService.getEpisodesBySeason 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 · SimklService.updateListEntryFromExternalId (cyclomatic 19) · ×1
  • SimklService.updateListEntryFromExternalId (cyclomatic 19) lib/controllers/services/simkl/simkl_service.dart:749 — SimklService.updateListEntryFromExternalId 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 · _BottomSheetListItemState.build (cyclomatic 19) · ×1
  • _BottomSheetListItemState.build (cyclomatic 19) lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:285 — _BottomSheetListItemState.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 · DiscordMarkdown.build (cyclomatic 19) · ×1
  • DiscordMarkdown.build (cyclomatic 19) lib/screens/anime/widgets/comments/discord_markdown.dart:36 — DiscordMarkdown.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 · _MentionAutocompleteState._searchUsers (cyclomatic 19) · ×1
  • _MentionAutocompleteState._searchUsers (cyclomatic 19) lib/screens/anime/widgets/comments/mention_autocomplete.dart:122 — _MentionAutocompleteState._searchUsers 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 · _DownloadServerSelectorState._buildBody (cyclomatic 19) · ×1
  • _DownloadServerSelectorState._buildBody (cyclomatic 19) lib/screens/downloads/widgets/download_server_selector.dart:277 — _DownloadServerSelectorState._buildBody 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 · _HistoryEditorState._buildHistoryCard (cyclomatic 19) · ×1
  • _HistoryEditorState._buildHistoryCard (cyclomatic 19) lib/screens/library/editor/history_editor.dart:477 — _HistoryEditorState._buildHistoryCard 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 · _ReaderPageActionsSheet._savePage (cyclomatic 19) · ×1
  • _ReaderPageActionsSheet._savePage (cyclomatic 19) lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:110 — _ReaderPageActionsSheet._savePage 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 · _WatchiumPageState._joinRoomFromCard (cyclomatic 19) · ×1
  • _WatchiumPageState._joinRoomFromCard (cyclomatic 19) lib/screens/watchium/watchium_page.dart:1064 — _WatchiumPageState._joinRoomFromCard 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 · ImageColorExtractor._findDominantColorInt (cyclomatic 19) · ×1
  • ImageColorExtractor._findDominantColorInt (cyclomatic 19) lib/utils/color_extractor.dart:77 — ImageColorExtractor._findDominantColorInt 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 · OfflineStorageController.addOrUpdateReadChapter (cyclomatic 18) · ×1
  • OfflineStorageController.addOrUpdateReadChapter (cyclomatic 18) lib/controllers/offline/offline_storage_controller.dart:902 — OfflineStorageController.addOrUpdateReadChapter 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 · OfflineStorageController._createOfflineMedia (cyclomatic 18) · ×1
  • OfflineStorageController._createOfflineMedia (cyclomatic 18) lib/controllers/offline/offline_storage_controller.dart:1141 — OfflineStorageController._createOfflineMedia has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Media.displayTitle (cyclomatic 18) · ×1
  • Media.displayTitle (cyclomatic 18) lib/models/Media/media.dart:28 — Media.displayTitle has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _GridAnimeCardState.build (cyclomatic 18) · ×1
  • _GridAnimeCardState.build (cyclomatic 18) lib/screens/anime/misc/calendar.dart:636 — _GridAnimeCardState.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 · _AnimeThemePlayerDialogState.build (cyclomatic 18) · ×1
  • _AnimeThemePlayerDialogState.build (cyclomatic 18) lib/screens/anime/themes/anime_theme_dialog.dart:175 — _AnimeThemePlayerDialogState.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 · ThemeRenderer._resolveColor (cyclomatic 18) · ×1
  • ThemeRenderer._resolveColor (cyclomatic 18) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1286 — ThemeRenderer._resolveColor has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ThemeRenderer._getDynamicColor (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _AudioPopupContentState._buildInbuiltAudio (cyclomatic 18) · ×1
  • _AudioPopupContentState._buildInbuiltAudio (cyclomatic 18) lib/screens/anime/watch/controls/widgets/audio_popup.dart:164 — _AudioPopupContentState._buildInbuiltAudio 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 · _TracksPopupContentState._buildSourceSubtitles (cyclomatic 18) · ×1
  • _TracksPopupContentState._buildSourceSubtitles (cyclomatic 18) lib/screens/anime/watch/controls/widgets/tracks_popup.dart:174 — _TracksPopupContentState._buildSourceSubtitles 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 · _CommentSectionState._buildCommentWithReplies (cyclomatic 18) · ×1
  • _CommentSectionState._buildCommentWithReplies (cyclomatic 18) lib/screens/anime/widgets/comments/comments_section.dart:993 — _CommentSectionState._buildCommentWithReplies 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 · _DownloadScreenState._checkPermissions (cyclomatic 18) · ×1
  • _DownloadScreenState._checkPermissions (cyclomatic 18) lib/screens/downloads/download_screen.dart:176 — _DownloadScreenState._checkPermissions 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 · _ExtensionListState.build (cyclomatic 18) · ×1
  • _ExtensionListState.build (cyclomatic 18) lib/screens/extensions/ExtensionList.dart:305 — _ExtensionListState.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 · _CompatibilityInputPageState._submit (cyclomatic 18) · ×1
  • _CompatibilityInputPageState._submit (cyclomatic 18) lib/screens/profile/compatibility/compatibility_input_page.dart:204 — _CompatibilityInputPageState._submit 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 · _SettingsDiscordState._buildAccountCard (cyclomatic 18) · ×1
  • _SettingsDiscordState._buildAccountCard (cyclomatic 18) lib/screens/settings/sub_settings/settings_discord.dart:249 — _SettingsDiscordState._buildAccountCard 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 · _SettingsUiDetailsState.build (cyclomatic 18) · ×1
  • _SettingsUiDetailsState.build (cyclomatic 18) lib/screens/settings/sub_settings/settings_ui_details.dart:123 — _SettingsUiDetailsState.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 · _AnymeXModerationActionSheetState.build (cyclomatic 18) · ×1
  • _AnymeXModerationActionSheetState.build (cyclomatic 18) lib/screens/settings/sub_settings/widgets/moderation_action_sheet.dart:262 — _AnymeXModerationActionSheetState.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 · _WatchiumPageState._buildJoinByCodeSection (cyclomatic 18) · ×1
  • _WatchiumPageState._buildJoinByCodeSection (cyclomatic 18) lib/screens/watchium/watchium_page.dart:572 — _WatchiumPageState._buildJoinByCodeSection 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 · _WatchiumPageState._buildCurrentRoomSection (cyclomatic 18) · ×1
  • _WatchiumPageState._buildCurrentRoomSection (cyclomatic 18) lib/screens/watchium/watchium_page.dart:785 — _WatchiumPageState._buildCurrentRoomSection 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 · AnilistNotificationService.pollNotifications (cyclomatic 18) · ×1
  • AnilistNotificationService.pollNotifications (cyclomatic 18) lib/services/anilist_notification_service.dart:66 — AnilistNotificationService.pollNotifications 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 · Deeplink.handleDeepLink (cyclomatic 18) · ×1
  • Deeplink.handleDeepLink (cyclomatic 18) lib/utils/deeplink.dart:23 — Deeplink.handleDeepLink 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 · AnymeXDecoratedAvatar.build (cyclomatic 18) · ×1
  • AnymeXDecoratedAvatar.build (cyclomatic 18) lib/widgets/anymex_widgets/anymex_decorated_avatar.dart:32 — AnymeXDecoratedAvatar.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 · AnymeXDialog.build (cyclomatic 18) · ×1
  • AnymeXDialog.build (cyclomatic 18) lib/widgets/anymex_widgets/anymex_dialog.dart:75 — AnymeXDialog.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 · Header.build (cyclomatic 18) · ×1
  • Header.build (cyclomatic 18) lib/widgets/header/header.dart:74 — Header.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 · _ActivityCardState._showActivityOptions (cyclomatic 18) · ×1
  • _ActivityCardState._showActivityOptions (cyclomatic 18) lib/widgets/non_widgets/activity_card.dart:150 — _ActivityCardState._showActivityOptions 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 · _ReasonsSheetState._buildReasonCard (cyclomatic 18) · ×1
  • _ReasonsSheetState._buildReasonCard (cyclomatic 18) lib/widgets/non_widgets/reasons_sheet.dart:521 — _ReasonsSheetState._buildReasonCard 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 · SettingsSheet._buildHeroHeader (cyclomatic 18) · ×1
  • SettingsSheet._buildHeroHeader (cyclomatic 18) lib/widgets/non_widgets/settings_sheet.dart:176 — SettingsSheet._buildHeroHeader 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 · _SubsamplingScaleImageViewState._handleScaleUpdate (cyclomatic 18) · ×1
  • _SubsamplingScaleImageViewState._handleScaleUpdate (cyclomatic 18) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:1237 — _SubsamplingScaleImageViewState._handleScaleUpdate 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 · DiscordRPCController.updateMediaPresence (cyclomatic 17) · ×1
  • DiscordRPCController.updateMediaPresence (cyclomatic 17) lib/controllers/discord/discord_rpc.dart:923 — DiscordRPCController.updateMediaPresence 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 · AnilistAuth.formatScore (cyclomatic 17) · ×1
  • AnilistAuth.formatScore (cyclomatic 17) lib/controllers/services/anilist/anilist_auth.dart:56 — AnilistAuth.formatScore 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 · AnilistData.homeWidgets (cyclomatic 17) · ×1
  • AnilistData.homeWidgets (cyclomatic 17) lib/controllers/services/anilist/anilist_data.dart:115 — AnilistData.homeWidgets 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 · AnilistData._paintCached (cyclomatic 17) · ×1
  • AnilistData._paintCached (cyclomatic 17) lib/controllers/services/anilist/anilist_data.dart:367 — AnilistData._paintCached 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 · AnilistData.fetchStudioDetails (cyclomatic 17) · ×1
  • AnilistData.fetchStudioDetails (cyclomatic 17) lib/controllers/services/anilist/anilist_data.dart:881 — AnilistData.fetchStudioDetails 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 · MalService._fetchAndStoreMalSessionId (cyclomatic 17) · ×1
  • MalService._fetchAndStoreMalSessionId (cyclomatic 17) lib/controllers/services/mal/mal_service.dart:742 — MalService._fetchAndStoreMalSessionId 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 · MalService.deleteListEntry (cyclomatic 17) · ×1
  • MalService.deleteListEntry (cyclomatic 17) lib/controllers/services/mal/mal_service.dart:1001 — MalService.deleteListEntry 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 · SimklApi.fetchDetails (cyclomatic 17) · ×1
  • SimklApi.fetchDetails (cyclomatic 17) lib/controllers/services/simkl/simkl_api.dart:16 — SimklApi.fetchDetails 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 · LeaderboardEntry.fromMap (cyclomatic 17) · ×1
  • LeaderboardEntry.fromMap (cyclomatic 17) lib/database/comments/model/leaderboard_entry.dart:66 — LeaderboardEntry.fromMap 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 · TrackedMedia.effectiveTotal (cyclomatic 17) · ×1
  • TrackedMedia.effectiveTotal (cyclomatic 17) lib/models/Anilist/anilist_media_user.dart:121 — TrackedMedia.effectiveTotal 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 · AnilistNotificationItem.displayBody (cyclomatic 17) · ×1
  • AnilistNotificationItem.displayBody (cyclomatic 17) lib/models/Anilist/anilist_notification.dart:64 — AnilistNotificationItem.displayBody 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 · Media.fromRecs (cyclomatic 17) · ×1
  • Media.fromRecs (cyclomatic 17) lib/models/Media/media.dart:1486 — Media.fromRecs 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 · MediaDetailsController._initActiveSource (cyclomatic 17) · ×1
  • MediaDetailsController._initActiveSource (cyclomatic 17) lib/screens/anime/details/controller/media_details_controller.dart:275 — MediaDetailsController._initActiveSource 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 · IosLegacyPlayerControlTheme.buildBottomControls (cyclomatic 17) · ×1
  • IosLegacyPlayerControlTheme.buildBottomControls (cyclomatic 17) lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:265 — IosLegacyPlayerControlTheme.buildBottomControls 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 · DiscordMarkdown._parseImgTag (cyclomatic 17) · ×1
  • DiscordMarkdown._parseImgTag (cyclomatic 17) lib/screens/anime/widgets/comments/discord_markdown.dart:452 — DiscordMarkdown._parseImgTag 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 · _EpisodeListBuilderState.build (cyclomatic 17) · ×1
  • _EpisodeListBuilderState.build (cyclomatic 17) lib/screens/anime/widgets/episode_list_builder.dart:466 — _EpisodeListBuilderState.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 · _EpisodeListBuilderState._buildHeaderCard (cyclomatic 17) · ×1
  • _EpisodeListBuilderState._buildHeaderCard (cyclomatic 17) lib/screens/anime/widgets/episode_list_builder.dart:942 — _EpisodeListBuilderState._buildHeaderCard 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 · DownloadController.cancelAndRemoveTasks (cyclomatic 17) · ×1
  • DownloadController.cancelAndRemoveTasks (cyclomatic 17) lib/screens/downloads/controller/download_controller.dart:1542 — DownloadController.cancelAndRemoveTasks 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 · ReaderController._updatePageStateForSpread (cyclomatic 17) · ×1
  • ReaderController._updatePageStateForSpread (cyclomatic 17) lib/screens/manga/controller/reader_controller.dart:1401 — ReaderController._updatePageStateForSpread 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 · ReaderController.fetchImages (cyclomatic 17) · ×1
  • ReaderController.fetchImages (cyclomatic 17) lib/screens/manga/controller/reader_controller.dart:1927 — ReaderController.fetchImages 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 · _MangaStatsState.build (cyclomatic 17) · ×1
  • _MangaStatsState.build (cyclomatic 17) lib/screens/manga/widgets/manga_stats.dart:69 — _MangaStatsState.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 · _CompatibilityInputPageState._onUserChanged (cyclomatic 17) · ×1
  • _CompatibilityInputPageState._onUserChanged (cyclomatic 17) lib/screens/profile/compatibility/compatibility_input_page.dart:118 — _CompatibilityInputPageState._onUserChanged 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 · _ProfileStatsTabState.build (cyclomatic 17) · ×1
  • _ProfileStatsTabState.build (cyclomatic 17) lib/screens/profile/widgets/profile_stats_tab.dart:38 — _ProfileStatsTabState.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 · _ProfileStatsTabState._overviewView (cyclomatic 17) · ×1
  • _ProfileStatsTabState._overviewView (cyclomatic 17) lib/screens/profile/widgets/profile_stats_tab.dart:175 — _ProfileStatsTabState._overviewView 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 · SocialTabState.loadMore (cyclomatic 17) · ×1
  • SocialTabState.loadMore (cyclomatic 17) lib/screens/profile/widgets/social_tab.dart:98 — SocialTabState.loadMore has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · _SearchPageState._loadMoreResults (cyclomatic 17) · ×1
  • _SearchPageState._loadMoreResults (cyclomatic 17) lib/screens/search/search_view.dart:585 — _SearchPageState._loadMoreResults 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 · _GroupFilterWidgetState.build (cyclomatic 17) · ×1
  • _GroupFilterWidgetState.build (cyclomatic 17) lib/screens/search/widgets/extension_filter_sheet.dart:539 — _GroupFilterWidgetState.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 · _ExportBackupSheetState.build (cyclomatic 17) · ×1
  • _ExportBackupSheetState.build (cyclomatic 17) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1047 — _ExportBackupSheetState.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 · _UserStatsPageState.build (cyclomatic 17) · ×1
  • _UserStatsPageState.build (cyclomatic 17) lib/screens/stats/user_stats_page.dart:99 — _UserStatsPageState.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 · CommentumService._mapCommentumToAnymeXComment (cyclomatic 17) · ×1
  • CommentumService._mapCommentumToAnymeXComment (cyclomatic 17) lib/services/commentum_service.dart:1282 — CommentumService._mapCommentumToAnymeXComment 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 · MediaDownloader.download (cyclomatic 17) · ×1
  • MediaDownloader.download (cyclomatic 17) lib/utils/media_downloader.dart:105 — MediaDownloader.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 · LinkedAccountsBadges.build (cyclomatic 17) · ×1
  • LinkedAccountsBadges.build (cyclomatic 17) lib/widgets/anymex_widgets/linked_accounts_badges.dart:20 — LinkedAccountsBadges.build has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _SubsamplingScaleImageViewState.didUpdateWidget (cyclomatic 17) · ×1
  • _SubsamplingScaleImageViewState.didUpdateWidget (cyclomatic 17) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:512 — _SubsamplingScaleImageViewState.didUpdateWidget 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 · AppNamePackageManager.run (cyclomatic 16) · ×1
  • AppNamePackageManager.run (cyclomatic 16) package_manager.dart:12 — AppNamePackageManager.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 · DiscordRPCController.updateMangaPresence (cyclomatic 16) · ×1
  • DiscordRPCController.updateMangaPresence (cyclomatic 16) lib/controllers/discord/discord_rpc.dart:794 — DiscordRPCController.updateMangaPresence 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 · WatchiumService.createRoom (cyclomatic 16) · ×1
  • WatchiumService.createRoom (cyclomatic 16) lib/controllers/watchium/watchium_service.dart:468 — WatchiumService.createRoom 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 · OfflineMedia.displayTitle (cyclomatic 16) · ×1
  • OfflineMedia.displayTitle (cyclomatic 16) lib/database/isar_models/offline_media.dart:30 — OfflineMedia.displayTitle 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 · Media.fromJikan (cyclomatic 16) · ×1
  • Media.fromJikan (cyclomatic 16) lib/models/Media/media.dart:331 — Media.fromJikan 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 · _ListExporterPageState.build (cyclomatic 16) · ×1
  • _ListExporterPageState.build (cyclomatic 16) lib/screens/anime/misc/list_exporter.dart:358 — _ListExporterPageState.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 · PlayerController.initializePlayerControlsIfNeeded (cyclomatic 16) · ×1
  • PlayerController.initializePlayerControlsIfNeeded (cyclomatic 16) lib/screens/anime/watch/controller/player_controller.dart:481 — PlayerController.initializePlayerControlsIfNeeded 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 · ThemeRenderer.buildBottomShit (cyclomatic 16) · ×1
  • ThemeRenderer.buildBottomShit (cyclomatic 16) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:220 — ThemeRenderer.buildBottomShit 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. This is NOT this file's highest cyclomatic complexity: ThemeRenderer._getDynamicColor (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ThemeRenderer._slapPanelOn (cyclomatic 16) · ×1
  • ThemeRenderer._slapPanelOn (cyclomatic 16) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:986 — ThemeRenderer._slapPanelOn 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. This is NOT this file's highest cyclomatic complexity: ThemeRenderer._getDynamicColor (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · MediaKitPlayer.initialize (cyclomatic 16) · ×1
  • MediaKitPlayer.initialize (cyclomatic 16) lib/screens/anime/watch/player/media_kit_player.dart:76 — MediaKitPlayer.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 · AnimeStats.build (cyclomatic 16) · ×1
  • AnimeStats.build (cyclomatic 16) lib/screens/anime/widgets/anime_stats.dart:54 — AnimeStats.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 · CharactersCarousel.build (cyclomatic 16) · ×1
  • CharactersCarousel.build (cyclomatic 16) lib/screens/anime/widgets/voice_actor.dart:19 — CharactersCarousel.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 · DownloadController._runEpisodeDownload (cyclomatic 16) · ×1
  • DownloadController._runEpisodeDownload (cyclomatic 16) lib/screens/downloads/controller/download_controller.dart:936 — DownloadController._runEpisodeDownload 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 · _ExtensionListState._onReorder (cyclomatic 16) · ×1
  • _ExtensionListState._onReorder (cyclomatic 16) lib/screens/extensions/ExtensionList.dart:269 — _ExtensionListState._onReorder 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 · _ContinuousReaderViewState._handleScaleUpdate (cyclomatic 16) · ×1
  • _ContinuousReaderViewState._handleScaleUpdate (cyclomatic 16) lib/screens/manga/widgets/reader/continuous_reader.dart:189 — _ContinuousReaderViewState._handleScaleUpdate 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 · _GeneralPage.build (cyclomatic 16) · ×1
  • _GeneralPage.build (cyclomatic 16) lib/screens/manga/widgets/reader/tabbed_reader_settings.dart:397 — _GeneralPage.build has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _SearchPageState._formatFilterValue (cyclomatic 16) · ×1
  • _SearchPageState._formatFilterValue (cyclomatic 16) lib/screens/search/search_view.dart:1680 — _SearchPageState._formatFilterValue has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _SettingsThemeState._buildModeTemplates (cyclomatic 16) · ×1
  • _SettingsThemeState._buildModeTemplates (cyclomatic 16) lib/screens/settings/sub_settings/settings_theme.dart:399 — _SettingsThemeState._buildModeTemplates 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 · UserStatsController.syncLibraryStats (cyclomatic 16) · ×1
  • UserStatsController.syncLibraryStats (cyclomatic 16) lib/screens/stats/controller/user_stats_controller.dart:31 — UserStatsController.syncLibraryStats 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 · CastV2Client._decodeCastMessage (cyclomatic 16) · ×1
  • CastV2Client._decodeCastMessage (cyclomatic 16) lib/services/cast/cast_v2_client.dart:186 — CastV2Client._decodeCastMessage 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 · CommentumService.createComment (cyclomatic 16) · ×1
  • CommentumService.createComment (cyclomatic 16) lib/services/commentum_service.dart:243 — CommentumService.createComment 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 · Deeplink._handleWatchiumDeepLink (cyclomatic 16) · ×1
  • Deeplink._handleWatchiumDeepLink (cyclomatic 16) lib/utils/deeplink.dart:495 — Deeplink._handleWatchiumDeepLink 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 · MediaSyncer.getSimklIdFromExternal (cyclomatic 16) · ×1
  • MediaSyncer.getSimklIdFromExternal (cyclomatic 16) lib/utils/media_syncer.dart:58 — MediaSyncer.getSimklIdFromExternal 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 · _AnymeXImageState._networkImage (cyclomatic 16) · ×1
  • _AnymeXImageState._networkImage (cyclomatic 16) lib/widgets/anymex_widgets/anymex_image.dart:248 — _AnymeXImageState._networkImage 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 · _BigCarouselPortraitState.build (cyclomatic 16) · ×1
  • _BigCarouselPortraitState.build (cyclomatic 16) lib/widgets/common/carousel/themes/big_carousel_portrait.dart:58 — _BigCarouselPortraitState.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 · _WatchiumCreateSheetState._joinRoom (cyclomatic 16) · ×1
  • _WatchiumCreateSheetState._joinRoom (cyclomatic 16) lib/widgets/watchium/watchium_create_dialog.dart:608 — _WatchiumCreateSheetState._joinRoom 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 · _WatchiumPartyPopupContentState._buildMemberTrailing (cyclomatic 16) · ×1
  • _WatchiumPartyPopupContentState._buildMemberTrailing (cyclomatic 16) lib/widgets/watchium/watchium_party_popup.dart:904 — _WatchiumPartyPopupContentState._buildMemberTrailing 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 · TachiyomiBackupParser.parseBytes (cognitive 186) · ×1
  • TachiyomiBackupParser.parseBytes (cognitive 186) lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:31 — TachiyomiBackupParser.parseBytes has cognitive complexity 186 (threshold 15). Drivers by points: if/else 31 (78 pts), ternaries 35 (75 pts), loops 14 (24 pts), boolean chains 7, error handling 2 (nesting depth added 97). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DubService.fetchDubSources (cognitive 185) · ×1
  • DubService.fetchDubSources (cognitive 185) lib/screens/anime/misc/dub_service.dart:10 — DubService.fetchDubSources has cognitive complexity 185 (threshold 15). Drivers by points: if/else 28 (141 pts), loops 6 (26 pts), error handling 4 (13 pts), boolean chains 5 (nesting depth added 142). 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 · DownloadController._mergeMediaDirectory (cognitive 165) · ×1
  • DownloadController._mergeMediaDirectory (cognitive 165) lib/screens/downloads/controller/download_controller.dart:2019 — DownloadController._mergeMediaDirectory has cognitive complexity 165 (threshold 15). Drivers by points: if/else 23 (87 pts), error handling 10 (45 pts), loops 5 (19 pts), ternaries 2 (9 pts), boolean chains 5 (nesting depth added 120). 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 · BackupRestoreService._applyExternalMangaAndAnime (cognitive 162) · ×1
  • BackupRestoreService._applyExternalMangaAndAnime (cognitive 162) lib/controllers/services/backup_restore/backup_restore_service.dart:1679 — BackupRestoreService._applyExternalMangaAndAnime has cognitive complexity 162 (threshold 15). Drivers by points: if/else 31 (88 pts), loops 14 (54 pts), boolean chains 20 (nesting depth added 97). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadController._syncMediaFolderMeta (cognitive 153) · ×1
  • DownloadController._syncMediaFolderMeta (cognitive 153) lib/screens/downloads/controller/download_controller.dart:2337 — DownloadController._syncMediaFolderMeta has cognitive complexity 153 (threshold 15). Drivers by points: if/else 29 (93 pts), ternaries 6 (27 pts), boolean chains 17, loops 4 (10 pts), error handling 2 (6 pts) (nesting depth added 95). 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 · Media.fromSimkl (cognitive 142) · ×1
  • Media.fromSimkl (cognitive 142) lib/models/Media/media.dart:559 — Media.fromSimkl has cognitive complexity 142 (threshold 15). Drivers by points: if/else 40 (67 pts), ternaries 20 (37 pts), boolean chains 27, loops 3 (6 pts), error handling 3 (4 pts), match/switch 1 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CharacterStaffSheetContentState.build (cognitive 141) · ×1
  • _CharacterStaffSheetContentState.build (cognitive 141) lib/screens/anime/widgets/character_staff_sheet.dart:140 — _CharacterStaffSheetContentState.build has cognitive complexity 141 (threshold 15). Drivers by points: if/else 39 (79 pts), ternaries 18 (34 pts), boolean chains 16, loops 4 (8 pts), error handling 4 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadController.resyncDownloads (cognitive 109) · ×1
  • DownloadController.resyncDownloads (cognitive 109) lib/screens/downloads/controller/download_controller.dart:2230 — DownloadController.resyncDownloads has cognitive complexity 109 (threshold 15). Drivers by points: if/else 14 (67 pts), ternaries 3 (21 pts), loops 4 (13 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 82). 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 · BackupRestoreService._applyBackupData (cognitive 105) · ×1
  • BackupRestoreService._applyBackupData (cognitive 105) lib/controllers/services/backup_restore/backup_restore_service.dart:581 — BackupRestoreService._applyBackupData has cognitive complexity 105 (threshold 15). Drivers by points: if/else 28 (56 pts), loops 8 (19 pts), boolean chains 16, ternaries 4 (10 pts), match/switch 1 (4 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceMapper.mapMedia (cognitive 102) · ×1
  • SourceMapper.mapMedia (cognitive 102) lib/controllers/source/source_mapper.dart:86 — SourceMapper.mapMedia has cognitive complexity 102 (threshold 15). Drivers by points: if/else 36 (59 pts), boolean chains 24, ternaries 9 (13 pts), loops 3 (5 pts), error handling 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackupRestoreService.getBackupInfo (cognitive 89) · ×1
  • BackupRestoreService.getBackupInfo (cognitive 89) lib/controllers/services/backup_restore/backup_restore_service.dart:1331 — BackupRestoreService.getBackupInfo has cognitive complexity 89 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 24, ternaries 8 (23 pts), loops 3 (9 pts), error handling 1 (nesting depth added 40). 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 · Header.build (cognitive 89) · ×1
  • Header.build (cognitive 89) lib/widgets/header/legacy_header.dart:41 — Header.build has cognitive complexity 89 (threshold 15). Drivers by points: if/else 26 (75 pts), ternaries 3 (14 pts) (nesting depth added 60). 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 · KotatsuBackupParser.parse (cognitive 88) · ×1
  • KotatsuBackupParser.parse (cognitive 88) lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:18 — KotatsuBackupParser.parse has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (59 pts), loops 9 (13 pts), boolean chains 8, ternaries 5 (8 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BackupRestorePageState._buildImportSection (cognitive 87) · ×1
  • _BackupRestorePageState._buildImportSection (cognitive 87) lib/screens/settings/sub_settings/settings_backup.dart:405 — _BackupRestorePageState._buildImportSection has cognitive complexity 87 (threshold 15). Drivers by points: if/else 22 (61 pts), ternaries 7 (20 pts), boolean chains 6 (nesting depth added 52). 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 · MediaDetailsController._fetchContentFromSource (cognitive 85) · ×1
  • MediaDetailsController._fetchContentFromSource (cognitive 85) lib/screens/anime/details/controller/media_details_controller.dart:561 — MediaDetailsController._fetchContentFromSource has cognitive complexity 85 (threshold 15). Drivers by points: if/else 22 (53 pts), boolean chains 17, ternaries 4 (13 pts), error handling 1 (2 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _UserProfileHeaderState.build (cognitive 83) · ×1
  • _UserProfileHeaderState.build (cognitive 83) lib/screens/profile/widgets/user_profile_header.dart:62 — _UserProfileHeaderState.build has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 28 (58 pts), if/else 12 (13 pts), boolean chains 12 (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 · ReaderController.handleMouseScroll (cognitive 82) · ×1
  • ReaderController.handleMouseScroll (cognitive 82) lib/screens/manga/controller/reader_controller.dart:1195 — ReaderController.handleMouseScroll has cognitive complexity 82 (threshold 15). Drivers by points: if/else 32 (75 pts), boolean chains 6, ternaries 1 (nesting depth added 43). 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 · Media.fromJson (cognitive 79) · ×1
  • Media.fromJson (cognitive 79) lib/models/Media/media.dart:1128 — Media.fromJson has cognitive complexity 79 (threshold 15). Drivers by points: if/else 23 (37 pts), ternaries 24, boolean chains 18 (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.
D2 · Cognitive Complexity · _VisualsPopupState._saveImage (cognitive 78) · ×1
  • _VisualsPopupState._saveImage (cognitive 78) lib/widgets/anime/visuals/visuals_popup.dart:162 — _VisualsPopupState._saveImage has cognitive complexity 78 (threshold 15). Drivers by points: if/else 19 (58 pts), error handling 5 (15 pts), boolean chains 5 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _FullscreenImageViewerState._saveImage (cognitive 78) · ×1
  • _FullscreenImageViewerState._saveImage (cognitive 78) lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:27 — _FullscreenImageViewerState._saveImage has cognitive complexity 78 (threshold 15). Drivers by points: if/else 19 (58 pts), error handling 5 (15 pts), boolean chains 5 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnilistData.fetchFilterData (cognitive 76) · ×1
  • AnilistData.fetchFilterData (cognitive 76) lib/controllers/services/anilist/anilist_data.dart:1409 — AnilistData.fetchFilterData has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (58 pts), ternaries 14, boolean chains 3, error handling 1 (nesting depth added 37). 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 · BackupRestoreService.exportBackupToExternal (cognitive 75) · ×1
  • BackupRestoreService.exportBackupToExternal (cognitive 75) lib/controllers/services/backup_restore/backup_restore_service.dart:924 — BackupRestoreService.exportBackupToExternal has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (51 pts), ternaries 3 (11 pts), error handling 2 (5 pts), boolean chains 4, loops 1 (4 pts) (nesting depth added 45). 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 · TrackedMedia.effectiveProgress (cognitive 75) · ×1
  • TrackedMedia.effectiveProgress (cognitive 75) lib/models/Anilist/anilist_media_user.dart:54 — TrackedMedia.effectiveProgress has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 9 (29 pts), if/else 11 (23 pts), boolean chains 17, loops 2 (6 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 · AnimeTheme.fromJson (cognitive 74) · ×1
  • AnimeTheme.fromJson (cognitive 74) lib/models/animethemes/anime_theme.dart:20 — AnimeTheme.fromJson has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (63 pts), boolean chains 6, ternaries 2 (4 pts), error handling 1 (nesting depth added 50). 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 · DownloadController._onForegroundReceiveData (cognitive 71) · ×1
  • DownloadController._onForegroundReceiveData (cognitive 71) lib/screens/downloads/controller/download_controller.dart:486 — DownloadController._onForegroundReceiveData has cognitive complexity 71 (threshold 15). Drivers by points: if/else 21 (65 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 45). 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 · DownloadController._consolidateDownloads (cognitive 71) · ×1
  • DownloadController._consolidateDownloads (cognitive 71) lib/screens/downloads/controller/download_controller.dart:1944 — DownloadController._consolidateDownloads has cognitive complexity 71 (threshold 15). Drivers by points: if/else 9 (42 pts), loops 4 (14 pts), error handling 3 (12 pts), boolean chains 3 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateManager.checkForUpdates (cognitive 70) · ×1
  • UpdateManager.checkForUpdates (cognitive 70) lib/utils/updater.dart:64 — UpdateManager.checkForUpdates has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (64 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 47). 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 · AnilistApi.getStaffDetails (cognitive 67) · ×1
  • AnilistApi.getStaffDetails (cognitive 67) lib/controllers/services/anilist/anilist_api.dart:96 — AnilistApi.getStaffDetails has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (61 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 45). 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 · PlayerController._bindPlayerStreams (cognitive 65) · ×1
  • PlayerController._bindPlayerStreams (cognitive 65) lib/screens/anime/watch/controller/player_controller.dart:1303 — PlayerController._bindPlayerStreams has cognitive complexity 65 (threshold 15). Drivers by points: if/else 38 (45 pts), boolean chains 13, loops 3 (4 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · Media.fromFullMAL (cognitive 61) · ×1
  • Media.fromFullMAL (cognitive 61) lib/models/Media/media.dart:397 — Media.fromFullMAL has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 21, ternaries 13 (16 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MangaAnimeUtil.getNextChapterPrediction (cognitive 61) · ×1
  • MangaAnimeUtil.getNextChapterPrediction (cognitive 61) lib/utils/anime_adaptation_util.dart:98 — MangaAnimeUtil.getNextChapterPrediction has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (44 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 4, ternaries 1 (2 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 · BackupRestoreService.restoreBackup (cognitive 60) · ×1
  • BackupRestoreService.restoreBackup (cognitive 60) lib/controllers/services/backup_restore/backup_restore_service.dart:1157 — BackupRestoreService.restoreBackup has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 9 (27 pts), if/else 10 (21 pts), boolean chains 8, error handling 2 (4 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 · _SubsamplingImageProviderState.build (cognitive 60) · ×1
  • _SubsamplingImageProviderState.build (cognitive 60) lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:69 — _SubsamplingImageProviderState.build has cognitive complexity 60 (threshold 15). Drivers by points: if/else 23 (54 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 33). 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 · _CommentsRepliesSheetState._buildCommentCard (cognitive 57) · ×1
  • _CommentsRepliesSheetState._buildCommentCard (cognitive 57) lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:159 — _CommentsRepliesSheetState._buildCommentCard has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 16, if/else 13 (15 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 · MediaHeader.build (cognitive 56) · ×1
  • MediaHeader.build (cognitive 56) lib/widgets/anime/media_header.dart:46 — MediaHeader.build has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 22 (23 pts), if/else 15 (17 pts), boolean chains 14, 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 · MediaDetailsController._initOfflineAndTrackedData (cognitive 55) · ×1
  • MediaDetailsController._initOfflineAndTrackedData (cognitive 55) lib/screens/anime/details/controller/media_details_controller.dart:377 — MediaDetailsController._initOfflineAndTrackedData has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (31 pts), ternaries 5 (11 pts), boolean chains 10, loops 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AnilistAboutMeState.build (cognitive 55) · ×1
  • _AnilistAboutMeState.build (cognitive 55) lib/utils/al_about_me.dart:205 — _AnilistAboutMeState.build has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (44 pts), loops 2 (7 pts), ternaries 3, match/switch 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _DownloadedMediaViewState._buildContinueFab (cognitive 54) · ×1
  • _DownloadedMediaViewState._buildContinueFab (cognitive 54) lib/screens/downloads/widgets/downloaded_media_view.dart:239 — _DownloadedMediaViewState._buildContinueFab has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 19 (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 · Media.fromMAL (cognitive 53) · ×1
  • Media.fromMAL (cognitive 53) lib/models/Media/media.dart:192 — Media.fromMAL has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 20, if/else 14 (17 pts), ternaries 13 (16 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _MediaDetailsPageState._buildContinueButton (cognitive 53) · ×1
  • _MediaDetailsPageState._buildContinueButton (cognitive 53) lib/screens/anime/details/media_details_page.dart:1130 — _MediaDetailsPageState._buildContinueButton has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 13, ternaries 8 (13 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 · _WrongTitleModalState.build (cognitive 53) · ×1
  • _WrongTitleModalState.build (cognitive 53) lib/screens/anime/widgets/wrongtitle_modal.dart:87 — _WrongTitleModalState.build has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 15 (35 pts), if/else 9 (15 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RestorePreviewSheetState._buildGroupedOptions (cognitive 53) · ×1
  • _RestorePreviewSheetState._buildGroupedOptions (cognitive 53) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:592 — _RestorePreviewSheetState._buildGroupedOptions has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 12, ternaries 5 (9 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 · ActivityComposerSheetState._buildFormatButton (cognitive 52) · ×1
  • ActivityComposerSheetState._buildFormatButton (cognitive 52) lib/widgets/non_widgets/activity_composer_sheet.dart:191 — ActivityComposerSheetState._buildFormatButton has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 5 (9 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaDetailsController.getContinueChapter (cognitive 51) · ×1
  • MediaDetailsController.getContinueChapter (cognitive 51) lib/screens/anime/details/controller/media_details_controller.dart:1027 — MediaDetailsController.getContinueChapter has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 25, if/else 12 (23 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RecommendSheetState._buildAlreadyAdded (cognitive 51) · ×1
  • _RecommendSheetState._buildAlreadyAdded (cognitive 51) lib/widgets/non_widgets/recommend_sheet.dart:709 — _RecommendSheetState._buildAlreadyAdded has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 10 (20 pts), boolean chains 7 (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 · MainActivity.configureFlutterEngine (cognitive 51) · ×1
  • MainActivity.configureFlutterEngine (cognitive 51) android/app/src/main/kotlin/com/ryan/anymex/MainActivity.kt:81 — MainActivity.configureFlutterEngine has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (30 pts), error handling 5 (14 pts), match/switch 4, boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KvHelper.get (cognitive 50) · ×1
  • KvHelper.get (cognitive 50) lib/database/kv_helper.dart:32 — KvHelper.get has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (45 pts), boolean chains 5 (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 · AnilistAuth.deleteMediaFromList (cognitive 48) · ×1
  • AnilistAuth.deleteMediaFromList (cognitive 48) lib/controllers/services/anilist/anilist_auth.dart:2157 — AnilistAuth.deleteMediaFromList has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 5, ternaries 2 (5 pts), error handling 2 (4 pts) (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 · _AnymeXExpansionTileState.build (cognitive 48) · ×1
  • _AnymeXExpansionTileState.build (cognitive 48) lib/widgets/anymex_widgets/anymex_expansion_tile.dart:109 — _AnymeXExpansionTileState.build has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 9 (11 pts), loops 1 (3 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.
D2 · Cognitive Complexity · ActivityComposerSheetState.build (cognitive 48) · ×1
  • ActivityComposerSheetState.build (cognitive 48) lib/widgets/non_widgets/activity_composer_sheet.dart:438 — ActivityComposerSheetState.build has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 20 (31 pts), if/else 11 (12 pts), boolean chains 5 (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 · _MediaDetailsPageState.build (cognitive 47) · ×1
  • _MediaDetailsPageState.build (cognitive 47) lib/screens/anime/details/media_details_page.dart:266 — _MediaDetailsPageState.build has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 16 (19 pts), if/else 12 (18 pts), boolean chains 10 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AnymeXTileBuilder.build (cognitive 47) · ×1
  • AnymeXTileBuilder.build (cognitive 47) lib/widgets/anymex_widgets/anymex_tile_builder.dart:63 — AnymeXTileBuilder.build has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (30 pts), ternaries 9 (16 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 · MediaModeSelector.build (cognitive 47) · ×1
  • MediaModeSelector.build (cognitive 47) lib/widgets/common/media_mode_selector.dart:109 — MediaModeSelector.build has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 15 (27 pts), if/else 11 (18 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CookieManager.parseSingleCookie (cognitive 46) · ×1
  • CookieManager.parseSingleCookie (cognitive 46) lib/controllers/network/cookie_manager.dart:268 — CookieManager.parseSingleCookie has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 3 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BottomControls._buildLayout (cognitive 46) · ×1
  • BottomControls._buildLayout (cognitive 46) lib/screens/anime/watch/controls/bottom_controls.dart:226 — BottomControls._buildLayout has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 10 (16 pts), boolean chains 6, 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 · _ReaderPageActionsSheet._savePage (cognitive 46) · ×1
  • _ReaderPageActionsSheet._savePage (cognitive 46) lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:110 — _ReaderPageActionsSheet._savePage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (34 pts), error handling 3 (8 pts), boolean chains 4 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _SettingsExtensionManagerState._buildPluginStatusCard (cognitive 46) · ×1
  • _SettingsExtensionManagerState._buildPluginStatusCard (cognitive 46) lib/screens/settings/sub_settings/settings_extension_manager.dart:449 — _SettingsExtensionManagerState._buildPluginStatusCard has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 24 (27 pts), boolean chains 11, if/else 6 (8 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CompatibilityController.runMatch (cognitive 45) · ×1
  • CompatibilityController.runMatch (cognitive 45) lib/controllers/services/anilist/compatibility_controller.dart:30 — CompatibilityController.runMatch has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 16, ternaries 2 (4 pts), error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadController.cancelAndRemoveTasks (cognitive 45) · ×1
  • DownloadController.cancelAndRemoveTasks (cognitive 45) lib/screens/downloads/controller/download_controller.dart:1542 — DownloadController.cancelAndRemoveTasks has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (28 pts), error handling 2 (8 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnilistData._paintCached (cognitive 44) · ×1
  • AnilistData._paintCached (cognitive 44) lib/controllers/services/anilist/anilist_data.dart:367 — AnilistData._paintCached has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (43 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 · Character.fromJson (cognitive 44) · ×1
  • Character.fromJson (cognitive 44) lib/models/Media/character.dart:38 — Character.fromJson has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 10, loops 1 (3 pts), ternaries 1 (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.
D2 · Cognitive Complexity · PlayerController._loadLocalSubtitles (cognitive 44) · ×1
  • PlayerController._loadLocalSubtitles (cognitive 44) lib/screens/anime/watch/controller/player_controller.dart:1539 — PlayerController._loadLocalSubtitles has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 6, ternaries 2 (6 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ActiveDownloadsState._buildChildTaskCard (cognitive 44) · ×1
  • _ActiveDownloadsState._buildChildTaskCard (cognitive 44) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:515 — _ActiveDownloadsState._buildChildTaskCard has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 9, ternaries 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OfflineStorageController.addMedia (cognitive 43) · ×1
  • OfflineStorageController.addMedia (cognitive 43) lib/controllers/offline/offline_storage_controller.dart:547 — OfflineStorageController.addMedia has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 15, ternaries 3 (9 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 · AnilistAuth.updateListEntry (cognitive 43) · ×1
  • AnilistAuth.updateListEntry (cognitive 43) lib/controllers/services/anilist/anilist_auth.dart:2267 — AnilistAuth.updateListEntry has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 3 (8 pts), boolean chains 5, 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 · MalService._fetchAndStoreMalSessionId (cognitive 43) · ×1
  • MalService._fetchAndStoreMalSessionId (cognitive 43) lib/controllers/services/mal/mal_service.dart:742 — MalService._fetchAndStoreMalSessionId has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (36 pts), boolean chains 3, loops 1 (3 pts), error handling 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _UserSearchSheetState.build (cognitive 43) · ×1
  • _UserSearchSheetState.build (cognitive 43) lib/screens/settings/sub_settings/settings_moderation.dart:303 — _UserSearchSheetState.build has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 20 (23 pts), boolean chains 10, if/else 8 (10 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AnymeXSectionBuilder.build (cognitive 43) · ×1
  • AnymeXSectionBuilder.build (cognitive 43) lib/widgets/anymex_widgets/anymex_section_builder.dart:63 — AnymeXSectionBuilder.build has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (30 pts), ternaries 6 (9 pts), boolean chains 3, 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 · OfflineStorageController.addOrUpdateAnime (cognitive 42) · ×1
  • OfflineStorageController.addOrUpdateAnime (cognitive 42) lib/controllers/offline/offline_storage_controller.dart:624 — OfflineStorageController.addOrUpdateAnime has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 16, ternaries 3 (9 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 · ReaderController._performFinalSave (cognitive 42) · ×1
  • ReaderController._performFinalSave (cognitive 42) lib/screens/manga/controller/reader_controller.dart:704 — ReaderController._performFinalSave has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 10, ternaries 1 (5 pts), 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 · ReaderSettings.showSettings (cognitive 42) · ×1
  • ReaderSettings.showSettings (cognitive 42) lib/screens/manga/widgets/reader/settings_view.dart:19 — ReaderSettings.showSettings has cognitive complexity 42 (threshold 15). Drivers by points: match/switch 8 (13 pts), ternaries 7 (13 pts), if/else 9, boolean chains 4, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SearchPageState._performSearch (cognitive 42) · ×1
  • _SearchPageState._performSearch (cognitive 42) lib/screens/search/search_view.dart:228 — _SearchPageState._performSearch has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 11, ternaries 2 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChapterListBuilderState.build (cognitive 41) · ×1
  • _ChapterListBuilderState.build (cognitive 41) lib/screens/manga/widgets/chapter_list_builder.dart:468 — _ChapterListBuilderState.build has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 14 (20 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 · SocialTabState.loadMore (cognitive 41) · ×1
  • SocialTabState.loadMore (cognitive 41) lib/screens/profile/widgets/social_tab.dart:98 — SocialTabState.loadMore has cognitive complexity 41 (threshold 15). Drivers by points: loops 6 (20 pts), if/else 8 (18 pts), boolean chains 2, error handling 1 (nesting depth added 24). 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 · UserStatsController.syncLibraryStats (cognitive 41) · ×1
  • UserStatsController.syncLibraryStats (cognitive 41) lib/screens/stats/controller/user_stats_controller.dart:31 — UserStatsController.syncLibraryStats has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (5 pts), ternaries 1 (4 pts), boolean chains 3, error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OfflineStorageController.addOrUpdateManga (cognitive 40) · ×1
  • OfflineStorageController.addOrUpdateManga (cognitive 40) lib/controllers/offline/offline_storage_controller.dart:690 — OfflineStorageController.addOrUpdateManga has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (15 pts), ternaries 3 (9 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. This shape REPEATS in the file: one other method here (OfflineStorageController.addOrUpdateNovel) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · OfflineStorageController.addOrUpdateNovel (cognitive 40) · ×1
  • OfflineStorageController.addOrUpdateNovel (cognitive 40) lib/controllers/offline/offline_storage_controller.dart:754 — OfflineStorageController.addOrUpdateNovel has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (15 pts), ternaries 3 (9 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. This shape REPEATS in the file: one other method here (OfflineStorageController.addOrUpdateManga) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · BackupRestoreService.pickBackupFile (cognitive 40) · ×1
  • BackupRestoreService.pickBackupFile (cognitive 40) lib/controllers/services/backup_restore/backup_restore_service.dart:1255 — BackupRestoreService.pickBackupFile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 7, error handling 2 (5 pts), ternaries 1 (4 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 · SimklService.updateListEntry (cognitive 40) · ×1
  • SimklService.updateListEntry (cognitive 40) lib/controllers/services/simkl/simkl_service.dart:619 — SimklService.updateListEntry has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 6 (17 pts), if/else 7 (14 pts), boolean chains 5, loops 1 (3 pts), error handling 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 · _DownloadScreenState._buildEpisodeStep (cognitive 40) · ×1
  • _DownloadScreenState._buildEpisodeStep (cognitive 40) lib/screens/downloads/download_screen.dart:870 — _DownloadScreenState._buildEpisodeStep has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 14 (15 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 · _DownloadedMediaViewState._syncBoundTrackersAfterPlay (cognitive 40) · ×1
  • _DownloadedMediaViewState._syncBoundTrackersAfterPlay (cognitive 40) lib/screens/downloads/widgets/downloaded_media_view.dart:406 — _DownloadedMediaViewState._syncBoundTrackersAfterPlay has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 10, loops 2 (6 pts), error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReaderController._onPositionChanged (cognitive 40) · ×1
  • ReaderController._onPositionChanged (cognitive 40) lib/screens/manga/controller/reader_controller.dart:1322 — ReaderController._onPositionChanged has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 9, 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 · _FuturisticFilterSheetState._loadCurrentFilters (cognitive 40) · ×1
  • _FuturisticFilterSheetState._loadCurrentFilters (cognitive 40) lib/screens/search/widgets/search_widgets.dart:520 — _FuturisticFilterSheetState._loadCurrentFilters has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnilistAuth.fetchUserMediaList (cognitive 39) · ×1
  • AnilistAuth.fetchUserMediaList (cognitive 39) lib/controllers/services/anilist/anilist_auth.dart:1122 — AnilistAuth.fetchUserMediaList has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 2 (7 pts), boolean chains 2, error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlayerController._trackOnline (cognitive 39) · ×1
  • PlayerController._trackOnline (cognitive 39) lib/screens/anime/watch/controller/player_controller.dart:3050 — PlayerController._trackOnline has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (12 pts), boolean chains 9, error handling 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ControlButtonState.build (cognitive 39) · ×1
  • _ControlButtonState.build (cognitive 39) lib/screens/anime/watch/controls/widgets/control_button.dart:76 — _ControlButtonState.build has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 38, 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 · _EpisodeListBuilderState.build (cognitive 39) · ×1
  • _EpisodeListBuilderState.build (cognitive 39) lib/screens/anime/widgets/episode_list_builder.dart:466 — _EpisodeListBuilderState.build has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 5 (12 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 · _HomePageState._buildNewEpisodesSection (cognitive 39) · ×1
  • _HomePageState._buildNewEpisodesSection (cognitive 39) lib/screens/home_page.dart:40 — _HomePageState._buildNewEpisodesSection has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 12, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContinuousReaderViewState._handleScaleUpdate (cognitive 39) · ×1
  • _ContinuousReaderViewState._handleScaleUpdate (cognitive 39) lib/screens/manga/widgets/reader/continuous_reader.dart:189 — _ContinuousReaderViewState._handleScaleUpdate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (19 pts), error handling 4 (16 pts), ternaries 2 (4 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 · SocialTabState.build (cognitive 39) · ×1
  • SocialTabState.build (cognitive 39) lib/screens/profile/widgets/social_tab.dart:153 — SocialTabState.build has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 7 (10 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 · _FuturisticFilterSheetState._applyFilters (cognitive 39) · ×1
  • _FuturisticFilterSheetState._applyFilters (cognitive 39) lib/screens/search/widgets/search_widgets.dart:2345 — _FuturisticFilterSheetState._applyFilters has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 7, 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 · Matchmaker._computeReleaseYearOverlap (cognitive 39) · ×1
  • Matchmaker._computeReleaseYearOverlap (cognitive 39) lib/utils/compatibility/matchmaker.dart:584 — Matchmaker._computeReleaseYearOverlap has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 8 (20 pts), boolean chains 10, if/else 5 (8 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 · AnymeXSheet.build (cognitive 39) · ×1
  • AnymeXSheet.build (cognitive 39) lib/widgets/anymex_widgets/anymex_bottomsheet.dart:137 — AnymeXSheet.build has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 8, ternaries 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnilistData.anilistSearch (cognitive 38) · ×1
  • AnilistData.anilistSearch (cognitive 38) lib/controllers/services/anilist/anilist_data.dart:1098 — AnilistData.anilistSearch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (24 pts), ternaries 5 (8 pts), boolean chains 5, 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 · BackupFormatDetector.detectFromBytes (cognitive 38) · ×1
  • BackupFormatDetector.detectFromBytes (cognitive 38) lib/controllers/services/backup_restore/backup_format_detector.dart:15 — BackupFormatDetector.detectFromBytes has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (13 pts), error handling 4 (10 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 · Media.fromSmallJson (cognitive 38) · ×1
  • Media.fromSmallJson (cognitive 38) lib/models/Media/media.dart:1393 — Media.fromSmallJson has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 20, boolean chains 13, if/else 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _UserProfilePageState._buildBody (cognitive 38) · ×1
  • _UserProfilePageState._buildBody (cognitive 38) lib/screens/profile/user_profile_page.dart:333 — _UserProfilePageState._buildBody has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 11, if/else 9 (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 · MobileProfileHeaderSliver.build (cognitive 38) · ×1
  • MobileProfileHeaderSliver.build (cognitive 38) lib/screens/profile/widgets/profile_header.dart:583 — MobileProfileHeaderSliver.build has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 9 (15 pts), boolean chains 7 (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 · _SettingsPerformanceState.build (cognitive 38) · ×1
  • _SettingsPerformanceState.build (cognitive 38) lib/screens/settings/sub_settings/settings_performance.dart:98 — _SettingsPerformanceState.build has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 11, ternaries 6 (10 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 · _UserStatsPageState._buildHeatmapSection (cognitive 38) · ×1
  • _UserStatsPageState._buildHeatmapSection (cognitive 38) lib/screens/stats/user_stats_page.dart:550 — _UserStatsPageState._buildHeatmapSection has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 7, ternaries 4, loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RecommendSheetState._userHasReason (cognitive 38) · ×1
  • _RecommendSheetState._userHasReason (cognitive 38) lib/widgets/non_widgets/recommend_sheet.dart:263 — _RecommendSheetState._userHasReason has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 8, 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. This shape REPEATS in the file: one other method here (_RecommendSheetState._findUserReason) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _RecommendSheetState._findUserReason (cognitive 38) · ×1
  • _RecommendSheetState._findUserReason (cognitive 38) lib/widgets/non_widgets/recommend_sheet.dart:305 — _RecommendSheetState._findUserReason has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 8, 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. This shape REPEATS in the file: one other method here (_RecommendSheetState._userHasReason) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MalService.homeWidgets (cognitive 37) · ×1
  • MalService.homeWidgets (cognitive 37) lib/controllers/services/mal/mal_service.dart:434 — MalService.homeWidgets has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 16 (32 pts), if/else 2 (3 pts), boolean chains 2 (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 · SimklService.getEpisodesBySeason (cognitive 37) · ×1
  • SimklService.getEpisodesBySeason (cognitive 37) lib/controllers/services/simkl/simkl_service.dart:560 — SimklService.getEpisodesBySeason has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 7 (13 pts), boolean chains 4, loops 1 (3 pts), error handling 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SimklService.updateListEntryFromExternalId (cognitive 37) · ×1
  • SimklService.updateListEntryFromExternalId (cognitive 37) lib/controllers/services/simkl/simkl_service.dart:749 — SimklService.updateListEntryFromExternalId has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 6, loops 1 (4 pts), ternaries 1 (4 pts), error handling 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _CommentSectionState._buildCommentItem (cognitive 37) · ×1
  • _CommentSectionState._buildCommentItem (cognitive 37) lib/screens/anime/widgets/comments/comments_section.dart:1745 — _CommentSectionState._buildCommentItem has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 8 (11 pts), boolean chains 8 (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 · _ActiveDownloadsState._buildMediaExpandableCard (cognitive 37) · ×1
  • _ActiveDownloadsState._buildMediaExpandableCard (cognitive 37) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:171 — _ActiveDownloadsState._buildMediaExpandableCard has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 29, if/else 5 (6 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _UserProfileAppBarState.build (cognitive 37) · ×1
  • _UserProfileAppBarState.build (cognitive 37) lib/screens/profile/widgets/user_profile_app_bar.dart:60 — _UserProfileAppBarState.build has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 12, boolean chains 10 (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 · _WatchiumPageState._buildRoomCard (cognitive 37) · ×1
  • _WatchiumPageState._buildRoomCard (cognitive 37) lib/screens/watchium/watchium_page.dart:1137 — _WatchiumPageState._buildRoomCard has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 13 (14 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimklService._paintCached (cognitive 36) · ×1
  • SimklService._paintCached (cognitive 36) lib/controllers/services/simkl/simkl_service.dart:123 — SimklService._paintCached has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (35 pts), error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncSubsContentState._buildCueViewer (cognitive 36) · ×1
  • _SyncSubsContentState._buildCueViewer (cognitive 36) lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:194 — _SyncSubsContentState._buildCueViewer has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 9 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReaderController.fetchImages (cognitive 36) · ×1
  • ReaderController.fetchImages (cognitive 36) lib/screens/manga/controller/reader_controller.dart:1927 — ReaderController.fetchImages has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 6, ternaries 2 (4 pts), error handling 1 (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 · _ProfilePageState._buildBody (cognitive 36) · ×1
  • _ProfilePageState._buildBody (cognitive 36) lib/screens/profile/profile_page.dart:240 — _ProfilePageState._buildBody has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 11, if/else 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AnilistNotificationService.pollNotifications (cognitive 36) · ×1
  • AnilistNotificationService.pollNotifications (cognitive 36) lib/services/anilist_notification_service.dart:66 — AnilistNotificationService.pollNotifications has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 2 (8 pts), boolean chains 3, loops 1 (3 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 · _MentionAutocompleteState._searchUsers (cognitive 35) · ×1
  • _MentionAutocompleteState._searchUsers (cognitive 35) lib/screens/anime/widgets/comments/mention_autocomplete.dart:122 — _MentionAutocompleteState._searchUsers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 7, loops 2 (6 pts), error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReaderController.loadNextChapterInline (cognitive 35) · ×1
  • ReaderController.loadNextChapterInline (cognitive 35) lib/screens/manga/controller/reader_controller.dart:306 — ReaderController.loadNextChapterInline has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (6 pts), ternaries 2 (5 pts), boolean chains 4, 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 · _CompatibilityResultPageState._buildSectionGrid (cognitive 35) · ×1
  • _CompatibilityResultPageState._buildSectionGrid (cognitive 35) lib/screens/profile/compatibility/compatibility_result_page.dart:621 — _CompatibilityResultPageState._buildSectionGrid has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WatchiumPageState._joinByCode (cognitive 35) · ×1
  • _WatchiumPageState._joinByCode (cognitive 35) lib/screens/watchium/watchium_page.dart:132 — _WatchiumPageState._joinByCode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 2 (6 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BakedBlurImageState._requestBackdrop (cognitive 35) · ×1
  • _BakedBlurImageState._requestBackdrop (cognitive 35) lib/widgets/common/baked_blur_image.dart:375 — _BakedBlurImageState._requestBackdrop has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 13 (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 · _SubsamplingScaleImageViewState._loadFromProvider (cognitive 35) · ×1
  • _SubsamplingScaleImageViewState._loadFromProvider (cognitive 35) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:612 — _SubsamplingScaleImageViewState._loadFromProvider has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (31 pts), error handling 4 (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 · BackupRestoreService._restoreRuntimeHost (cognitive 34) · ×1
  • BackupRestoreService._restoreRuntimeHost (cognitive 34) lib/controllers/services/backup_restore/backup_restore_service.dart:1093 — BackupRestoreService._restoreRuntimeHost has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 2 (6 pts), boolean chains 2, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _GridAnimeCardState.build (cognitive 34) · ×1
  • _GridAnimeCardState.build (cognitive 34) lib/screens/anime/misc/calendar.dart:636 — _GridAnimeCardState.build has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 9 (14 pts), boolean chains 5 (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 · _SearchPageState._buildFilterChips (cognitive 34) · ×1
  • _SearchPageState._buildFilterChips (cognitive 34) lib/screens/search/search_view.dart:1139 — _SearchPageState._buildFilterChips has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 4 (11 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · AnymeXTile.build (cognitive 34) · ×1
  • AnymeXTile.build (cognitive 34) lib/widgets/anymex_widgets/anymex_tile.dart:620 — AnymeXTile.build has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 19 (23 pts), if/else 5 (6 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _LogoAnimationPreviewDialogState._showAddCustomLogoDialog (cognitive 34) · ×1
  • _LogoAnimationPreviewDialogState._showAddCustomLogoDialog (cognitive 34) lib/widgets/dialogs/logo_animation_preview_dialog.dart:96 — _LogoAnimationPreviewDialogState._showAddCustomLogoDialog has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 7 (12 pts), error handling 3 (5 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.
D2 · Cognitive Complexity · _ActivityCardState.build (cognitive 34) · ×1
  • _ActivityCardState.build (cognitive 34) lib/widgets/non_widgets/activity_card.dart:522 — _ActivityCardState.build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (21 pts), ternaries 6 (7 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 · _SubsamplingScaleImageViewState.build (cognitive 34) · ×1
  • _SubsamplingScaleImageViewState.build (cognitive 34) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:1397 — _SubsamplingScaleImageViewState.build has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 10, if/else 6 (9 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DiscordRPCController.updateAnimePresence (cognitive 33) · ×1
  • DiscordRPCController.updateAnimePresence (cognitive 33) lib/controllers/discord/discord_rpc.dart:538 — DiscordRPCController.updateAnimePresence has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 8, ternaries 2 (6 pts), error handling 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 · AnilistData.fetchAnilistMangaPage (cognitive 33) · ×1
  • AnilistData.fetchAnilistMangaPage (cognitive 33) lib/controllers/services/anilist/anilist_data.dart:623 — AnilistData.fetchAnilistMangaPage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (33 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimklApi.fetchDetails (cognitive 33) · ×1
  • SimklApi.fetchDetails (cognitive 33) lib/controllers/services/simkl/simkl_api.dart:16 — SimklApi.fetchDetails has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 3 (7 pts), boolean chains 6, error handling 2 (6 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 · ThemeRenderer._buildTitleAreaThing (cognitive 33) · ×1
  • ThemeRenderer._buildTitleAreaThing (cognitive 33) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:405 — ThemeRenderer._buildTitleAreaThing has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 3, loops 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 · _GifPickerSheetState._fetchTrending (cognitive 33) · ×1
  • _GifPickerSheetState._fetchTrending (cognitive 33) lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:79 — _GifPickerSheetState._fetchTrending has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 2 (6 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_GifPickerSheetState._searchGifs) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _GifPickerSheetState._searchGifs (cognitive 33) · ×1
  • _GifPickerSheetState._searchGifs (cognitive 33) lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:164 — _GifPickerSheetState._searchGifs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 2 (6 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_GifPickerSheetState._fetchTrending) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _EpisodeListBuilderState._buildHeaderCard (cognitive 33) · ×1
  • _EpisodeListBuilderState._buildHeaderCard (cognitive 33) lib/screens/anime/widgets/episode_list_builder.dart:942 — _EpisodeListBuilderState._buildHeaderCard has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 6 (11 pts), boolean chains 2 (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 · LocalSourceController._requestPermission (cognitive 33) · ×1
  • LocalSourceController._requestPermission (cognitive 33) lib/screens/local_source/controller/local_source_controller.dart:181 — LocalSourceController._requestPermission has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (30 pts), error handling 1 (2 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · _SettingsUiDetailsState._buildLivePreviewCard (cognitive 33) · ×1
  • _SettingsUiDetailsState._buildLivePreviewCard (cognitive 33) lib/screens/settings/sub_settings/settings_ui_details.dart:354 — _SettingsUiDetailsState._buildLivePreviewCard has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 14 (21 pts), if/else 8 (9 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaSyncer.getSimklIdFromExternal (cognitive 33) · ×1
  • MediaSyncer.getSimklIdFromExternal (cognitive 33) lib/utils/media_syncer.dart:58 — MediaSyncer.getSimklIdFromExternal has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 2 (9 pts), boolean chains 3, error handling 1 (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 · _ProfilePageState._buildOverviewTab (cognitive 32) · ×1
  • _ProfilePageState._buildOverviewTab (cognitive 32) lib/screens/profile/profile_page.dart:946 — _ProfilePageState._buildOverviewTab has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 10, if/else 9 (10 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.
D2 · Cognitive Complexity · _UserProfilePageState._buildOverviewTab (cognitive 32) · ×1
  • _UserProfilePageState._buildOverviewTab (cognitive 32) lib/screens/profile/user_profile_page.dart:908 — _UserProfilePageState._buildOverviewTab has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 10, if/else 9 (10 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.
D2 · Cognitive Complexity · _SearchPageState._loadMoreResults (cognitive 32) · ×1
  • _SearchPageState._loadMoreResults (cognitive 32) lib/screens/search/search_view.dart:585 — _SearchPageState._loadMoreResults has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotificationService._navigateFromNotification (cognitive 32) · ×1
  • NotificationService._navigateFromNotification (cognitive 32) lib/utils/notification.dart:345 — NotificationService._navigateFromNotification has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (13 pts), ternaries 4 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiImageDecoder._cIsolateEntryPoint (cognitive 32) · ×1
  • FfiImageDecoder._cIsolateEntryPoint (cognitive 32) lib/widgets/subsampling_scale_image_view/ffi_image_decoder.dart:203 — FfiImageDecoder._cIsolateEntryPoint has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 2 (5 pts), loops 1 (2 pts), boolean chains 1 (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 · AppNamePackageManager.getCurrentConfig (cognitive 31) · ×1
  • AppNamePackageManager.getCurrentConfig (cognitive 31) package_manager.dart:105 — AppNamePackageManager.getCurrentConfig has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (30 pts), error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Database.init (cognitive 31) · ×1
  • Database.init (cognitive 31) lib/database/database.dart:43 — Database.init has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 5 (12 pts), boolean chains 2 (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 · ReaderController._initTracking (cognitive 31) · ×1
  • ReaderController._initTracking (cognitive 31) lib/screens/manga/controller/reader_controller.dart:1544 — ReaderController._initTracking has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (14 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 · _ActivityHeatmapState.build (cognitive 31) · ×1
  • _ActivityHeatmapState.build (cognitive 31) lib/screens/profile/widgets/activity_heatmap.dart:52 — _ActivityHeatmapState.build has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, loops 3, ternaries 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 · CommentumService.updateCustomizations (cognitive 31) · ×1
  • CommentumService.updateCustomizations (cognitive 31) lib/services/commentum_service.dart:1499 — CommentumService.updateCustomizations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (30 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaDownloader.download (cognitive 31) · ×1
  • MediaDownloader.download (cognitive 31) lib/utils/media_downloader.dart:105 — MediaDownloader.download has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 7, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SubsamplingScaleImageViewState.didUpdateWidget (cognitive 31) · ×1
  • _SubsamplingScaleImageViewState.didUpdateWidget (cognitive 31) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:512 — _SubsamplingScaleImageViewState.didUpdateWidget has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (7 pts), boolean chains 4 (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 · CommunityService._buildSubmitBody (cognitive 30) · ×1
  • CommunityService._buildSubmitBody (cognitive 30) lib/controllers/services/community_service.dart:953 — CommunityService._buildSubmitBody has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MalService.updateListEntry (cognitive 30) · ×1
  • MalService.updateListEntry (cognitive 30) lib/controllers/services/mal/mal_service.dart:900 — MalService.updateListEntry has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (20 pts), ternaries 3 (6 pts), boolean chains 4 (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 · TorrentService._findFileForEpisode (cognitive 30) · ×1
  • TorrentService._findFileForEpisode (cognitive 30) lib/controllers/services/torrent/torrent_service.dart:210 — TorrentService._findFileForEpisode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 10, loops 4 (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 · PlayerController._initPhysicalOrientationListener (cognitive 30) · ×1
  • PlayerController._initPhysicalOrientationListener (cognitive 30) lib/screens/anime/watch/controller/player_controller.dart:795 — PlayerController._initPhysicalOrientationListener has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 2, error handling 1 (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 · EpisodesPane.build (cognitive 30) · ×1
  • EpisodesPane.build (cognitive 30) lib/screens/anime/watch/controls/widgets/episodes_pane.dart:197 — EpisodesPane.build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 9 (13 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordMarkdown.build (cognitive 30) · ×1
  • DiscordMarkdown.build (cognitive 30) lib/screens/anime/widgets/comments/discord_markdown.dart:36 — DiscordMarkdown.build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, 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 · _LeaderboardSheetState._buildLeaderboardTile (cognitive 30) · ×1
  • _LeaderboardSheetState._buildLeaderboardTile (cognitive 30) lib/screens/anime/widgets/comments/widgets/leaderboard_sheet.dart:324 — _LeaderboardSheetState._buildLeaderboardTile has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 14, if/else 10 (11 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 · _ListEditorModalState.initState (cognitive 30) · ×1
  • _ListEditorModalState.initState (cognitive 30) lib/screens/anime/widgets/list_editor.dart:157 — _ListEditorModalState.initState has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10, ternaries 3 (5 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 · DownloadController._runEpisodeDownload (cognitive 30) · ×1
  • DownloadController._runEpisodeDownload (cognitive 30) lib/screens/downloads/controller/download_controller.dart:936 — DownloadController._runEpisodeDownload has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReaderController.onScrollNotification (cognitive 30) · ×1
  • ReaderController.onScrollNotification (cognitive 30) lib/screens/manga/controller/reader_controller.dart:1106 — ReaderController.onScrollNotification has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 2 (6 pts), boolean chains 3 (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 · DesktopProfileHeader.build (cognitive 30) · ×1
  • DesktopProfileHeader.build (cognitive 30) lib/screens/profile/widgets/profile_header.dart:72 — DesktopProfileHeader.build has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (13 pts), if/else 10 (11 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 · _SearchPageState._buildControlsSection (cognitive 30) · ×1
  • _SearchPageState._buildControlsSection (cognitive 30) lib/screens/search/search_view.dart:799 — _SearchPageState._buildControlsSection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UpdateManager._shouldUpdate (cognitive 30) · ×1
  • UpdateManager._shouldUpdate (cognitive 30) lib/utils/updater.dart:180 — UpdateManager._shouldUpdate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, ternaries 2 (4 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 · GridAnimeCard.build (cognitive 30) · ×1
  • GridAnimeCard.build (cognitive 30) lib/widgets/media_items/media_item.dart:115 — GridAnimeCard.build has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 17 (22 pts), boolean chains 5, if/else 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AnilistErrorHandler.extractErrorMessage (cognitive 29) · ×1
  • AnilistErrorHandler.extractErrorMessage (cognitive 29) lib/controllers/services/anilist/anilist_error_handler.dart:9 — AnilistErrorHandler.extractErrorMessage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 2, error handling 1 (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 · NovelReaderController.onScrollNotification (cognitive 29) · ×1
  • NovelReaderController.onScrollNotification (cognitive 29) lib/screens/novel/reader/controller/reader_controller.dart:1307 — NovelReaderController.onScrollNotification has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 10 (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 · _CompatibilityInputPageState._onUserChanged (cognitive 29) · ×1
  • _CompatibilityInputPageState._onUserChanged (cognitive 29) lib/screens/profile/compatibility/compatibility_input_page.dart:118 — _CompatibilityInputPageState._onUserChanged has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _UserProfilePageState._fetchProfile (cognitive 29) · ×1
  • _UserProfilePageState._fetchProfile (cognitive 29) lib/screens/profile/user_profile_page.dart:135 — _UserProfilePageState._fetchProfile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SearchPageState._performSingleSourceSearch (cognitive 29) · ×1
  • _SearchPageState._performSingleSourceSearch (cognitive 29) lib/screens/search/search_view.dart:356 — _SearchPageState._performSingleSourceSearch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (8 pts), error handling 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 · CastV2Client._decodeCastMessage (cognitive 29) · ×1
  • CastV2Client._decodeCastMessage (cognitive 29) lib/services/cast/cast_v2_client.dart:186 — CastV2Client._decodeCastMessage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageColorExtractor._findDominantColorInt (cognitive 29) · ×1
  • ImageColorExtractor._findDominantColorInt (cognitive 29) lib/utils/color_extractor.dart:77 — ImageColorExtractor._findDominantColorInt has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 6 (10 pts), boolean chains 2, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AnymeXPopupMenuOverlay.build (cognitive 29) · ×1
  • _AnymeXPopupMenuOverlay.build (cognitive 29) lib/widgets/anymex_widgets/anymex_popup_menu.dart:227 — _AnymeXPopupMenuOverlay.build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 3 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlatformBuilderWithTablet.build (cognitive 29) · ×1
  • PlatformBuilderWithTablet.build (cognitive 29) lib/widgets/helper/platform_builder.dart:178 — PlatformBuilderWithTablet.build has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 8 (10 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SubsamplingScaleImageViewState._handleScaleUpdate (cognitive 29) · ×1
  • _SubsamplingScaleImageViewState._handleScaleUpdate (cognitive 29) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:1237 — _SubsamplingScaleImageViewState._handleScaleUpdate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 5, ternaries 1 (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 · Media.fromSmallSimkl (cognitive 28) · ×1
  • Media.fromSmallSimkl (cognitive 28) lib/models/Media/media.dart:977 — Media.fromSmallSimkl has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 7 (10 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 · __ListMediaEditorBottomSheetState.build (cognitive 28) · ×1
  • __ListMediaEditorBottomSheetState.build (cognitive 28) lib/screens/library/editor/list_editor.dart:833 — __ListMediaEditorBottomSheetState.build has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 7 (10 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 · CommentumService.createComment (cognitive 28) · ×1
  • CommentumService.createComment (cognitive 28) lib/services/commentum_service.dart:243 — CommentumService.createComment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 1 (2 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 · AppAbiDetector.getCurrentAppAbi (cognitive 28) · ×1
  • AppAbiDetector.getCurrentAppAbi (cognitive 28) lib/utils/abi_checker.dart:8 — AppAbiDetector.getCurrentAppAbi has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, error handling 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnilistApi.postQuery (cognitive 27) · ×1
  • AnilistApi.postQuery (cognitive 27) lib/controllers/services/anilist/anilist_api.dart:19 — AnilistApi.postQuery has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 1 (4 pts), boolean chains 3, error handling 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 · AnilistData.homeWidgets (cognitive 27) · ×1
  • AnilistData.homeWidgets (cognitive 27) lib/controllers/services/anilist/anilist_data.dart:115 — AnilistData.homeWidgets has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MalService._paintCached (cognitive 27) · ×1
  • MalService._paintCached (cognitive 27) lib/controllers/services/mal/mal_service.dart:225 — MalService._paintCached has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MalService.deleteListEntry (cognitive 27) · ×1
  • MalService.deleteListEntry (cognitive 27) lib/controllers/services/mal/mal_service.dart:1001 — MalService.deleteListEntry has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (8 pts), boolean chains 5 (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 · DownloadController._ensureNoMediaInTempDirs (cognitive 27) · ×1
  • DownloadController._ensureNoMediaInTempDirs (cognitive 27) lib/screens/downloads/controller/download_controller.dart:1882 — DownloadController._ensureNoMediaInTempDirs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (18 pts), error handling 2 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChapterListBuilderState._buildChapterDownloadButton (cognitive 27) · ×1
  • _ChapterListBuilderState._buildChapterDownloadButton (cognitive 27) lib/screens/manga/widgets/chapter_list_builder.dart:1217 — _ChapterListBuilderState._buildChapterDownloadButton has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (9 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DecorationClosetSheetState._onSavePressed (cognitive 27) · ×1
  • _DecorationClosetSheetState._onSavePressed (cognitive 27) lib/screens/profile/widgets/decoration_closet_sheet.dart:125 — _DecorationClosetSheetState._onSavePressed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, ternaries 4, 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.
D2 · Cognitive Complexity · _AnymeXPopupMenuOverlay._buildEntry (cognitive 27) · ×1
  • _AnymeXPopupMenuOverlay._buildEntry (cognitive 27) lib/widgets/anymex_widgets/anymex_popup_menu.dart:446 — _AnymeXPopupMenuOverlay._buildEntry has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 7 (11 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 · CookieManager.readCookiesFromWebView (cognitive 26) · ×1
  • CookieManager.readCookiesFromWebView (cognitive 26) lib/controllers/network/cookie_manager.dart:443 — CookieManager.readCookiesFromWebView has cognitive complexity 26 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (4 pts), error handling 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 · AnilistData.fetchStudioDetails (cognitive 26) · ×1
  • AnilistData.fetchStudioDetails (cognitive 26) lib/controllers/services/anilist/anilist_data.dart:881 — AnilistData.fetchStudioDetails has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackupRestoreService._buildBackupData (cognitive 26) · ×1
  • BackupRestoreService._buildBackupData (cognitive 26) lib/controllers/services/backup_restore/backup_restore_service.dart:448 — BackupRestoreService._buildBackupData has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 16, boolean chains 9, 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 · SourceController._activateByName (cognitive 26) · ×1
  • SourceController._activateByName (cognitive 26) lib/controllers/source/source_controller.dart:396 — SourceController._activateByName has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlayerController.initializePlayerControlsIfNeeded (cognitive 26) · ×1
  • PlayerController.initializePlayerControlsIfNeeded (cognitive 26) lib/screens/anime/watch/controller/player_controller.dart:481 — PlayerController.initializePlayerControlsIfNeeded has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6 (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 · _ContinuousReaderViewState._buildImage (cognitive 26) · ×1
  • _ContinuousReaderViewState._buildImage (cognitive 26) lib/screens/manga/widgets/reader/continuous_reader.dart:365 — _ContinuousReaderViewState._buildImage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 3 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PressableHighlightCardState.build (cognitive 26) · ×1
  • _PressableHighlightCardState.build (cognitive 26) lib/screens/profile/widgets/stats_overview_cards.dart:460 — _PressableHighlightCardState.build has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 18 (20 pts), if/else 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.
D2 · Cognitive Complexity · CastProxyServer._rewriteHlsMasterManifest (cognitive 26) · ×1
  • CastProxyServer._rewriteHlsMasterManifest (cognitive 26) lib/services/cast/cast_proxy_server.dart:261 — CastProxyServer._rewriteHlsMasterManifest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 4, 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 · NotificationImageHelper._sweepCacheInBackground (cognitive 26) · ×1
  • NotificationImageHelper._sweepCacheInBackground (cognitive 26) lib/utils/notification_image_helper.dart:73 — NotificationImageHelper._sweepCacheInBackground has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 2 (5 pts), loops 2 (5 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 · SettingsSheet._buildHeroHeader (cognitive 26) · ×1
  • SettingsSheet._buildHeroHeader (cognitive 26) lib/widgets/non_widgets/settings_sheet.dart:176 — SettingsSheet._buildHeroHeader has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 9 (11 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 · _FilterScreenState._getNavItemForTab (cognitive 25) · ×1
  • _FilterScreenState._getNavItemForTab (cognitive 25) lib/main.dart:576 — _FilterScreenState._getNavItemForTab has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 8 (10 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnilistAuth._anilistPost (cognitive 25) · ×1
  • AnilistAuth._anilistPost (cognitive 25) lib/controllers/services/anilist/anilist_auth.dart:112 — AnilistAuth._anilistPost has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 5, ternaries 1 (2 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 · MediaDetailsController._initActiveSource (cognitive 25) · ×1
  • MediaDetailsController._initActiveSource (cognitive 25) lib/screens/anime/details/controller/media_details_controller.dart:275 — MediaDetailsController._initActiveSource has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 5 (10 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChapterListBuilderState._onTap (cognitive 25) · ×1
  • _ChapterListBuilderState._onTap (cognitive 25) lib/screens/manga/widgets/chapter_list_builder.dart:256 — _ChapterListBuilderState._onTap has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, ternaries 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 · _AnymeXModerationActionSheetState.build (cognitive 25) · ×1
  • _AnymeXModerationActionSheetState.build (cognitive 25) lib/screens/settings/sub_settings/widgets/moderation_action_sheet.dart:262 — _AnymeXModerationActionSheetState.build has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (16 pts), if/else 5 (8 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 · _WatchiumPageState._joinRoomFromCard (cognitive 25) · ×1
  • _WatchiumPageState._joinRoomFromCard (cognitive 25) lib/screens/watchium/watchium_page.dart:1064 — _WatchiumPageState._joinRoomFromCard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, 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 · CommentumService.deleteComment (cognitive 25) · ×1
  • CommentumService.deleteComment (cognitive 25) lib/services/commentum_service.dart:388 — CommentumService.deleteComment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 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 · PlayerShaders._getAppDirectory (cognitive 25) · ×1
  • PlayerShaders._getAppDirectory (cognitive 25) lib/utils/shaders.dart:115 — PlayerShaders._getAppDirectory has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (20 pts), error handling 2 (5 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 · _AnymeXImageState.build (cognitive 25) · ×1
  • _AnymeXImageState.build (cognitive 25) lib/widgets/anymex_widgets/anymex_image.dart:187 — _AnymeXImageState.build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (11 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 · AnymeXScaffold.build (cognitive 25) · ×1
  • AnymeXScaffold.build (cognitive 25) lib/widgets/common/anymex_scaffold.dart:148 — AnymeXScaffold.build has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 9, if/else 5 (6 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LogoAnimationPreviewDialogState._buildAnimationList (cognitive 25) · ×1
  • _LogoAnimationPreviewDialogState._buildAnimationList (cognitive 25) lib/widgets/dialogs/logo_animation_preview_dialog.dart:835 — _LogoAnimationPreviewDialogState._buildAnimationList has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 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 · TilingEngine.initialiseTileMap (cognitive 25) · ×1
  • TilingEngine.initialiseTileMap (cognitive 25) lib/widgets/subsampling_scale_image_view/tiling_engine.dart:31 — TilingEngine.initialiseTileMap has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (10 pts), ternaries 2 (8 pts), boolean chains 4, if/else 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 · AnilistData.fetchAnilistHomepage (cognitive 24) · ×1
  • AnilistData.fetchAnilistHomepage (cognitive 24) lib/controllers/services/anilist/anilist_data.dart:444 — AnilistData.fetchAnilistHomepage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (24 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 · GistSyncService.syncGistHtmlUrl (cognitive 24) · ×1
  • GistSyncService.syncGistHtmlUrl (cognitive 24) lib/controllers/sync/gist_sync_service.dart:289 — GistSyncService.syncGistHtmlUrl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, ternaries 1 (2 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 · _DoubleTapSeekWidgetState._setPlaybackRate (cognitive 24) · ×1
  • _DoubleTapSeekWidgetState._setPlaybackRate (cognitive 24) lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:286 — _DoubleTapSeekWidgetState._setPlaybackRate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (23 pts), error handling 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _CommentSectionState._buildReplyItem (cognitive 24) · ×1
  • _CommentSectionState._buildReplyItem (cognitive 24) lib/screens/anime/widgets/comments/comments_section.dart:1385 — _CommentSectionState._buildReplyItem has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CharactersCarousel.build (cognitive 24) · ×1
  • CharactersCarousel.build (cognitive 24) lib/screens/anime/widgets/voice_actor.dart:19 — CharactersCarousel.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 4 (6 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 · NovelReaderController._cleanHtmlTags (cognitive 24) · ×1
  • NovelReaderController._cleanHtmlTags (cognitive 24) lib/screens/novel/reader/controller/reader_controller.dart:912 — NovelReaderController._cleanHtmlTags has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, loops 2 (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 · _NovelContentWidgetState.build (cognitive 24) · ×1
  • _NovelContentWidgetState.build (cognitive 24) lib/screens/novel/reader/widgets/novel_content.dart:40 — _NovelContentWidgetState.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, ternaries 1 (3 pts) (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 · _DictionarySheetState._lookup (cognitive 24) · ×1
  • _DictionarySheetState._lookup (cognitive 24) lib/screens/novel/reader/widgets/novel_content.dart:286 — _DictionarySheetState._lookup has cognitive complexity 24 (threshold 15). Drivers by points: loops 3 (12 pts), if/else 5 (11 pts), error handling 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _CompatibilityResultPageState._showCommonMediaSheet (cognitive 24) · ×1
  • _CompatibilityResultPageState._showCommonMediaSheet (cognitive 24) lib/screens/profile/compatibility/compatibility_result_page.dart:1287 — _CompatibilityResultPageState._showCommonMediaSheet has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (16 pts), if/else 5 (8 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 · DesktopStatsGrid.build (cognitive 24) · ×1
  • DesktopStatsGrid.build (cognitive 24) lib/screens/profile/widgets/stats_overview_cards.dart:15 — DesktopStatsGrid.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 16 (18 pts), if/else 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.
D2 · Cognitive Complexity · _SettingsReaderState._showTapZonesDialog (cognitive 24) · ×1
  • _SettingsReaderState._showTapZonesDialog (cognitive 24) lib/screens/settings/sub_settings/settings_reader.dart:595 — _SettingsReaderState._showTapZonesDialog has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 9 (11 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 · _WatchiumPageState._buildCurrentRoomSection (cognitive 24) · ×1
  • _WatchiumPageState._buildCurrentRoomSection (cognitive 24) lib/screens/watchium/watchium_page.dart:785 — _WatchiumPageState._buildCurrentRoomSection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (8 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 · FfiImageDecoder._processNext (cognitive 24) · ×1
  • FfiImageDecoder._processNext (cognitive 24) lib/widgets/subsampling_scale_image_view/ffi_image_decoder.dart:400 — FfiImageDecoder._processNext has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 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 · _WatchiumCreateSheetState._joinRoom (cognitive 24) · ×1
  • _WatchiumCreateSheetState._joinRoom (cognitive 24) lib/widgets/watchium/watchium_create_dialog.dart:608 — _WatchiumCreateSheetState._joinRoom has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (5 pts), boolean chains 3, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnilistAuth._fetchUserDetailsInternal (cognitive 23) · ×1
  • AnilistAuth._fetchUserDetailsInternal (cognitive 23) lib/controllers/services/anilist/anilist_auth.dart:888 — AnilistAuth._fetchUserDetailsInternal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, 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 · AnilistRateLimiter._processQueue (cognitive 23) · ×1
  • AnilistRateLimiter._processQueue (cognitive 23) lib/controllers/services/anilist/anilist_rate_limiter.dart:30 — AnilistRateLimiter._processQueue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WatchiumService._connectSocket (cognitive 23) · ×1
  • WatchiumService._connectSocket (cognitive 23) lib/controllers/watchium/watchium_service.dart:172 — WatchiumService._connectSocket has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TrackedMedia.formattedProgress (cognitive 23) · ×1
  • TrackedMedia.formattedProgress (cognitive 23) lib/models/Anilist/anilist_media_user.dart:149 — TrackedMedia.formattedProgress has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 14, if/else 5, ternaries 3 (4 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 · MediaDetailsController.fetchSourceDetailsFromMedia (cognitive 23) · ×1
  • MediaDetailsController.fetchSourceDetailsFromMedia (cognitive 23) lib/screens/anime/details/controller/media_details_controller.dart:731 — MediaDetailsController.fetchSourceDetailsFromMedia has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 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 · _CalendarState.build (cognitive 23) · ×1
  • _CalendarState.build (cognitive 23) lib/screens/anime/misc/calendar.dart:434 — _CalendarState.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 8, boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Ios26PlayerControlTheme.buildBottomControls (cognitive 23) · ×1
  • Ios26PlayerControlTheme.buildBottomControls (cognitive 23) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:229 — Ios26PlayerControlTheme.buildBottomControls has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 13 (15 pts), if/else 5 (6 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ThemeRenderer._makeButtonThing (cognitive 23) · ×1
  • ThemeRenderer._makeButtonThing (cognitive 23) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:716 — ThemeRenderer._makeButtonThing has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 6, boolean chains 5 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ThemeRenderer._resolveColor (cognitive 23) · ×1
  • ThemeRenderer._resolveColor (cognitive 23) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1286 — ThemeRenderer._resolveColor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 1 (3 pts), boolean chains 2, 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 · _UserCommentsSheetContentState.build (cognitive 23) · ×1
  • _UserCommentsSheetContentState.build (cognitive 23) lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:80 — _UserCommentsSheetContentState.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 3 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MinimalEpisodeWidget.build (cognitive 23) · ×1
  • MinimalEpisodeWidget.build (cognitive 23) lib/screens/anime/widgets/episode/styles/minimal_style.dart:30 — MinimalEpisodeWidget.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9, boolean chains 8, if/else 5 (6 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 · _DownloadScreenState._buildChapterStep (cognitive 23) · ×1
  • _DownloadScreenState._buildChapterStep (cognitive 23) lib/screens/downloads/download_screen.dart:1219 — _DownloadScreenState._buildChapterStep has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12, if/else 7, boolean chains 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 · _ChapterListSheetState.build (cognitive 23) · ×1
  • _ChapterListSheetState.build (cognitive 23) lib/screens/manga/widgets/reader/top_controls.dart:288 — _ChapterListSheetState.build has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 16, ternaries 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ChapterListItem.build (cognitive 23) · ×1
  • ChapterListItem.build (cognitive 23) lib/screens/novel/details/widgets/chapter_item.dart:34 — ChapterListItem.build has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 18, ternaries 3, if/else 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 · FavoritesSection.build (cognitive 23) · ×1
  • FavoritesSection.build (cognitive 23) lib/screens/profile/widgets/favorites_section.dart:35 — FavoritesSection.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (7 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContributorsPageState._loadContributors (cognitive 23) · ×1
  • _ContributorsPageState._loadContributors (cognitive 23) lib/screens/settings/sub_settings/contributors/contributors.dart:310 — _ContributorsPageState._loadContributors has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, ternaries 2 (6 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 · CastProxyServer._resolveLocalIp (cognitive 23) · ×1
  • CastProxyServer._resolveLocalIp (cognitive 23) lib/services/cast/cast_proxy_server.dart:61 — CastProxyServer._resolveLocalIp has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 7, loops 4 (7 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 · Deeplink._parseCustomTarget (cognitive 23) · ×1
  • Deeplink._parseCustomTarget (cognitive 23) lib/utils/deeplink.dart:250 — Deeplink._parseCustomTarget has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 1 (5 pts), boolean chains 3 (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 · NotificationImageHelper.getCachedImagePath (cognitive 23) · ×1
  • NotificationImageHelper.getCachedImagePath (cognitive 23) lib/utils/notification_image_helper.dart:10 — NotificationImageHelper.getCachedImagePath has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (3 pts), boolean chains 2, 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 · TilingEngine.refreshRequiredTiles (cognitive 23) · ×1
  • TilingEngine.refreshRequiredTiles (cognitive 23) lib/widgets/subsampling_scale_image_view/tiling_engine.dart:112 — TilingEngine.refreshRequiredTiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 3, 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 · DiscordRPCController.updateMangaPresence (cognitive 22) · ×1
  • DiscordRPCController.updateMangaPresence (cognitive 22) lib/controllers/discord/discord_rpc.dart:794 — DiscordRPCController.updateMangaPresence has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 1 (3 pts), 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 · JikanService.getFillerEpisodes (cognitive 22) · ×1
  • JikanService.getFillerEpisodes (cognitive 22) lib/controllers/services/jikan.dart:7 — JikanService.getFillerEpisodes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (6 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _GistSyncCard.build (cognitive 22) · ×1
  • _GistSyncCard.build (cognitive 22) lib/controllers/sync/progress_sync_section.dart:35 — _GistSyncCard.build has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Media.mergeSecondaryData (cognitive 22) · ×1
  • Media.mergeSecondaryData (cognitive 22) lib/models/Media/media.dart:1340 — Media.mergeSecondaryData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 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 · PlayerController._trackLocally (cognitive 22) · ×1
  • PlayerController._trackLocally (cognitive 22) lib/screens/anime/watch/controller/player_controller.dart:2963 — PlayerController._trackLocally has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 2 (5 pts), ternaries 2 (4 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _BottomSheetListItemState.build (cognitive 22) · ×1
  • _BottomSheetListItemState.build (cognitive 22) lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:285 — _BottomSheetListItemState.build has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (14 pts), if/else 6 (7 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CommentSectionController.formatCommentTimestamp (cognitive 22) · ×1
  • CommentSectionController.formatCommentTimestamp (cognitive 22) lib/screens/anime/widgets/comments/controller/comments_controller.dart:467 — CommentSectionController.formatCommentTimestamp has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, 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 · _DownloadServerSelectorState._fetchServers (cognitive 22) · ×1
  • _DownloadServerSelectorState._fetchServers (cognitive 22) lib/screens/downloads/widgets/download_server_selector.dart:90 — _DownloadServerSelectorState._fetchServers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 1 (2 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 · ReaderController._updatePageStateForSpread (cognitive 22) · ×1
  • ReaderController._updatePageStateForSpread (cognitive 22) lib/screens/manga/controller/reader_controller.dart:1401 — ReaderController._updatePageStateForSpread has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, ternaries 3 (5 pts), 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 · _ChapterSliverSectionState._findContinueChapter (cognitive 22) · ×1
  • _ChapterSliverSectionState._findContinueChapter (cognitive 22) lib/screens/novel/details/widgets/chapters_section.dart:167 — _ChapterSliverSectionState._findContinueChapter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListStatusCard.build (cognitive 22) · ×1
  • ListStatusCard.build (cognitive 22) lib/screens/profile/widgets/list_status_card.dart:28 — ListStatusCard.build has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 16 (17 pts), if/else 4, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _FuturisticFilterSheetState._fetchFilterData (cognitive 22) · ×1
  • _FuturisticFilterSheetState._fetchFilterData (cognitive 22) lib/screens/search/widgets/search_widgets.dart:438 — _FuturisticFilterSheetState._fetchFilterData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 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 · _SettingsAnilistApiState._buildAboutEditor (cognitive 22) · ×1
  • _SettingsAnilistApiState._buildAboutEditor (cognitive 22) lib/screens/settings/sub_settings/settings_anilist_api.dart:910 — _SettingsAnilistApiState._buildAboutEditor has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 4 (5 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 · _FullscreenImageViewerState._shareImage (cognitive 22) · ×1
  • _FullscreenImageViewerState._shareImage (cognitive 22) lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:148 — _FullscreenImageViewerState._shareImage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BakedBlurImage.load (cognitive 22) · ×1
  • BakedBlurImage.load (cognitive 22) lib/widgets/common/baked_blur_image.dart:288 — BakedBlurImage.load has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Header.build (cognitive 22) · ×1
  • Header.build (cognitive 22) lib/widgets/header/header.dart:74 — Header.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, ternaries 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownListInputFormatter.formatEditUpdate (cognitive 22) · ×1
  • MarkdownListInputFormatter.formatEditUpdate (cognitive 22) lib/widgets/non_widgets/activity_composer_sheet.dart:745 — MarkdownListInputFormatter.formatEditUpdate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3 (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 · _WatchiumPartyPopupContentState._buildChat (cognitive 22) · ×1
  • _WatchiumPartyPopupContentState._buildChat (cognitive 22) lib/widgets/watchium/watchium_party_popup.dart:305 — _WatchiumPartyPopupContentState._buildChat has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 6, if/else 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · OfflineStorageController.addOrUpdateReadChapter (cognitive 21) · ×1
  • OfflineStorageController.addOrUpdateReadChapter (cognitive 21) lib/controllers/offline/offline_storage_controller.dart:902 — OfflineStorageController.addOrUpdateReadChapter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 2 (4 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 · AnilistAuth.formatScore (cognitive 21) · ×1
  • AnilistAuth.formatScore (cognitive 21) lib/controllers/services/anilist/anilist_auth.dart:56 — AnilistAuth.formatScore has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 4 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackupRestoreService.isBackupEncrypted (cognitive 21) · ×1
  • BackupRestoreService.isBackupEncrypted (cognitive 21) lib/controllers/services/backup_restore/backup_restore_service.dart:1613 — BackupRestoreService.isBackupEncrypted has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 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 · CommunityService.castVote (cognitive 21) · ×1
  • CommunityService.castVote (cognitive 21) lib/controllers/services/community_service.dart:827 — CommunityService.castVote has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WatchiumService.createRoom (cognitive 21) · ×1
  • WatchiumService.createRoom (cognitive 21) lib/controllers/watchium/watchium_service.dart:468 — WatchiumService.createRoom has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, 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 · MediaDetailsController._fetchFullDetails (cognitive 21) · ×1
  • MediaDetailsController._fetchFullDetails (cognitive 21) lib/screens/anime/details/controller/media_details_controller.dart:468 — MediaDetailsController._fetchFullDetails has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MediaDetailsPageState.initState (cognitive 21) · ×1
  • _MediaDetailsPageState.initState (cognitive 21) lib/screens/anime/details/media_details_page.dart:157 — _MediaDetailsPageState.initState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, 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 · _StudioDetailsSheetContentState.build (cognitive 21) · ×1
  • _StudioDetailsSheetContentState.build (cognitive 21) lib/screens/anime/studio_details_page.dart:118 — _StudioDetailsSheetContentState.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 6 (7 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _AnimeThemePlayerDialogState.build (cognitive 21) · ×1
  • _AnimeThemePlayerDialogState.build (cognitive 21) lib/screens/anime/themes/anime_theme_dialog.dart:175 — _AnimeThemePlayerDialogState.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 11 (15 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.
D2 · Cognitive Complexity · PlayerController._findBestMatchingTrack (cognitive 21) · ×1
  • PlayerController._findBestMatchingTrack (cognitive 21) lib/screens/anime/watch/controller/player_controller.dart:1843 — PlayerController._findBestMatchingTrack has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, 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 · _CommentSectionState._buildCommentWithReplies (cognitive 21) · ×1
  • _CommentSectionState._buildCommentWithReplies (cognitive 21) lib/screens/anime/widgets/comments/comments_section.dart:993 — _CommentSectionState._buildCommentWithReplies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CommentInputBarState._buildTagsAndProgressRow (cognitive 21) · ×1
  • _CommentInputBarState._buildTagsAndProgressRow (cognitive 21) lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart:326 — _CommentInputBarState._buildTagsAndProgressRow has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (20 pts), if/else 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 · _LeaderboardSheetState.build (cognitive 21) · ×1
  • _LeaderboardSheetState.build (cognitive 21) lib/screens/anime/widgets/comments/widgets/leaderboard_sheet.dart:91 — _LeaderboardSheetState.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ServerSheetContentState._checkAndAutoSelect (cognitive 21) · ×1
  • _ServerSheetContentState._checkAndAutoSelect (cognitive 21) lib/screens/anime/widgets/episode_list_builder.dart:1740 — _ServerSheetContentState._checkAndAutoSelect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HistoryEditorState._buildHistoryCard (cognitive 21) · ×1
  • _HistoryEditorState._buildHistoryCard (cognitive 21) lib/screens/library/editor/history_editor.dart:477 — _HistoryEditorState._buildHistoryCard has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12 (15 pts), if/else 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _AnimeListState.initState (cognitive 21) · ×1
  • _AnimeListState.initState (cognitive 21) lib/screens/library/online/anime_list.dart:104 — _AnimeListState.initState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 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 · NovelReaderController._mapPlainToHtmlOffset (cognitive 21) · ×1
  • NovelReaderController._mapPlainToHtmlOffset (cognitive 21) lib/screens/novel/reader/controller/reader_controller.dart:523 — NovelReaderController._mapPlainToHtmlOffset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CompatibilityInputPageState._submit (cognitive 21) · ×1
  • _CompatibilityInputPageState._submit (cognitive 21) lib/screens/profile/compatibility/compatibility_input_page.dart:204 — _CompatibilityInputPageState._submit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · _UserMediaListPageState.build (cognitive 21) · ×1
  • _UserMediaListPageState.build (cognitive 21) lib/screens/profile/widgets/user_media_list_page.dart:522 — _UserMediaListPageState.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 7 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _GroupFilterWidgetState.build (cognitive 21) · ×1
  • _GroupFilterWidgetState.build (cognitive 21) lib/screens/search/widgets/extension_filter_sheet.dart:539 — _GroupFilterWidgetState.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (5 pts), ternaries 4, boolean chains 2 (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 · _UserListPageState._loadMoreUsers (cognitive 21) · ×1
  • _UserListPageState._loadMoreUsers (cognitive 21) lib/screens/settings/sub_settings/settings_moderation.dart:1372 — _UserListPageState._loadMoreUsers has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (6 pts), boolean chains 4, 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 · _SettingsUiState._showReorderTabsDialog (cognitive 21) · ×1
  • _SettingsUiState._showReorderTabsDialog (cognitive 21) lib/screens/settings/sub_settings/settings_ui.dart:267 — _SettingsUiState._showReorderTabsDialog has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 6 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CastService._castChromecast (cognitive 21) · ×1
  • CastService._castChromecast (cognitive 21) lib/services/cast/cast_service.dart:340 — CastService._castChromecast has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, ternaries 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 · CommentumService._mapCommentumToAnymeXComment (cognitive 21) · ×1
  • CommentumService._mapCommentumToAnymeXComment (cognitive 21) lib/services/commentum_service.dart:1282 — CommentumService._mapCommentumToAnymeXComment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 2 (4 pts), ternaries 2 (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 · WatchOrderUtil.fetchWatchOrder (cognitive 21) · ×1
  • WatchOrderUtil.fetchWatchOrder (cognitive 21) lib/utils/watch_order_util.dart:99 — WatchOrderUtil.fetchWatchOrder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 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 · _CloudflareBypassWebViewState._syncCookiesAndUserAgent (cognitive 21) · ×1
  • _CloudflareBypassWebViewState._syncCookiesAndUserAgent (cognitive 21) lib/widgets/common/cloudflare_webview.dart:124 — _CloudflareBypassWebViewState._syncCookiesAndUserAgent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, error handling 2 (3 pts), loops 1 (2 pts), ternaries 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 · MediaModeSelector._autoPlayLastMedia (cognitive 21) · ×1
  • MediaModeSelector._autoPlayLastMedia (cognitive 21) lib/widgets/common/media_mode_selector.dart:53 — MediaModeSelector._autoPlayLastMedia has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (6 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 · _FloatingPillNavBarState._buildMobileLayout (cognitive 21) · ×1
  • _FloatingPillNavBarState._buildMobileLayout (cognitive 21) lib/widgets/common/navbar/styles/floating_pill_navbar.dart:187 — _FloatingPillNavBarState._buildMobileLayout has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), 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 · _ActivityCardState._showActivityOptions (cognitive 21) · ×1
  • _ActivityCardState._showActivityOptions (cognitive 21) lib/widgets/non_widgets/activity_card.dart:150 — _ActivityCardState._showActivityOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 5 (7 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnilistData.fetchSecondaryDetails (cognitive 20) · ×1
  • AnilistData.fetchSecondaryDetails (cognitive 20) lib/controllers/services/anilist/anilist_data.dart:1338 — AnilistData.fetchSecondaryDetails has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 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 · _GistSyncCard._importGistJson (cognitive 20) · ×1
  • _GistSyncCard._importGistJson (cognitive 20) lib/controllers/sync/progress_sync_section.dart:708 — _GistSyncCard._importGistJson has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommentsDatabase.organizeComments (cognitive 20) · ×1
  • CommentsDatabase.organizeComments (cognitive 20) lib/database/comments/comments_db.dart:46 — CommentsDatabase.organizeComments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlayerController._isAutoSkipEnabledForCurrentSegment (cognitive 20) · ×1
  • PlayerController._isAutoSkipEnabledForCurrentSegment (cognitive 20) lib/screens/anime/watch/controller/player_controller.dart:298 — PlayerController._isAutoSkipEnabledForCurrentSegment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlayerController._resolveDecoderHwdec (cognitive 20) · ×1
  • PlayerController._resolveDecoderHwdec (cognitive 20) lib/screens/anime/watch/controller/player_controller.dart:1094 — PlayerController._resolveDecoderHwdec has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _DoubleTapSeekWidgetState.build (cognitive 20) · ×1
  • _DoubleTapSeekWidgetState.build (cognitive 20) lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:840 — _DoubleTapSeekWidgetState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11, if/else 7, 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 · MediaKitPlayer.initialize (cognitive 20) · ×1
  • MediaKitPlayer.initialize (cognitive 20) lib/screens/anime/watch/player/media_kit_player.dart:76 — MediaKitPlayer.initialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (6 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _EpisodeListBuilderState._updateChunkIndex (cognitive 20) · ×1
  • _EpisodeListBuilderState._updateChunkIndex (cognitive 20) lib/screens/anime/widgets/episode_list_builder.dart:202 — _EpisodeListBuilderState._updateChunkIndex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 1 (4 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 · NovelReaderController._loadVoices (cognitive 20) · ×1
  • NovelReaderController._loadVoices (cognitive 20) lib/screens/novel/reader/controller/reader_controller.dart:568 — NovelReaderController._loadVoices has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ProfileStatsTabState._getVal (cognitive 20) · ×1
  • _ProfileStatsTabState._getVal (cognitive 20) lib/screens/profile/widgets/profile_stats_tab.dart:530 — _ProfileStatsTabState._getVal has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 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 · _UserListPageState._loadUsers (cognitive 20) · ×1
  • _UserListPageState._loadUsers (cognitive 20) lib/screens/settings/sub_settings/settings_moderation.dart:1330 — _UserListPageState._loadUsers has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 2 (5 pts), boolean chains 4, 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 · _UserStatsPageState.build (cognitive 20) · ×1
  • _UserStatsPageState.build (cognitive 20) lib/screens/stats/user_stats_page.dart:99 — _UserStatsPageState.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 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 · _WatchiumPageState._buildJoinByCodeSection (cognitive 20) · ×1
  • _WatchiumPageState._buildJoinByCodeSection (cognitive 20) lib/screens/watchium/watchium_page.dart:572 — _WatchiumPageState._buildJoinByCodeSection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 7 (8 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.
D2 · Cognitive Complexity · CastService._startRokuAndSsdpDiscovery (cognitive 20) · ×1
  • CastService._startRokuAndSsdpDiscovery (cognitive 20) lib/services/cast/cast_service.dart:177 — CastService._startRokuAndSsdpDiscovery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2, loops 1 (2 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 · CastService.stopCasting (cognitive 20) · ×1
  • CastService.stopCasting (cognitive 20) lib/services/cast/cast_service.dart:657 — CastService.stopCasting has cognitive complexity 20 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 5 (9 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 · _AnilistAboutMeState._openUrl (cognitive 20) · ×1
  • _AnilistAboutMeState._openUrl (cognitive 20) lib/utils/al_about_me.dart:403 — _AnilistAboutMeState._openUrl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 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 · ImageColorExtractor.extractColor (cognitive 20) · ×1
  • ImageColorExtractor.extractColor (cognitive 20) lib/utils/color_extractor.dart:15 — ImageColorExtractor.extractColor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Deeplink.handleDeepLink (cognitive 20) · ×1
  • Deeplink.handleDeepLink (cognitive 20) lib/utils/deeplink.dart:23 — Deeplink.handleDeepLink has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Liquid._cpuOptimizedBlurCustom (cognitive 20) · ×1
  • Liquid._cpuOptimizedBlurCustom (cognitive 20) lib/utils/liquid.dart:370 — Liquid._cpuOptimizedBlurCustom has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (6 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubtitlePreTranslator.preTranslateFromUrl (cognitive 20) · ×1
  • SubtitlePreTranslator.preTranslateFromUrl (cognitive 20) lib/utils/subtitle_pre_translator.dart:42 — SubtitlePreTranslator.preTranslateFromUrl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 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 · _NavBarItemState.build (cognitive 20) · ×1
  • _NavBarItemState.build (cognitive 20) lib/widgets/common/navbar.dart:135 — _NavBarItemState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 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 · _SubsamplingScaleImageViewState._loadTile (cognitive 20) · ×1
  • _SubsamplingScaleImageViewState._loadTile (cognitive 20) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:1139 — _SubsamplingScaleImageViewState._loadTile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 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 · DiscordRPCController.updateMediaPresence (cognitive 19) · ×1
  • DiscordRPCController.updateMediaPresence (cognitive 19) lib/controllers/discord/discord_rpc.dart:923 — DiscordRPCController.updateMediaPresence has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 4 (5 pts), boolean chains 4, error handling 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 · ReasonUserProfile.matchesUser (cognitive 19) · ×1
  • ReasonUserProfile.matchesUser (cognitive 19) lib/controllers/services/community_service.dart:124 — ReasonUserProfile.matchesUser has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CustomizationRepository.loadBanners (cognitive 19) · ×1
  • CustomizationRepository.loadBanners (cognitive 19) lib/database/comments/model/user_customization.dart:234 — CustomizationRepository.loadBanners has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 3, loops 1 (3 pts), 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 · OfflineMedia.displayTitle (cognitive 19) · ×1
  • OfflineMedia.displayTitle (cognitive 19) lib/database/isar_models/offline_media.dart:30 — OfflineMedia.displayTitle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnilistNotificationItem.displayBody (cognitive 19) · ×1
  • AnilistNotificationItem.displayBody (cognitive 19) lib/models/Anilist/anilist_notification.dart:64 — AnilistNotificationItem.displayBody has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (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 · Media.displayTitle (cognitive 19) · ×1
  • Media.displayTitle (cognitive 19) lib/models/Media/media.dart:28 — Media.displayTitle has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (8 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _ListExporterPageState._convertTrackedListToMalXml (cognitive 19) · ×1
  • _ListExporterPageState._convertTrackedListToMalXml (cognitive 19) lib/screens/anime/misc/list_exporter.dart:82 — _ListExporterPageState._convertTrackedListToMalXml has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ListExporterPageState.build (cognitive 19) · ×1
  • _ListExporterPageState.build (cognitive 19) lib/screens/anime/misc/list_exporter.dart:358 — _ListExporterPageState.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (17 pts), if/else 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · IosLegacyPlayerControlTheme.buildBottomControls (cognitive 19) · ×1
  • IosLegacyPlayerControlTheme.buildBottomControls (cognitive 19) lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:265 — IosLegacyPlayerControlTheme.buildBottomControls has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (15 pts), if/else 2 (3 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.
D2 · Cognitive Complexity · ThemeRenderer._buildThreeColumnRow (cognitive 19) · ×1
  • ThemeRenderer._buildThreeColumnRow (cognitive 19) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:343 — ThemeRenderer._buildThreeColumnRow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, 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 · _DoubleTapSeekWidgetState._handleKeyboard (cognitive 19) · ×1
  • _DoubleTapSeekWidgetState._handleKeyboard (cognitive 19) lib/screens/anime/watch/controls/widgets/double_tap_seek.dart:797 — _DoubleTapSeekWidgetState._handleKeyboard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 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 · _TracksPopupContentState._buildSourceSubtitles (cognitive 19) · ×1
  • _TracksPopupContentState._buildSourceSubtitles (cognitive 19) lib/screens/anime/watch/controls/widgets/tracks_popup.dart:174 — _TracksPopupContentState._buildSourceSubtitles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 8, boolean chains 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _CommentSectionState._findParentUsername (cognitive 19) · ×1
  • _CommentSectionState._findParentUsername (cognitive 19) lib/screens/anime/widgets/comments/comments_section.dart:1357 — _CommentSectionState._findParentUsername has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (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. This shape REPEATS in the file: one other method here (_CommentSectionState._findParentRole) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _CommentSectionState._findParentRole (cognitive 19) · ×1
  • _CommentSectionState._findParentRole (cognitive 19) lib/screens/anime/widgets/comments/comments_section.dart:1371 — _CommentSectionState._findParentRole has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (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. This shape REPEATS in the file: one other method here (_CommentSectionState._findParentUsername) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _CommentSectionState._showCommentContextMenu (cognitive 19) · ×1
  • _CommentSectionState._showCommentContextMenu (cognitive 19) lib/screens/anime/widgets/comments/comments_section.dart:2093 — _CommentSectionState._showCommentContextMenu has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5 (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 · _CommentSectionState._showUserInfoDialog (cognitive 19) · ×1
  • _CommentSectionState._showUserInfoDialog (cognitive 19) lib/screens/anime/widgets/comments/comments_section.dart:3131 — _CommentSectionState._showUserInfoDialog has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 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 · _UserCommentsSheetContentState._privateRows (cognitive 19) · ×1
  • _UserCommentsSheetContentState._privateRows (cognitive 19) lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:808 — _UserCommentsSheetContentState._privateRows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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 · DownloadController._initialize (cognitive 19) · ×1
  • DownloadController._initialize (cognitive 19) lib/screens/downloads/controller/download_controller.dart:379 — DownloadController._initialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 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.
D2 · Cognitive Complexity · DownloadController._downloadSubtitles (cognitive 19) · ×1
  • DownloadController._downloadSubtitles (cognitive 19) lib/screens/downloads/controller/download_controller.dart:2898 — DownloadController._downloadSubtitles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (4 pts), boolean chains 2, 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 · _DownloadScreenState._checkPermissions (cognitive 19) · ×1
  • _DownloadScreenState._checkPermissions (cognitive 19) lib/screens/downloads/download_screen.dart:176 — _DownloadScreenState._checkPermissions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9 (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 · _DownloadServerSelectorState._buildBody (cognitive 19) · ×1
  • _DownloadServerSelectorState._buildBody (cognitive 19) lib/screens/downloads/widgets/download_server_selector.dart:277 — _DownloadServerSelectorState._buildBody has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, ternaries 8, 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 · _DownloadedMediaViewState._buildEpisodeTile (cognitive 19) · ×1
  • _DownloadedMediaViewState._buildEpisodeTile (cognitive 19) lib/screens/downloads/widgets/downloaded_media_view.dart:824 — _DownloadedMediaViewState._buildEpisodeTile has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 6, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _CompatibilityInputPageState._buildMatchupHero (cognitive 19) · ×1
  • _CompatibilityInputPageState._buildMatchupHero (cognitive 19) lib/screens/profile/compatibility/compatibility_input_page.dart:333 — _CompatibilityInputPageState._buildMatchupHero has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 17, 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 · _UserProfilePageState._buildActivitySlivers (cognitive 19) · ×1
  • _UserProfilePageState._buildActivitySlivers (cognitive 19) lib/screens/profile/user_profile_page.dart:679 — _UserProfilePageState._buildActivitySlivers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 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 · _ProfileStatsTabState.build (cognitive 19) · ×1
  • _ProfileStatsTabState.build (cognitive 19) lib/screens/profile/widgets/profile_stats_tab.dart:38 — _ProfileStatsTabState.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 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 · ExtensionFilterSheetState._buildSort (cognitive 19) · ×1
  • ExtensionFilterSheetState._buildSort (cognitive 19) lib/screens/search/widgets/extension_filter_sheet.dart:360 — ExtensionFilterSheetState._buildSort has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 2 (5 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 · _GroupFilterWidgetState._buildSubGroup (cognitive 19) · ×1
  • _GroupFilterWidgetState._buildSubGroup (cognitive 19) lib/screens/search/widgets/extension_filter_sheet.dart:692 — _GroupFilterWidgetState._buildSubGroup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), ternaries 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 · _SettingsAddonsState._buildTorrServerTile (cognitive 19) · ×1
  • _SettingsAddonsState._buildTorrServerTile (cognitive 19) lib/screens/settings/sub_settings/settings_addons.dart:198 — _SettingsAddonsState._buildTorrServerTile has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 4, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReportsQueuePageState._buildReportCard (cognitive 19) · ×1
  • _ReportsQueuePageState._buildReportCard (cognitive 19) lib/screens/settings/sub_settings/settings_moderation.dart:860 — _ReportsQueuePageState._buildReportCard has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 6 (8 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SettingsUiDetailsState.build (cognitive 19) · ×1
  • _SettingsUiDetailsState.build (cognitive 19) lib/screens/settings/sub_settings/settings_ui_details.dart:123 — _SettingsUiDetailsState.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 5 (6 pts), match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · _WatchiumPageState._handleDeepLinkRoom (cognitive 19) · ×1
  • _WatchiumPageState._handleDeepLinkRoom (cognitive 19) lib/screens/watchium/watchium_page.dart:76 — _WatchiumPageState._handleDeepLinkRoom has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 3, 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 · AniSkipApi.getSkipTimes (cognitive 19) · ×1
  • AniSkipApi.getSkipTimes (cognitive 19) lib/utils/aniskip.dart:8 — AniSkipApi.getSkipTimes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 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 · MediaDownloader._resolveBestVariant (cognitive 19) · ×1
  • MediaDownloader._resolveBestVariant (cognitive 19) lib/utils/media_downloader.dart:336 — MediaDownloader._resolveBestVariant has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 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 · AnymeXDecoratedAvatar.build (cognitive 19) · ×1
  • AnymeXDecoratedAvatar.build (cognitive 19) lib/widgets/anymex_widgets/anymex_decorated_avatar.dart:32 — AnymeXDecoratedAvatar.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10, if/else 5 (6 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 · BakedBlurImage.getCachedBytesOnly (cognitive 19) · ×1
  • BakedBlurImage.getCachedBytesOnly (cognitive 19) lib/widgets/common/baked_blur_image.dart:183 — BakedBlurImage.getCachedBytesOnly has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BakedBlurImage._getBytesForUrl) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · BakedBlurImage._getBytesForUrl (cognitive 19) · ×1
  • BakedBlurImage._getBytesForUrl (cognitive 19) lib/widgets/common/baked_blur_image.dart:209 — BakedBlurImage._getBytesForUrl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BakedBlurImage.getCachedBytesOnly) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LeaderboardEntry.fromMap (cognitive 18) · ×1
  • LeaderboardEntry.fromMap (cognitive 18) lib/database/comments/model/leaderboard_entry.dart:66 — LeaderboardEntry.fromMap has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 6 (7 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 · Database._migrateLegacyMacosDatabase (cognitive 18) · ×1
  • Database._migrateLegacyMacosDatabase (cognitive 18) lib/database/database.dart:184 — Database._migrateLegacyMacosDatabase has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 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 · _AIRecommendationState.fetchAiRecommendations (cognitive 18) · ×1
  • _AIRecommendationState.fetchAiRecommendations (cognitive 18) lib/screens/anime/misc/recommendation.dart:94 — _AIRecommendationState.fetchAiRecommendations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlayerController.fetchEpisode (cognitive 18) · ×1
  • PlayerController.fetchEpisode (cognitive 18) lib/screens/anime/watch/controller/player_controller.dart:1731 — PlayerController.fetchEpisode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThemeRenderer._makeLabelStackThing (cognitive 18) · ×1
  • ThemeRenderer._makeLabelStackThing (cognitive 18) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:608 — ThemeRenderer._makeLabelStackThing has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (6 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 · _AudioPopupContentState._buildInbuiltAudio (cognitive 18) · ×1
  • _AudioPopupContentState._buildInbuiltAudio (cognitive 18) lib/screens/anime/watch/controls/widgets/audio_popup.dart:164 — _AudioPopupContentState._buildInbuiltAudio has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DecoderQuickButton.build (cognitive 18) · ×1
  • DecoderQuickButton.build (cognitive 18) lib/screens/anime/watch/controls/widgets/decoder_quick_button.dart:49 — DecoderQuickButton.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (14 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 · DiscordMarkdown._parseImgTag (cognitive 18) · ×1
  • DiscordMarkdown._parseImgTag (cognitive 18) lib/screens/anime/widgets/comments/discord_markdown.dart:452 — DiscordMarkdown._parseImgTag has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _ListEditorModalState._setProgress (cognitive 18) · ×1
  • _ListEditorModalState._setProgress (cognitive 18) lib/screens/anime/widgets/list_editor.dart:317 — _ListEditorModalState._setProgress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _DownloadServerSelectorState._startDownload (cognitive 18) · ×1
  • _DownloadServerSelectorState._startDownload (cognitive 18) lib/screens/downloads/widgets/download_server_selector.dart:153 — _DownloadServerSelectorState._startDownload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4, error handling 1 (2 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 · _ExtensionListState._onReorder (cognitive 18) · ×1
  • _ExtensionListState._onReorder (cognitive 18) lib/screens/extensions/ExtensionList.dart:269 — _ExtensionListState._onReorder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 3, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NovelDetailsController._fetchChaptersOnly (cognitive 18) · ×1
  • NovelDetailsController._fetchChaptersOnly (cognitive 18) lib/screens/novel/details/controller/details_controller.dart:84 — NovelDetailsController._fetchChaptersOnly has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ProfileStatsTabState._overviewView (cognitive 18) · ×1
  • _ProfileStatsTabState._overviewView (cognitive 18) lib/screens/profile/widgets/profile_stats_tab.dart:175 — _ProfileStatsTabState._overviewView has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 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 · SocialTabState._fetchSocial (cognitive 18) · ×1
  • SocialTabState._fetchSocial (cognitive 18) lib/screens/profile/widgets/social_tab.dart:53 — SocialTabState._fetchSocial has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (8 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SettingsPlayerShadersState.build (cognitive 18) · ×1
  • _SettingsPlayerShadersState.build (cognitive 18) lib/screens/settings/sub_settings/player/settings_player_shaders.dart:205 — _SettingsPlayerShadersState.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserStatsController.streaks (cognitive 18) · ×1
  • UserStatsController.streaks (cognitive 18) lib/screens/stats/controller/user_stats_controller.dart:118 — UserStatsController.streaks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1, ternaries 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 · Deeplink._handleAnimatchDeepLink (cognitive 18) · ×1
  • Deeplink._handleAnimatchDeepLink (cognitive 18) lib/utils/deeplink.dart:605 — Deeplink._handleAnimatchDeepLink has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BakedBlurImage.loadCachedOnly (cognitive 18) · ×1
  • BakedBlurImage.loadCachedOnly (cognitive 18) lib/widgets/common/baked_blur_image.dart:237 — BakedBlurImage.loadCachedOnly has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 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 · _MediaPeekPopupState._buildContent (cognitive 18) · ×1
  • _MediaPeekPopupState._buildContent (cognitive 18) lib/widgets/media_items/media_peek_popup.dart:743 — _MediaPeekPopupState._buildContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReasonsSheetState._buildReasonCard (cognitive 18) · ×1
  • _ReasonsSheetState._buildReasonCard (cognitive 18) lib/widgets/non_widgets/reasons_sheet.dart:521 — _ReasonsSheetState._buildReasonCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 6, 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 · _SubsamplingScaleImageViewState._initImage (cognitive 18) · ×1
  • _SubsamplingScaleImageViewState._initImage (cognitive 18) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:907 — _SubsamplingScaleImageViewState._initImage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, 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 · _WatchiumPartyPopupContentState._buildMemberTrailing (cognitive 18) · ×1
  • _WatchiumPartyPopupContentState._buildMemberTrailing (cognitive 18) lib/widgets/watchium/watchium_party_popup.dart:904 — _WatchiumPartyPopupContentState._buildMemberTrailing has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 3 (6 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppNamePackageManager.run (cognitive 17) · ×1
  • AppNamePackageManager.run (cognitive 17) package_manager.dart:12 — AppNamePackageManager.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OfflineStorageController._attemptDatabaseRepair (cognitive 17) · ×1
  • OfflineStorageController._attemptDatabaseRepair (cognitive 17) lib/controllers/offline/offline_storage_controller.dart:136 — OfflineStorageController._attemptDatabaseRepair has cognitive complexity 17 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 2 (6 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OfflineStorageController._createOfflineMedia (cognitive 17) · ×1
  • OfflineStorageController._createOfflineMedia (cognitive 17) lib/controllers/offline/offline_storage_controller.dart:1141 — OfflineStorageController._createOfflineMedia has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 11, ternaries 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 · AnilistAuth.login (cognitive 17) · ×1
  • AnilistAuth.login (cognitive 17) lib/controllers/services/anilist/anilist_auth.dart:210 — AnilistAuth.login has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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 · StorageManagerService.clearTorrentCacheOnly (cognitive 17) · ×1
  • StorageManagerService.clearTorrentCacheOnly (cognitive 17) lib/controllers/services/storage/storage_manager_service.dart:99 — StorageManagerService.clearTorrentCacheOnly has cognitive complexity 17 (threshold 15). Drivers by points: error handling 2 (7 pts), if/else 2 (5 pts), loops 1 (3 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 · WatchiumService._waitForJoin (cognitive 17) · ×1
  • WatchiumService._waitForJoin (cognitive 17) lib/controllers/watchium/watchium_service.dart:614 — WatchiumService._waitForJoin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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 · WatchiumSyncController._setupJoinerListeners (cognitive 17) · ×1
  • WatchiumSyncController._setupJoinerListeners (cognitive 17) lib/controllers/watchium/watchium_sync_controller.dart:113 — WatchiumSyncController._setupJoinerListeners has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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 · TrackedMedia.effectiveTotal (cognitive 17) · ×1
  • TrackedMedia.effectiveTotal (cognitive 17) lib/models/Anilist/anilist_media_user.dart:121 — TrackedMedia.effectiveTotal has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (5 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 · IosLegacyPlayerControlTheme._buildBottomSection (cognitive 17) · ×1
  • IosLegacyPlayerControlTheme._buildBottomSection (cognitive 17) lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:385 — IosLegacyPlayerControlTheme._buildBottomSection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 5, boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · MarkdownFormattingToolbar._insertNumberedList (cognitive 17) · ×1
  • MarkdownFormattingToolbar._insertNumberedList (cognitive 17) lib/screens/anime/widgets/comments/discord_markdown.dart:1064 — MarkdownFormattingToolbar._insertNumberedList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (4 pts), loops 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 · _DownloadedMediaViewState._buildChapterTile (cognitive 17) · ×1
  • _DownloadedMediaViewState._buildChapterTile (cognitive 17) lib/screens/downloads/widgets/downloaded_media_view.dart:1111 — _DownloadedMediaViewState._buildChapterTile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 4, boolean chains 3, 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 · _ExtensionListState.build (cognitive 17) · ×1
  • _ExtensionListState.build (cognitive 17) lib/screens/extensions/ExtensionList.dart:305 — _ExtensionListState.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 7, 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 · _SourcePreferenceScreenState._clearCookiesForSource (cognitive 17) · ×1
  • _SourcePreferenceScreenState._clearCookiesForSource (cognitive 17) lib/screens/extensions/ExtensionSettings/ExtensionSettings.dart:127 — _SourcePreferenceScreenState._clearCookiesForSource has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 3 (6 pts), loops 1 (3 pts), boolean chains 1, ternaries 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 · _AnilistMangaListState.initState (cognitive 17) · ×1
  • _AnilistMangaListState.initState (cognitive 17) lib/screens/library/online/manga_list.dart:102 — _AnilistMangaListState.initState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 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 · LocalSourceController.loadCurrentDirectory (cognitive 17) · ×1
  • LocalSourceController.loadCurrentDirectory (cognitive 17) lib/screens/local_source/controller/local_source_controller.dart:351 — LocalSourceController.loadCurrentDirectory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 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. This shape REPEATS in the file: one other method here (LocalSourceController.loadDownloadDirectory) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LocalSourceController.loadDownloadDirectory (cognitive 17) · ×1
  • LocalSourceController.loadDownloadDirectory (cognitive 17) lib/screens/local_source/controller/local_source_controller.dart:384 — LocalSourceController.loadDownloadDirectory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 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. This shape REPEATS in the file: one other method here (LocalSourceController.loadCurrentDirectory) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · NovelReaderController.handleSwipe (cognitive 17) · ×1
  • NovelReaderController.handleSwipe (cognitive 17) lib/screens/novel/reader/controller/reader_controller.dart:822 — NovelReaderController.handleSwipe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6 (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 · _CompatibilityResultPageState._buildShareUrl (cognitive 17) · ×1
  • _CompatibilityResultPageState._buildShareUrl (cognitive 17) lib/screens/profile/compatibility/compatibility_result_page.dart:2728 — _CompatibilityResultPageState._buildShareUrl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (4 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SettingsAccountsState._autoSyncLinkedAccounts (cognitive 17) · ×1
  • _SettingsAccountsState._autoSyncLinkedAccounts (cognitive 17) lib/screens/settings/sub_settings/settings_accounts.dart:36 — _SettingsAccountsState._autoSyncLinkedAccounts has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, error handling 3 (6 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 · _SettingsDiscordState._buildAccountCard (cognitive 17) · ×1
  • _SettingsDiscordState._buildAccountCard (cognitive 17) lib/screens/settings/sub_settings/settings_discord.dart:249 — _SettingsDiscordState._buildAccountCard has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11, boolean chains 4, 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 · _ExportBackupSheetState.build (cognitive 17) · ×1
  • _ExportBackupSheetState.build (cognitive 17) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1047 — _ExportBackupSheetState.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 1, if/else 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _WatchiumPageState._showPasswordDialog (cognitive 17) · ×1
  • _WatchiumPageState._showPasswordDialog (cognitive 17) lib/screens/watchium/watchium_page.dart:237 — _WatchiumPageState._showPasswordDialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 7 (8 pts), 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 · AdSupportService.didChangeAppLifecycleState (cognitive 17) · ×1
  • AdSupportService.didChangeAppLifecycleState (cognitive 17) lib/services/ad_support_service.dart:41 — AdSupportService.didChangeAppLifecycleState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 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 · CommentumService.manageUser (cognitive 17) · ×1
  • CommentumService.manageUser (cognitive 17) lib/services/commentum_service.dart:952 — CommentumService.manageUser has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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 · CommentumService.fetchUserCustomizations (cognitive 17) · ×1
  • CommentumService.fetchUserCustomizations (cognitive 17) lib/services/commentum_service.dart:1417 — CommentumService.fetchUserCustomizations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), 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 · AnimeThemesAPI.searchAnimeThemes (cognitive 17) · ×1
  • AnimeThemesAPI.searchAnimeThemes (cognitive 17) lib/utils/anime_themes_api.dart:11 — AnimeThemesAPI.searchAnimeThemes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (AnimeThemesAPI.getAnimeData) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AnimeThemesAPI.getAnimeData (cognitive 17) · ×1
  • AnimeThemesAPI.getAnimeData (cognitive 17) lib/utils/anime_themes_api.dart:104 — AnimeThemesAPI.getAnimeData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (AnimeThemesAPI.searchAnimeThemes) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Deeplink._handleWatchiumDeepLink (cognitive 17) · ×1
  • Deeplink._handleWatchiumDeepLink (cognitive 17) lib/utils/deeplink.dart:495 — Deeplink._handleWatchiumDeepLink has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, loops 2, 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 · ExternalFontLoader.getCustomFontNames (cognitive 17) · ×1
  • ExternalFontLoader.getCustomFontNames (cognitive 17) lib/utils/external_font_loader.dart:255 — ExternalFontLoader.getCustomFontNames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (12 pts), boolean chains 2, 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 · _VisualsPopupState._fetchMalVisuals (cognitive 17) · ×1
  • _VisualsPopupState._fetchMalVisuals (cognitive 17) lib/widgets/anime/visuals/visuals_popup.dart:66 — _VisualsPopupState._fetchMalVisuals has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, 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 · AnymeXDialog.build (cognitive 17) · ×1
  • AnymeXDialog.build (cognitive 17) lib/widgets/anymex_widgets/anymex_dialog.dart:75 — AnymeXDialog.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 13, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SourceSelectorWidget.build (cognitive 17) · ×1
  • SourceSelectorWidget.build (cognitive 17) lib/widgets/common/source_selector.dart:105 — SourceSelectorWidget.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · UnifiedSourceSection.build (cognitive 17) · ×1
  • UnifiedSourceSection.build (cognitive 17) lib/widgets/common/unified_source_section.dart:44 — UnifiedSourceSection.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AnymexOnTap.build (cognitive 17) · ×1
  • AnymexOnTap.build (cognitive 17) lib/widgets/helper/tv_wrapper.dart:41 — AnymexOnTap.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (7 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 · OfflineStorageController.addOrUpdateWatchedEpisode (cognitive 16) · ×1
  • OfflineStorageController.addOrUpdateWatchedEpisode (cognitive 16) lib/controllers/offline/offline_storage_controller.dart:818 — OfflineStorageController.addOrUpdateWatchedEpisode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7 (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 · AnilistAuth.getNotifications (cognitive 16) · ×1
  • AnilistAuth.getNotifications (cognitive 16) lib/controllers/services/anilist/anilist_auth.dart:2752 — AnilistAuth.getNotifications has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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 · CommunityService._buildUserIdentityBody (cognitive 16) · ×1
  • CommunityService._buildUserIdentityBody (cognitive 16) lib/controllers/services/community_service.dart:1136 — CommunityService._buildUserIdentityBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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 · SimklService.homeWidgets (cognitive 16) · ×1
  • SimklService.homeWidgets (cognitive 16) lib/controllers/services/simkl/simkl_service.dart:299 — SimklService.homeWidgets has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 3 (4 pts), boolean chains 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 · SourceController.isExtensionNewerVersion (cognitive 16) · ×1
  • SourceController.isExtensionNewerVersion (cognitive 16) lib/controllers/source/source_controller.dart:579 — SourceController.isExtensionNewerVersion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (5 pts), boolean chains 3, 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 · GistSyncController.syncEpisodeProgressOnExit (cognitive 16) · ×1
  • GistSyncController.syncEpisodeProgressOnExit (cognitive 16) lib/controllers/sync/gist_sync_controller.dart:551 — GistSyncController.syncEpisodeProgressOnExit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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. This shape REPEATS in the file: one other method here (GistSyncController.syncChapterProgressOnExit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · GistSyncController.syncChapterProgressOnExit (cognitive 16) · ×1
  • GistSyncController.syncChapterProgressOnExit (cognitive 16) lib/controllers/sync/gist_sync_controller.dart:642 — GistSyncController.syncChapterProgressOnExit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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. This shape REPEATS in the file: one other method here (GistSyncController.syncEpisodeProgressOnExit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · WatchiumService._handleMemberChanges (cognitive 16) · ×1
  • WatchiumService._handleMemberChanges (cognitive 16) lib/controllers/watchium/watchium_service.dart:430 — WatchiumService._handleMemberChanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 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 · WatchiumService.joinRoom (cognitive 16) · ×1
  • WatchiumService.joinRoom (cognitive 16) lib/controllers/watchium/watchium_service.dart:563 — WatchiumService.joinRoom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 1, 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 · Media.fromRecs (cognitive 16) · ×1
  • Media.fromRecs (cognitive 16) lib/models/Media/media.dart:1486 — Media.fromRecs has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9, boolean chains 6, 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 · MediaDetailsController._renewEpisodeData (cognitive 16) · ×1
  • MediaDetailsController._renewEpisodeData (cognitive 16) lib/screens/anime/details/controller/media_details_controller.dart:819 — MediaDetailsController._renewEpisodeData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MediaDetailsPageState._resolveDynamicColor (cognitive 16) · ×1
  • _MediaDetailsPageState._resolveDynamicColor (cognitive 16) lib/screens/anime/details/media_details_page.dart:118 — _MediaDetailsPageState._resolveDynamicColor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _CalendarState._isSameDate (cognitive 16) · ×1
  • _CalendarState._isSameDate (cognitive 16) lib/screens/anime/misc/calendar.dart:150 — _CalendarState._isSameDate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, 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 · PlayerController._loadVisualSettings (cognitive 16) · ×1
  • PlayerController._loadVisualSettings (cognitive 16) lib/screens/anime/watch/controller/player_controller.dart:742 — PlayerController._loadVisualSettings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 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 · PlayerController._openWithCloudFallback (cognitive 16) · ×1
  • PlayerController._openWithCloudFallback (cognitive 16) lib/screens/anime/watch/controller/player_controller.dart:1114 — PlayerController._openWithCloudFallback has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, error handling 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 · PlayerController._initializeAniSkip (cognitive 16) · ×1
  • PlayerController._initializeAniSkip (cognitive 16) lib/screens/anime/watch/controller/player_controller.dart:1181 — PlayerController._initializeAniSkip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, 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 · PlayerController._initializePersistentListeners (cognitive 16) · ×1
  • PlayerController._initializePersistentListeners (cognitive 16) lib/screens/anime/watch/controller/player_controller.dart:1251 — PlayerController._initializePersistentListeners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7 (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 · ThemeRenderer.buildBottomShit (cognitive 16) · ×1
  • ThemeRenderer.buildBottomShit (cognitive 16) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:220 — ThemeRenderer.buildBottomShit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ThemeRenderer._checkCondition (cognitive 16) · ×1
  • ThemeRenderer._checkCondition (cognitive 16) lib/screens/anime/watch/controls/themes/setup/json_player_control_theme.dart:1096 — ThemeRenderer._checkCondition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WatchTogetherPopupContentState._createRoom (cognitive 16) · ×1
  • _WatchTogetherPopupContentState._createRoom (cognitive 16) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:608 — _WatchTogetherPopupContentState._createRoom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, 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 · MediaKitPlayer.setSubtitleTrack (cognitive 16) · ×1
  • MediaKitPlayer.setSubtitleTrack (cognitive 16) lib/screens/anime/watch/player/media_kit_player.dart:328 — MediaKitPlayer.setSubtitleTrack has cognitive complexity 16 (threshold 15). Drivers by points: error handling 2 (7 pts), if/else 5 (6 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 · DownloadController.fetchServersForEpisode (cognitive 16) · ×1
  • DownloadController.fetchServersForEpisode (cognitive 16) lib/screens/downloads/controller/download_controller.dart:767 — DownloadController.fetchServersForEpisode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (4 pts), boolean chains 2, ternaries 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 · DownloadController.updateDownloadedMediaMetadata (cognitive 16) · ×1
  • DownloadController.updateDownloadedMediaMetadata (cognitive 16) lib/screens/downloads/controller/download_controller.dart:1828 — DownloadController.updateDownloadedMediaMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginManager.syncLocalApk (cognitive 16) · ×1
  • PluginManager.syncLocalApk (cognitive 16) lib/screens/extensions/widgets/plugin_manager.dart:233 — PluginManager.syncLocalApk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 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 · _HomePageState.build (cognitive 16) · ×1
  • _HomePageState.build (cognitive 16) lib/screens/home_page.dart:206 — _HomePageState.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _MangaStatsState.build (cognitive 16) · ×1
  • _MangaStatsState.build (cognitive 16) lib/screens/manga/widgets/manga_stats.dart:69 — _MangaStatsState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 5, ternaries 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 · NotificationController.loadMoreAnilistNotifications (cognitive 16) · ×1
  • NotificationController.loadMoreAnilistNotifications (cognitive 16) lib/screens/notifications/notification_controller.dart:179 — NotificationController.loadMoreAnilistNotifications has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 1 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NovelBottomControls._buildScrollProgress (cognitive 16) · ×1
  • NovelBottomControls._buildScrollProgress (cognitive 16) lib/screens/novel/reader/widgets/bottom_controls.dart:151 — NovelBottomControls._buildScrollProgress has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 3 (4 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 · _CompatibilityInputPageState._loadFollowing (cognitive 16) · ×1
  • _CompatibilityInputPageState._loadFollowing (cognitive 16) lib/screens/profile/compatibility/compatibility_input_page.dart:90 — _CompatibilityInputPageState._loadFollowing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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 · _ContributorsPageState._buildFeaturedCard (cognitive 16) · ×1
  • _ContributorsPageState._buildFeaturedCard (cognitive 16) lib/screens/settings/sub_settings/contributors/contributors.dart:481 — _ContributorsPageState._buildFeaturedCard has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SettingsExtensionManagerState._buildExtensionSettings (cognitive 16) · ×1
  • _SettingsExtensionManagerState._buildExtensionSettings (cognitive 16) lib/screens/settings/sub_settings/settings_extension_manager.dart:707 — _SettingsExtensionManagerState._buildExtensionSettings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SettingsUiDetailsState.initState (cognitive 16) · ×1
  • _SettingsUiDetailsState.initState (cognitive 16) lib/screens/settings/sub_settings/settings_ui_details.dart:49 — _SettingsUiDetailsState.initState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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 · CommentumService.listUsers (cognitive 16) · ×1
  • CommentumService.listUsers (cognitive 16) lib/services/commentum_service.dart:743 — CommentumService.listUsers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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 · Matchmaker._computeEntityStatOverlap (cognitive 16) · ×1
  • Matchmaker._computeEntityStatOverlap (cognitive 16) lib/utils/compatibility/matchmaker.dart:933 — Matchmaker._computeEntityStatOverlap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 4, ternaries 2 (3 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Liquid._gpuBlurImageCustom (cognitive 16) · ×1
  • Liquid._gpuBlurImageCustom (cognitive 16) lib/utils/liquid.dart:257 — Liquid._gpuBlurImageCustom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaDownloader._downloadM3u8WithProgress (cognitive 16) · ×1
  • MediaDownloader._downloadM3u8WithProgress (cognitive 16) lib/utils/media_downloader.dart:183 — MediaDownloader._downloadM3u8WithProgress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (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.
D2 · Cognitive Complexity · MediaShare._buildTrackingShareLink (cognitive 16) · ×1
  • MediaShare._buildTrackingShareLink (cognitive 16) lib/utils/media_share.dart:122 — MediaShare._buildTrackingShareLink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MediaShare._buildAnymexShareLink) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MediaShare._buildAnymexShareLink (cognitive 16) · ×1
  • MediaShare._buildAnymexShareLink (cognitive 16) lib/utils/media_share.dart:157 — MediaShare._buildAnymexShareLink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MediaShare._buildTrackingShareLink) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LinkedAccountsBadges.build (cognitive 16) · ×1
  • LinkedAccountsBadges.build (cognitive 16) lib/widgets/anymex_widgets/linked_accounts_badges.dart:20 — LinkedAccountsBadges.build has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _BigCarouselPortraitState.build (cognitive 16) · ×1
  • _BigCarouselPortraitState.build (cognitive 16) lib/widgets/common/carousel/themes/big_carousel_portrait.dart:58 — _BigCarouselPortraitState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, 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 · _MediaPeekPopupState._buildRecommendedBySection (cognitive 16) · ×1
  • _MediaPeekPopupState._buildRecommendedBySection (cognitive 16) lib/widgets/media_items/media_peek_popup.dart:973 — _MediaPeekPopupState._buildRecommendedBySection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 4 (6 pts), boolean chains 4 (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 · _SubsamplingScaleImageViewState._findCachedFile (cognitive 16) · ×1
  • _SubsamplingScaleImageViewState._findCachedFile (cognitive 16) lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:583 — _SubsamplingScaleImageViewState._findCachedFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), error handling 3 (5 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WatchiumCreateSheetState._createRoom (cognitive 16) · ×1
  • _WatchiumCreateSheetState._createRoom (cognitive 16) lib/widgets/watchium/watchium_create_dialog.dart:529 — _WatchiumCreateSheetState._createRoom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: anilist_data.dart, mal_service.dart, simkl_service.dart lib/controllers/services/anilist/anilist_data.dart — 3 files — `lib/controllers/services/anilist/anilist_data.dart`, `lib/controllers/services/mal/mal_service.dart`, `lib/controllers/services/simkl/simkl_service.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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 47 shared lines) · ×1
  • Near-duplicate member family (4 members, 47 shared lines) lib/screens/profile/widgets/profile_header.dart:72 — lib/screens/profile/widgets/profile_header.dart:72-564 | lib/screens/profile/widgets/profile_header.dart:583-1051 | lib/screens/profile/widgets/user_profile_app_bar.dart:60-576 | lib/screens/profile/widgets/user_profile_header.dart:62-665 — These 4 members are variants of one another: a block of 47 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 · Near-duplicate member family (4 members, 38 shared lines) · ×1
  • Near-duplicate member family (4 members, 38 shared lines) lib/utils/color_profiler.dart:588 — lib/utils/color_profiler.dart:588-764 | lib/utils/color_profiler.dart:783-1021 | lib/utils/color_profiler.dart:1023-1184 | lib/utils/color_profiler.dart:1302-1375 — These 4 members are variants of one another: a block of 38 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 · Near-duplicate member family (3 members, 38 shared lines) · ×1
  • Near-duplicate member family (3 members, 38 shared lines) lib/screens/anime/watch/controls/top_controls.dart:104 — lib/screens/anime/watch/controls/top_controls.dart:104-222 | lib/screens/anime/watch/controls/top_controls.dart:246-418 | lib/screens/anime/watch/controls/top_controls.dart:420-557 — These 3 members are variants of one another: a block of 38 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 21 shared lines) · ×1
  • Near-duplicate member family (3 members, 21 shared lines) lib/screens/settings/sub_settings/player/settings_player_controls.dart:278 — lib/screens/settings/sub_settings/player/settings_player_controls.dart:278-428 | lib/screens/settings/sub_settings/player/settings_player_controls.dart:430-549 | lib/screens/settings/sub_settings/settings_reader.dart:426-583 — These 3 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (182 shared lines) · ×1
  • Near-duplicate member pair (182 shared lines) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:145 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:145-382 | lib/screens/settings/sub_settings/settings_reader.dart:867-1120 — These two members are variants of one another: 182 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (148 shared lines) · ×1
  • Near-duplicate member pair (148 shared lines) lib/screens/anime/widgets/episode_list_builder.dart:1155 — lib/screens/anime/widgets/episode_list_builder.dart:1155-1364 | lib/screens/manga/widgets/chapter_list_builder.dart:1217-1474 — These two members are variants of one another: 148 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (141 shared lines) · ×1
  • Near-duplicate member pair (141 shared lines) lib/screens/settings/sub_settings/settings_network.dart:308 — lib/screens/settings/sub_settings/settings_network.dart:308-554 | lib/screens/settings/sub_settings/settings_network.dart:556-882 — These two members are variants of one another: 141 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (137 shared lines) · ×1
  • Near-duplicate member pair (137 shared lines) lib/screens/profile/profile_page.dart:739 — lib/screens/profile/profile_page.dart:739-922 | lib/screens/profile/user_profile_page.dart:679-884 — These two members are variants of one another: 137 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (133 shared lines) · ×1
  • Near-duplicate member pair (133 shared lines) lib/widgets/dialogs/logo_animation_preview_dialog.dart:96 — lib/widgets/dialogs/logo_animation_preview_dialog.dart:96-414 | lib/widgets/dialogs/logo_animation_preview_dialog.dart:416-639 — These two members are variants of one another: 133 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (130 shared lines) · ×1
  • Near-duplicate member pair (130 shared lines) lib/screens/anime/widgets/comments/comments_section.dart:1385 — lib/screens/anime/widgets/comments/comments_section.dart:1385-1591 | lib/screens/anime/widgets/comments/comments_section.dart:1745-2003 — These two members are variants of one another: 130 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (129 shared lines) · ×1
  • Near-duplicate member pair (129 shared lines) lib/screens/profile/profile_page.dart:946 — lib/screens/profile/profile_page.dart:946-1224 | lib/screens/profile/user_profile_page.dart:908-1143 — These two members are variants of one another: 129 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (121 shared lines) · ×1
  • Near-duplicate member pair (121 shared lines) lib/screens/profile/widgets/activity_heatmap.dart:52 — lib/screens/profile/widgets/activity_heatmap.dart:52-287 | lib/screens/stats/user_stats_page.dart:550-818 — These two members are variants of one another: 121 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (103 shared lines) · ×1
  • Near-duplicate member pair (103 shared lines) lib/controllers/services/anilist/anilist_auth.dart:2031 — lib/controllers/services/anilist/anilist_auth.dart:2031-2155 | lib/controllers/services/anilist/anilist_auth.dart:2431-2542 — These two members are variants of one another: 103 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (72 shared lines) · ×1
  • Near-duplicate member pair (72 shared lines) lib/screens/anime/widgets/voice_actor.dart:19 — lib/screens/anime/widgets/voice_actor.dart:19-281 | lib/screens/anime/widgets/voice_actor.dart:288-414 — These two members are variants of one another: 72 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (56 shared lines) · ×1
  • Near-duplicate member pair (56 shared lines) lib/screens/anime/misc/calendar.dart:953 — lib/screens/anime/misc/calendar.dart:953-1066 | lib/widgets/media_items/media_item.dart:254-364 — These two members are variants of one another: 56 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (52 shared lines) · ×1
  • Near-duplicate member pair (52 shared lines) lib/widgets/common/navbar/styles/classic_navbar.dart:305 — lib/widgets/common/navbar/styles/classic_navbar.dart:305-380 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:361-430 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (47 shared lines) · ×1
  • Near-duplicate member pair (47 shared lines) lib/screens/library/online/manga_list.dart:325 — lib/screens/library/online/manga_list.dart:325-415 | lib/screens/profile/widgets/user_media_list_page.dart:293-387 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (42 shared lines) · ×1
  • Near-duplicate member pair (42 shared lines) lib/screens/anime/widgets/anime_stats.dart:757 — lib/screens/anime/widgets/anime_stats.dart:757-887 | lib/screens/manga/widgets/manga_stats.dart:456-550 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (39 shared lines) · ×1
  • Near-duplicate member pair (39 shared lines) lib/utils/compatibility/matchmaker.dart:119 — lib/utils/compatibility/matchmaker.dart:119-303 | lib/utils/compatibility/matchmaker.dart:305-440 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (108 corresponding lines) · ×1
  • Edited copy of a member (108 corresponding lines) lib/screens/library/online/anime_list.dart:433 — lib/screens/library/online/anime_list.dart:433-540 | lib/screens/library/online/manga_list.dart:417-524 — These two members are one piece of code written twice and then edited apart: 108 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (13 members, 50+ identical tokens) lib/controllers/services/anilist/anilist_auth.dart:1521 — lib/controllers/services/anilist/anilist_auth.dart:1521-1555 | lib/controllers/services/anilist/anilist_auth.dart:1557-1588 | lib/controllers/services/anilist/anilist_auth.dart:1590-1621 | lib/controllers/services/anilist/anilist_auth.dart:1623-1654 | lib/controllers/services/anilist/anilist_auth.dart:1656-1687 | lib/controllers/services/anilist/anilist_auth.dart:1751-1786 | lib/controllers/services/anilist/anilist_auth.dart:1788-1829 | lib/controllers/services/anilist/anilist_auth.dart:1831-1862 | lib/controllers/services/anilist/anilist_auth.dart:1864-1911 | lib/controllers/services/anilist/anilist_auth.dart:1913-1944 | lib/controllers/services/anilist/anilist_auth.dart:1946-2000 | lib/controllers/services/anilist/anilist_auth.dart:2544-2599 | lib/controllers/services/anilist/anilist_auth.dart:2601-2656 — These 13 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 13 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 13 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:506 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:506-567 | lib/screens/settings/sub_settings/settings_moderation.dart:303-757 | lib/screens/watchium/watchium_page.dart:237-470 | lib/widgets/non_widgets/reasons_sheet.dart:202-317 | lib/widgets/non_widgets/recommend_sheet.dart:353-462 | lib/widgets/non_widgets/recommend_sheet.dart:558-668 | lib/widgets/non_widgets/recommend_sheet.dart:1060-1134 | lib/widgets/non_widgets/recommend_sheet.dart:1136-1212 | lib/widgets/watchium/watchium_create_dialog.dart:430-493 | lib/widgets/watchium/watchium_party_popup.dart:669-754 — These 10 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 10 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 10 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) lib/screens/anime/home_page.dart:128 — lib/screens/anime/home_page.dart:128-259 | lib/screens/extensions/ExtensionScreen.dart:84-230 | lib/screens/home_page.dart:206-369 | lib/screens/library/history_page.dart:95-239 | lib/screens/library/my_library.dart:80-172 | lib/screens/manga/home_page.dart:48-149 | lib/screens/novel/home_page.dart:40-111 | lib/screens/stats/user_stats_page.dart:99-250 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Edited copy of a member (102 corresponding lines) · ×1
  • Edited copy of a member (102 corresponding lines) lib/screens/library/online/anime_list.dart:772 — lib/screens/library/online/anime_list.dart:772-873 | lib/screens/library/online/manga_list.dart:757-858 — These two members are one piece of code written twice and then edited apart: 102 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 121+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 121+ corresponding lines) lib/screens/profile/widgets/decoration_closet_sheet.dart:619 — lib/screens/profile/widgets/decoration_closet_sheet.dart:619-739 | lib/screens/profile/widgets/decoration_closet_sheet.dart:742-870 | lib/screens/profile/widgets/decoration_closet_sheet.dart:1082-1203 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 121 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (115 corresponding lines) · ×1
  • Edited copy of a member (115 corresponding lines) lib/screens/profile/profile_page.dart:575 — lib/screens/profile/profile_page.dart:575-691 | lib/screens/profile/user_profile_page.dart:1210-1324 — These two members are one piece of code written twice and then edited apart: 115 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (106 corresponding lines) · ×1
  • Edited copy of a member (106 corresponding lines) lib/screens/anime/widgets/episode/styles/minimal_style.dart:30 — lib/screens/anime/widgets/episode/styles/minimal_style.dart:30-137 | lib/screens/manga/widgets/chapter_list_builder.dart:839-944 — These two members are one piece of code written twice and then edited apart: 106 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (105 corresponding lines) · ×1
  • Edited copy of a member (105 corresponding lines) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:206 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:206-310 | lib/widgets/common/anymex_slider_m3.dart:211-339 — These two members are one piece of code written twice and then edited apart: 105 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (93 corresponding lines) · ×1
  • Edited copy of a member (93 corresponding lines) lib/screens/library/widgets/anime_card.dart:21 — lib/screens/library/widgets/anime_card.dart:21-132 | lib/screens/library/widgets/common_widgets.dart:28-120 — These two members are one piece of code written twice and then edited apart: 93 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (90 corresponding lines) · ×1
  • Edited copy of a member (90 corresponding lines) lib/controllers/sync/gist_sync_controller.dart:551 — lib/controllers/sync/gist_sync_controller.dart:551-640 | lib/controllers/sync/gist_sync_controller.dart:642-737 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) lib/screens/notifications/notification_screen.dart:408 — lib/screens/notifications/notification_screen.dart:408-483 | lib/screens/notifications/notification_screen.dart:580-678 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (91 corresponding lines) · ×1
  • Edited copy of a member (91 corresponding lines) lib/screens/manga/widgets/reader/auto_scroll_menu.dart:18 — lib/screens/manga/widgets/reader/auto_scroll_menu.dart:18-112 | lib/screens/novel/reader/novel_reader.dart:94-184 — These two members are one piece of code written twice and then edited apart: 91 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (92 corresponding lines) · ×1
  • Edited copy of a member (92 corresponding lines) lib/screens/downloads/widgets/downloaded_watch_page.dart:139 — lib/screens/downloads/widgets/downloaded_watch_page.dart:139-230 | lib/screens/local_source/player/offline_player.dart:110-210 — These two members are one piece of code written twice and then edited apart: 92 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (69 corresponding lines) · ×1
  • Edited copy of a member (69 corresponding lines) lib/controllers/offline/offline_storage_controller.dart:818 — lib/controllers/offline/offline_storage_controller.dart:818-886 | lib/controllers/offline/offline_storage_controller.dart:902-977 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) lib/widgets/common/navbar/styles/classic_navbar.dart:126 — lib/widgets/common/navbar/styles/classic_navbar.dart:126-195 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:99-185 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (83 corresponding lines) · ×1
  • Edited copy of a member (83 corresponding lines) lib/screens/anime/widgets/episode/styles/compact_style.dart:62 — lib/screens/anime/widgets/episode/styles/compact_style.dart:62-144 | lib/screens/anime/widgets/episode/styles/detailed_style.dart:62-144 — These two members are one piece of code written twice and then edited apart: 83 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (80 corresponding lines) · ×1
  • Edited copy of a member (80 corresponding lines) lib/screens/profile/activity_details_page.dart:608 — lib/screens/profile/activity_details_page.dart:608-687 | lib/widgets/non_widgets/activity_card.dart:357-445 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) lib/utils/download_isolate_pool.dart:89 — lib/utils/download_isolate_pool.dart:89-144 | lib/utils/download_isolate_pool.dart:146-211 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) lib/screens/anime/widgets/episode_section.dart:270 — lib/screens/anime/widgets/episode_section.dart:270-328 | lib/screens/manga/widgets/chapter_section.dart:270-331 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) lib/utils/anime_themes_api.dart:11 — lib/utils/anime_themes_api.dart:11-67 | lib/utils/anime_themes_api.dart:104-163 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (65 corresponding lines) · ×1
  • Edited copy of a member (65 corresponding lines) lib/widgets/anymex_widgets/anymex_tile.dart:351 — lib/widgets/anymex_widgets/anymex_tile.dart:351-422 | lib/widgets/anymex_widgets/anymex_tile.dart:424-488 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) lib/screens/anime/widgets/episode_section.dart:162 — lib/screens/anime/widgets/episode_section.dart:162-216 | lib/screens/manga/widgets/chapter_section.dart:115-171 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) lib/controllers/services/anilist/anilist_auth.dart:1386 — lib/controllers/services/anilist/anilist_auth.dart:1386-1519 | lib/controllers/services/anilist/anilist_auth.dart:1689-1749 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 46+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 46+ corresponding lines) lib/widgets/non_widgets/reasons_sheet.dart:319 — lib/widgets/non_widgets/reasons_sheet.dart:319-366 | lib/widgets/non_widgets/recommend_sheet.dart:464-509 | lib/widgets/non_widgets/recommend_sheet.dart:511-556 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 46 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) lib/services/commentum_service.dart:334 — lib/services/commentum_service.dart:334-386 | lib/services/commentum_service.dart:456-507 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:751 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:751-803 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:663-715 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 44+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 44+ corresponding lines) lib/services/commentum_service.dart:649 — lib/services/commentum_service.dart:649-694 | lib/services/commentum_service.dart:696-741 | lib/services/commentum_service.dart:907-950 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) lib/widgets/common/media_mode_selector.dart:495 — lib/widgets/common/media_mode_selector.dart:495-548 | lib/widgets/common/media_mode_selector.dart:619-673 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:645 — lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:645-692 | lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:697-749 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) lib/screens/novel/reader/widgets/settings_view.dart:564 — lib/screens/novel/reader/widgets/settings_view.dart:564-609 | lib/screens/novel/reader/widgets/settings_view.dart:769-818 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 38+ corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart:1925 — lib/screens/anime/widgets/episode_list_builder.dart:1925-1970 | lib/screens/downloads/widgets/download_server_selector.dart:237-275 | lib/widgets/watchium/watchium_create_dialog.dart:81-119 | lib/widgets/watchium/watchium_server_sheet.dart:71-108 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 30+ corresponding lines) lib/controllers/services/community_service.dart:612 — lib/controllers/services/community_service.dart:612-648 | lib/controllers/services/community_service.dart:650-681 | lib/controllers/services/community_service.dart:683-712 | lib/controllers/services/community_service.dart:714-743 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) lib/screens/settings/misc/sauce_finder_view.dart:224 — lib/screens/settings/misc/sauce_finder_view.dart:224-278 | lib/screens/settings/misc/sauce_finder_view.dart:573-617 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) lib/screens/anime/misc/calendar.dart:249 — lib/screens/anime/misc/calendar.dart:249-270 | lib/screens/library/online/anime_list.dart:542-563 | lib/screens/library/online/manga_list.dart:526-547 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) lib/screens/profile/profile_page.dart:693 — lib/screens/profile/profile_page.dart:693-737 | lib/screens/profile/user_profile_page.dart:638-677 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 27+ corresponding lines) lib/controllers/services/community_service.dart:457 — lib/controllers/services/community_service.dart:457-483 | lib/controllers/services/community_service.dart:485-511 | lib/controllers/services/community_service.dart:513-539 | lib/controllers/services/community_service.dart:541-567 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 45+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 45+ corresponding lines) lib/controllers/services/anilist/anilist_auth.dart:600 — lib/controllers/services/anilist/anilist_auth.dart:600-663 | lib/controllers/services/anilist/anilist_auth.dart:665-709 | lib/controllers/services/anilist/anilist_auth.dart:711-827 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) lib/screens/community/community_recommendations_page.dart:92 — lib/screens/community/community_recommendations_page.dart:92-125 | lib/widgets/media_items/media_peek_popup.dart:169-201 | lib/widgets/non_widgets/reasons_sheet.dart:124-151 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 31+ corresponding lines) lib/services/commentum_service.dart:830 — lib/services/commentum_service.dart:830-860 | lib/services/commentum_service.dart:1585-1621 | lib/services/commentum_service.dart:1623-1653 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) lib/controllers/services/mal/mal_service.dart:636 — lib/controllers/services/mal/mal_service.dart:636-668 | lib/controllers/services/mal/mal_service.dart:837-867 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) lib/screens/search/search_view.dart:1582 — lib/screens/search/search_view.dart:1582-1611 | lib/screens/settings/sub_settings/player/settings_player_controls.dart:832-865 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:513-543 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) lib/widgets/anymex_widgets/anymex_tile.dart:234 — lib/widgets/anymex_widgets/anymex_tile.dart:234-268 | lib/widgets/anymex_widgets/anymex_tile.dart:490-529 | lib/widgets/anymex_widgets/anymex_tile.dart:531-566 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 26+ corresponding lines) lib/screens/anime/widgets/episode_list_builder.dart:1407 — lib/screens/anime/widgets/episode_list_builder.dart:1407-1439 | lib/screens/manga/widgets/chapter_list_builder.dart:1522-1553 | lib/widgets/watchium/watchium_party_popup.dart:1050-1075 | lib/widgets/watchium/watchium_party_popup.dart:1077-1102 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) lib/services/cast/cast_service.dart:573 — lib/services/cast/cast_service.dart:573-592 | lib/services/cast/cast_service.dart:594-613 | lib/services/cast/cast_service.dart:615-634 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) lib/screens/profile/widgets/profile_stats_tab.dart:252 — lib/screens/profile/widgets/profile_stats_tab.dart:252-265 | lib/screens/profile/widgets/profile_stats_tab.dart:269-282 | lib/screens/profile/widgets/profile_stats_tab.dart:285-301 | lib/screens/profile/widgets/profile_stats_tab.dart:304-320 | lib/screens/profile/widgets/profile_stats_tab.dart:323-342 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) lib/services/commentum_service.dart:1753 — lib/services/commentum_service.dart:1753-1773 | lib/services/commentum_service.dart:1800-1825 | lib/services/commentum_service.dart:1959-1980 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) lib/screens/novel/reader/controller/reader_controller.dart:1080 — lib/screens/novel/reader/controller/reader_controller.dart:1080-1101 | lib/screens/novel/reader/controller/reader_controller.dart:1103-1124 | lib/screens/novel/reader/controller/reader_controller.dart:1126-1141 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) lib/database/comments/comments_db.dart:218 — lib/database/comments/comments_db.dart:218-236 | lib/database/comments/comments_db.dart:238-262 | lib/database/comments/comments_db.dart:277-304 | lib/database/comments/comments_db.dart:412-439 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 6+ corresponding lines) lib/models/Anilist/anilist_profile.dart:464 — lib/models/Anilist/anilist_profile.dart:464-469 | lib/models/Anilist/anilist_profile.dart:485-490 | lib/models/Anilist/anilist_profile.dart:506-511 | lib/models/Anilist/anilist_profile.dart:527-532 | lib/models/Anilist/anilist_profile.dart:548-553 | lib/models/Anilist/anilist_profile.dart:569-574 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) lib/screens/anime/watch/controller/player_controller.dart:3136 — lib/screens/anime/watch/controller/player_controller.dart:3136-3154 | lib/screens/manga/controller/reader_controller.dart:774-792 | lib/screens/novel/reader/controller/reader_controller.dart:854-868 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:267 — lib/screens/anime/watch/controls/widgets/bottom_sheet.dart:267-277 | lib/screens/anime/watch/controls/widgets/control_button.dart:39-50 | lib/widgets/anymex_widgets/anymex_titlebar.dart:263-273 | lib/widgets/common/navbar.dart:102-115 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 11+ corresponding lines) lib/screens/anime/watch/controls/themes/setup/themed_controls.dart:10 — lib/screens/anime/watch/controls/themes/setup/themed_controls.dart:10-20 | lib/screens/anime/watch/controls/themes/setup/themed_controls.dart:26-36 | lib/screens/anime/watch/controls/themes/setup/themed_controls.dart:42-52 | lib/screens/manga/widgets/reader/themes/setup/themed_controls.dart:10-20 | lib/screens/manga/widgets/reader/themes/setup/themed_controls.dart:26-36 | lib/screens/manga/widgets/reader/themes/setup/themed_controls.dart:42-52 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) lib/database/comments/comments_db.dart:306 — lib/database/comments/comments_db.dart:306-321 | lib/database/comments/comments_db.dart:323-338 | lib/database/comments/comments_db.dart:340-353 | lib/database/comments/comments_db.dart:382-397 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) lib/controllers/settings/settings.dart:952 — lib/controllers/settings/settings.dart:952-957 | lib/controllers/settings/settings.dart:959-965 | lib/controllers/settings/settings.dart:967-973 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) lib/models/Anilist/anilist_profile.dart:233 — lib/models/Anilist/anilist_profile.dart:233-239 | lib/models/Anilist/anilist_profile.dart:249-255 | lib/models/Media/voice_actor.dart:17-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) lib/utils/external_font_loader.dart:142 — lib/utils/external_font_loader.dart:142-149 | lib/utils/external_font_loader.dart:246-253 | lib/utils/local_thumbnail_service.dart:114-121 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 11+ corresponding lines) lib/controllers/watchium/watchium_service.dart:775 — lib/controllers/watchium/watchium_service.dart:775-785 | lib/controllers/watchium/watchium_service.dart:787-797 | lib/controllers/watchium/watchium_service.dart:799-809 | lib/controllers/watchium/watchium_service.dart:811-821 | lib/controllers/watchium/watchium_service.dart:823-835 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (121–171 lines × 2) · ×1
  • Duplicated block (121–171 lines × 2) lib/controllers/services/anilist/anilist_data.dart:471 — lib/controllers/services/anilist/anilist_data.dart:471-591 | lib/controllers/services/anilist/anilist_data.dart:661-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_data.dart:471` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–124 lines × 4) · ×1
  • Duplicated block (16–124 lines × 4) lib/controllers/services/anilist/anilist_auth.dart:889 — lib/controllers/services/anilist/anilist_auth.dart:889-1012 | lib/controllers/services/anilist/anilist_auth.dart:1053-1068 | lib/controllers/services/anilist/anilist_auth.dart:1124-1169 | lib/controllers/services/anilist/anilist_auth.dart:1229-1245 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:889` 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 (103 lines × 2) · ×1
  • Duplicated block (103 lines × 2) lib/widgets/dialogs/logo_animation_preview_dialog.dart:274 — lib/widgets/dialogs/logo_animation_preview_dialog.dart:274-376 | lib/widgets/dialogs/logo_animation_preview_dialog.dart:503-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/dialogs/logo_animation_preview_dialog.dart:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (94–97 lines × 3) · ×1
  • Duplicated block (94–97 lines × 3) lib/screens/library/online/anime_list.dart:443 — lib/screens/library/online/anime_list.dart:443-536 | lib/screens/library/online/manga_list.dart:427-520 | lib/screens/profile/widgets/user_media_list_page.dart:420-516 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:443` 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 (94 lines × 2) · ×1
  • Duplicated block (94 lines × 2) lib/utils/image_cropper.dart:152 — lib/utils/image_cropper.dart:152-245 | lib/widgets/subsampling_scale_image_view/subsampling_image_provider.dart:223-316 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (93 lines × 2) · ×1
  • Duplicated block (93 lines × 2) lib/models/Media/media.dart:194 — lib/models/Media/media.dart:194-286 | lib/models/Media/media.dart:399-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (90–92 lines × 2) · ×1
  • Duplicated block (90–92 lines × 2) lib/screens/profile/activity_details_page.dart:517 — lib/screens/profile/activity_details_page.dart:517-606 | lib/widgets/non_widgets/activity_card.dart:264-355 — before extracting anything, compare `lib/screens/profile/activity_details_page.dart` and `lib/widgets/non_widgets/activity_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 190 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/activity_card.dart:264` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (74–87 lines × 2) · ×1
  • Duplicated block (74–87 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:2052 — lib/controllers/services/anilist/anilist_auth.dart:2052-2138 | lib/controllers/services/anilist/anilist_auth.dart:2452-2525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:2052` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (86 lines × 2) · ×1
  • Duplicated block (86 lines × 2) lib/screens/library/online/anime_list.dart:565 — lib/screens/library/online/anime_list.dart:565-650 | lib/screens/library/online/manga_list.dart:549-634 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (109–111 lines × 2) · ×1
  • Duplicated block (109–111 lines × 2) lib/widgets/common/media_mode_selector.dart:267 — lib/widgets/common/media_mode_selector.dart:267-377 | lib/widgets/common/media_mode_selector.dart:383-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/media_mode_selector.dart:267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (77–78 lines × 2) · ×1
  • Duplicated block (77–78 lines × 2) lib/screens/library/online/anime_list.dart:694 — lib/screens/library/online/anime_list.dart:694-770 | lib/screens/library/online/manga_list.dart:678-755 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 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 (74 lines × 2) · ×1
  • Duplicated block (74 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:303 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:303-376 | lib/screens/settings/sub_settings/settings_reader.dart:1043-1116 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:303` 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 (71 lines × 2) · ×1
  • Duplicated block (71 lines × 2) lib/screens/anime/widgets/episode_list_builder.dart:1215 — lib/screens/anime/widgets/episode_list_builder.dart:1215-1285 | lib/screens/manga/widgets/chapter_list_builder.dart:1334-1404 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1215` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:967 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:967-1035 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:860-928 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 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 (67 lines × 2) · ×1
  • Duplicated block (67 lines × 2) lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:96 — lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:96-162 | lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:182-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:179` calls `encodeComponent` and `lib/screens/anime/widgets/comments/widgets/gif_picker_sheet.dart:93` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (64–65 lines × 2) · ×1
  • Duplicated block (64–65 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:419 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:419-483 | lib/screens/settings/sub_settings/settings_reader.dart:1305-1368 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:419` 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 (60–61 lines × 2) · ×1
  • Duplicated block (60–61 lines × 2) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:508 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:508-567 | lib/widgets/watchium/watchium_create_dialog.dart:433-493 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:508` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (95 lines × 2) · ×1
  • Duplicated block (95 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:148 — lib/screens/settings/sub_settings/reader/settings_reader_novel.dart:148-242 | lib/screens/settings/sub_settings/settings_reader.dart:330-424 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_novel.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 327 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 (60 lines × 2) · ×1
  • Duplicated block (60 lines × 2) lib/widgets/anime/visuals/visuals_popup.dart:181 — lib/widgets/anime/visuals/visuals_popup.dart:181-240 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:46-105 — before extracting anything, compare `lib/widgets/anime/visuals/visuals_popup.dart` and `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:873 — lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart:873-928 | lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart:766-821 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/player_control_themes/ios26_player_control_theme.dart` and `lib/screens/anime/watch/controls/themes/player_control_themes/ios_legacy_player_control_theme.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (54–55 lines × 2) · ×1
  • Duplicated block (54–55 lines × 2) lib/screens/profile/widgets/activity_heatmap.dart:182 — lib/screens/profile/widgets/activity_heatmap.dart:182-235 | lib/screens/stats/user_stats_page.dart:683-737 — before extracting anything, compare `lib/screens/profile/widgets/activity_heatmap.dart` and `lib/screens/stats/user_stats_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/activity_heatmap.dart:182` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (52–54 lines × 2) · ×1
  • Duplicated block (52–54 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:1006 — lib/screens/anime/widgets/comments/comments_section.dart:1006-1057 | lib/screens/anime/widgets/comments/comments_section.dart:1070-1123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:1006` 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 (46–51 lines × 2) · ×1
  • Duplicated block (46–51 lines × 2) lib/screens/profile/widgets/profile_header.dart:501 — lib/screens/profile/widgets/profile_header.dart:501-551 | lib/screens/profile/widgets/profile_header.dart:780-825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:501` 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 (50 lines × 2) · ×1
  • Duplicated block (50 lines × 2) lib/screens/novel/reader/widgets/bottom_controls.dart:152 — lib/screens/novel/reader/widgets/bottom_controls.dart:152-201 | lib/screens/novel/reader/widgets/bottom_controls.dart:233-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/novel/reader/widgets/bottom_controls.dart:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (48–49 lines × 2) · ×1
  • Duplicated block (48–49 lines × 2) lib/screens/profile/profile_page.dart:831 — lib/screens/profile/profile_page.dart:831-878 | lib/screens/profile/user_profile_page.dart:791-839 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:831` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (46–48 lines × 3) · ×1
  • Duplicated block (46–48 lines × 3) lib/screens/anime/widgets/anime_stats.dart:942 — lib/screens/anime/widgets/anime_stats.dart:942-987 | lib/screens/manga/widgets/manga_stats.dart:852-897 | lib/screens/novel/details/widgets/novel_stats.dart:246-293 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (77–78 lines × 3) · ×1
  • Duplicated block (77–78 lines × 3) lib/screens/anime/details/media_details_page.dart:486 — lib/screens/anime/details/media_details_page.dart:486-562 | lib/screens/profile/profile_page.dart:472-548 | lib/screens/profile/user_profile_page.dart:539-616 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/profile/profile_page.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/user_profile_page.dart:539` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (27–46 lines × 2) · ×1
  • Duplicated block (27–46 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:601 — lib/controllers/services/anilist/anilist_auth.dart:601-646 | lib/controllers/services/anilist/anilist_auth.dart:666-692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:601` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (46 lines × 2) · ×1
  • Duplicated block (46 lines × 2) lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:255 — lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:255-300 | lib/screens/settings/sub_settings/settings_reader.dart:987-1032 — before extracting anything, compare `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart` and `lib/screens/settings/sub_settings/settings_reader.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/reader/settings_reader_manga.dart:255` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `icon` to `Icons.image_search_rounded` in one and `Iconsax.book_1` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (39–44 lines × 2) · ×1
  • Duplicated block (39–44 lines × 2) lib/screens/profile/widgets/user_profile_app_bar.dart:166 — lib/screens/profile/widgets/user_profile_app_bar.dart:166-204 | lib/screens/profile/widgets/user_profile_header.dart:420-463 — before extracting anything, compare `lib/screens/profile/widgets/user_profile_app_bar.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_profile_app_bar.dart:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (40–42 lines × 2) · ×1
  • Duplicated block (40–42 lines × 2) lib/screens/library/widgets/unified_history_card.dart:107 — lib/screens/library/widgets/unified_history_card.dart:107-148 | lib/screens/library/widgets/unified_history_card.dart:378-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/unified_history_card.dart:107` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) lib/screens/profile/profile_page.dart:610 — lib/screens/profile/profile_page.dart:610-649 | lib/screens/profile/user_profile_page.dart:1246-1284 — before extracting anything, compare `lib/screens/profile/profile_page.dart` and `lib/screens/profile/user_profile_page.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 796 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/profile_page.dart:610` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–39 lines × 4) · ×1
  • Duplicated block (23–39 lines × 4) lib/screens/anime/details/media_details_page.dart:457 — lib/screens/anime/details/media_details_page.dart:457-479 | lib/screens/profile/profile_page.dart:447-469 | lib/screens/profile/user_profile_page.dart:514-536 | lib/screens/settings/sub_settings/settings_ui_details.dart:438-476 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/profile/profile_page.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (36–37 lines × 3) · ×1
  • Duplicated block (36–37 lines × 3) lib/widgets/non_widgets/reasons_sheet.dart:245 — lib/widgets/non_widgets/reasons_sheet.dart:245-281 | lib/widgets/non_widgets/recommend_sheet.dart:395-430 | lib/widgets/non_widgets/recommend_sheet.dart:601-636 — before extracting anything, compare `lib/widgets/non_widgets/reasons_sheet.dart` and `lib/widgets/non_widgets/recommend_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/reasons_sheet.dart:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) lib/controllers/services/anilist/anilist_auth.dart:1267 — lib/controllers/services/anilist/anilist_auth.dart:1267-1319 | lib/controllers/services/anilist/anilist_auth.dart:1327-1379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–35 lines × 4) · ×1
  • Duplicated block (30–35 lines × 4) lib/screens/profile/widgets/profile_header.dart:429 — lib/screens/profile/widgets/profile_header.dart:429-463 | lib/screens/profile/widgets/profile_header.dart:711-740 | lib/screens/profile/widgets/user_profile_app_bar.dart:150-179 | lib/screens/profile/widgets/user_profile_header.dart:401-434 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:429` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31–35 lines × 3) · ×1
  • Duplicated block (31–35 lines × 3) lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:152 — lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:152-182 | lib/widgets/anime/visuals/visuals_popup.dart:238-271 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:103-137 — before extracting anything, compare `lib/widgets/anime/visuals/visuals_popup.dart` and `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/reader_page_actions_dialog.dart:152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (34 lines × 4) · ×1
  • Duplicated block (34 lines × 4) lib/controllers/services/widgets/widgets_builders.dart:420 — lib/controllers/services/widgets/widgets_builders.dart:420-453 | lib/screens/community/community_recommendations_page.dart:730-763 | lib/screens/community/user_recommendations_page.dart:360-393 | lib/widgets/media_items/media_peek_popup.dart:1135-1168 — before extracting anything, compare `lib/controllers/services/widgets/widgets_builders.dart` and `lib/screens/community/community_recommendations_page.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (28–33 lines × 2) · ×1
  • Duplicated block (28–33 lines × 2) lib/screens/settings/sub_settings/player/settings_player_shaders.dart:419 — lib/screens/settings/sub_settings/player/settings_player_shaders.dart:419-446 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:563-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_shaders.dart:419` 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 (31–32 lines × 3) · ×1
  • Duplicated block (31–32 lines × 3) lib/widgets/non_widgets/reasons_sheet.dart:204 — lib/widgets/non_widgets/reasons_sheet.dart:204-235 | lib/widgets/non_widgets/recommend_sheet.dart:355-385 | lib/widgets/non_widgets/recommend_sheet.dart:561-591 — before extracting anything, compare `lib/widgets/non_widgets/reasons_sheet.dart` and `lib/widgets/non_widgets/recommend_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/reasons_sheet.dart:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (28–31 lines × 2) · ×1
  • Duplicated block (28–31 lines × 2) lib/screens/profile/widgets/user_profile_app_bar.dart:260 — lib/screens/profile/widgets/user_profile_app_bar.dart:260-287 | lib/screens/profile/widgets/user_profile_header.dart:105-135 — before extracting anything, compare `lib/screens/profile/widgets/user_profile_app_bar.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_profile_app_bar.dart:260` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (27–31 lines × 2) · ×1
  • Duplicated block (27–31 lines × 2) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:82 — lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:82-108 | lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1348-1378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:82` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–30 lines × 5) · ×1
  • Duplicated block (14–30 lines × 5) lib/screens/anime/details/media_details_page.dart:459 — lib/screens/anime/details/media_details_page.dart:459-472 | lib/screens/profile/profile_page.dart:449-462 | lib/screens/profile/user_profile_page.dart:516-529 | lib/screens/settings/sub_settings/settings_ui_details.dart:440-469 | lib/widgets/anime/media_header.dart:135-163 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/profile/profile_page.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:459` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–30 lines × 3) · ×1
  • Duplicated block (28–30 lines × 3) lib/controllers/services/backup_restore/backup_restore_service.dart:589 — lib/controllers/services/backup_restore/backup_restore_service.dart:589-618 | lib/controllers/services/backup_restore/backup_restore_service.dart:621-650 | lib/controllers/services/backup_restore/backup_restore_service.dart:653-680 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/backup_restore_service.dart:589` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) lib/controllers/sync/gist_sync_controller.dart:566 — lib/controllers/sync/gist_sync_controller.dart:566-593 | lib/controllers/sync/gist_sync_controller.dart:659-688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/sync/gist_sync_controller.dart:659` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25–30 lines × 2) · ×1
  • Duplicated block (25–30 lines × 2) lib/screens/anime/studio_details_page.dart:358 — lib/screens/anime/studio_details_page.dart:358-382 | lib/screens/anime/widgets/character_staff_sheet.dart:937-966 — before extracting anything, compare `lib/screens/anime/studio_details_page.dart` and `lib/screens/anime/widgets/character_staff_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/studio_details_page.dart:358` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20–30 lines × 2) · ×1
  • Duplicated block (20–30 lines × 2) lib/utils/notification.dart:187 — lib/utils/notification.dart:187-216 | lib/utils/notification.dart:228-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/notification.dart:187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (27–29 lines × 2) · ×1
  • Duplicated block (27–29 lines × 2) lib/screens/profile/widgets/profile_header.dart:100 — lib/screens/profile/widgets/profile_header.dart:100-128 | lib/screens/profile/widgets/user_profile_header.dart:83-109 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 179 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 3) · ×1
  • Duplicated block (28 lines × 3) lib/controllers/services/anilist/anilist_auth.dart:1947 — lib/controllers/services/anilist/anilist_auth.dart:1947-1974 | lib/controllers/services/anilist/anilist_auth.dart:2550-2577 | lib/controllers/services/anilist/anilist_auth.dart:2607-2634 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1947` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/controllers/services/anilist/anilist_auth.dart:2578` calls `toInt` and `lib/controllers/services/anilist/anilist_auth.dart:2635` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (27 lines × 4) · ×1
  • Duplicated block (27 lines × 4) lib/screens/anime/details/media_details_page.dart:504 — lib/screens/anime/details/media_details_page.dart:504-530 | lib/screens/profile/profile_page.dart:490-516 | lib/screens/profile/user_profile_page.dart:557-583 | lib/screens/settings/sub_settings/settings_ui_details.dart:708-734 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/profile/profile_page.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:504` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–27 lines × 3) · ×1
  • Duplicated block (26–27 lines × 3) lib/widgets/anime/visuals/visuals_popup.dart:163 — lib/widgets/anime/visuals/visuals_popup.dart:163-189 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:28-54 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:154-179 — before extracting anything, compare `lib/widgets/anime/visuals/visuals_popup.dart` and `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) lib/controllers/services/anilist/anilist_auth.dart:1270 — lib/controllers/services/anilist/anilist_auth.dart:1270-1295 | lib/controllers/services/anilist/anilist_auth.dart:1330-1355 | lib/controllers/services/anilist/anilist_auth.dart:1693-1726 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) lib/screens/profile/widgets/profile_header.dart:265 — lib/screens/profile/widgets/profile_header.dart:265-290 | lib/screens/profile/widgets/profile_header.dart:941-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:265` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) lib/widgets/anime/visuals/visuals_popup.dart:379 — lib/widgets/anime/visuals/visuals_popup.dart:379-404 | lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:228-251 — before extracting anything, compare `lib/widgets/anime/visuals/visuals_popup.dart` and `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 160 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_fullscreen_image_viewer.dart:228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) lib/screens/manga/widgets/reader/continuous_reader.dart:221 — lib/screens/manga/widgets/reader/continuous_reader.dart:221-244 | lib/screens/manga/widgets/reader/continuous_reader.dart:246-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/continuous_reader.dart:246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–24 lines × 9) · ×1
  • Duplicated block (21–24 lines × 9) lib/controllers/services/anilist/anilist_auth.dart:1522 — lib/controllers/services/anilist/anilist_auth.dart:1522-1545 | lib/controllers/services/anilist/anilist_auth.dart:1558-1578 | lib/controllers/services/anilist/anilist_auth.dart:1591-1611 | lib/controllers/services/anilist/anilist_auth.dart:1624-1644 | lib/controllers/services/anilist/anilist_auth.dart:1657-1677 | lib/controllers/services/anilist/anilist_auth.dart:1752-1773 | lib/controllers/services/anilist/anilist_auth.dart:1790-1813 | lib/controllers/services/anilist/anilist_auth.dart:1832-1853 | lib/controllers/services/anilist/anilist_auth.dart:1914-1935 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1522` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20–24 lines × 3) · ×1
  • Duplicated block (20–24 lines × 3) lib/screens/library/widgets/library_deps.dart:160 — lib/screens/library/widgets/library_deps.dart:160-183 | lib/widgets/common/custom_tiles.dart:149-168 | lib/widgets/common/custom_tiles.dart:342-365 — before extracting anything, compare `lib/screens/library/widgets/library_deps.dart` and `lib/widgets/common/custom_tiles.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/library_deps.dart:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (22–24 lines × 3) · ×1
  • Duplicated block (22–24 lines × 3) lib/widgets/common/media_mode_selector.dart:183 — lib/widgets/common/media_mode_selector.dart:183-204 | lib/widgets/common/media_mode_selector.dart:338-361 | lib/widgets/common/media_mode_selector.dart:453-476 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/media_mode_selector.dart:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:739 — lib/screens/anime/widgets/comments/comments_section.dart:739-761 | lib/screens/anime/widgets/comments/comments_section.dart:1669-1692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/comments_section.dart:739` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/widgets/comments/comments_section.dart:738` calls `opaque`, `OutlineInputBorder` and `lib/screens/anime/widgets/comments/comments_section.dart:1669` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) lib/screens/profile/widgets/profile_header.dart:229 — lib/screens/profile/widgets/profile_header.dart:229-250 | lib/screens/profile/widgets/user_profile_header.dart:207-230 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_header.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 179 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/user_profile_header.dart:207` 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 (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) lib/screens/local_source/local_source_view.dart:499 — lib/screens/local_source/local_source_view.dart:499-521 | lib/screens/local_source/local_source_view.dart:582-604 | lib/screens/local_source/local_source_view.dart:650-672 | lib/screens/local_source/local_source_view.dart:716-738 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–23 lines × 3) · ×1
  • Duplicated block (20–23 lines × 3) lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:74 — lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:74-93 | lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1340-1362 | lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:1403-1425 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/widgets/backup_and_restore_widgets.dart:74` 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 (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) lib/screens/profile/widgets/profile_header.dart:314 — lib/screens/profile/widgets/profile_header.dart:314-336 | lib/screens/profile/widgets/profile_header.dart:974-994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:314` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 4) · ×1
  • Duplicated block (21–22 lines × 4) lib/screens/anime/widgets/anime_stats.dart:314 — lib/screens/anime/widgets/anime_stats.dart:314-335 | lib/screens/anime/widgets/anime_stats.dart:377-398 | lib/screens/anime/widgets/anime_stats.dart:440-461 | lib/screens/manga/widgets/manga_stats.dart:429-449 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:314` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) lib/controllers/offline/offline_storage_controller.dart:659 — lib/controllers/offline/offline_storage_controller.dart:659-680 | lib/controllers/offline/offline_storage_controller.dart:723-744 | lib/controllers/offline/offline_storage_controller.dart:787-808 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/offline/offline_storage_controller.dart:659` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) lib/widgets/common/navbar/styles/classic_navbar.dart:323 — lib/widgets/common/navbar/styles/classic_navbar.dart:323-344 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:374-392 — before extracting anything, compare `lib/widgets/common/navbar/styles/classic_navbar.dart` and `lib/widgets/common/navbar/styles/floating_pill_navbar.dart` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 234 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/navbar/styles/classic_navbar.dart:323` 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 (21 lines × 4) · ×1
  • Duplicated block (21 lines × 4) lib/screens/anime/details/media_details_page.dart:539 — lib/screens/anime/details/media_details_page.dart:539-559 | lib/screens/profile/profile_page.dart:525-545 | lib/screens/profile/user_profile_page.dart:592-612 | lib/screens/settings/sub_settings/settings_ui_details.dart:673-693 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/profile/profile_page.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 195 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 (13–21 lines × 2) · ×1
  • Duplicated block (13–21 lines × 2) lib/screens/anime/widgets/comments/comments_section.dart:3169 — lib/screens/anime/widgets/comments/comments_section.dart:3169-3189 | lib/screens/settings/sub_settings/settings_moderation.dart:1794-1806 — before extracting anything, compare `lib/screens/anime/widgets/comments/comments_section.dart` and `lib/screens/settings/sub_settings/settings_moderation.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) lib/widgets/header/header.dart:794 — lib/widgets/header/header.dart:794-812 | lib/widgets/header/header.dart:840-860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/header/header.dart:794` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17–20 lines × 4) · ×1
  • Duplicated block (17–20 lines × 4) lib/screens/settings/sub_settings/player/settings_player_shaders.dart:354 — lib/screens/settings/sub_settings/player/settings_player_shaders.dart:354-370 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:418-434 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:497-513 | lib/screens/settings/sub_settings/player/settings_player_shaders.dart:562-581 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_shaders.dart:354` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×1
  • Duplicated block (19–20 lines × 3) lib/screens/anime/watch/controls/top_controls.dart:147 — lib/screens/anime/watch/controls/top_controls.dart:147-166 | lib/screens/anime/watch/controls/top_controls.dart:287-306 | lib/screens/anime/watch/controls/top_controls.dart:496-514 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/top_controls.dart:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) lib/screens/library/editor/list_editor.dart:251 — lib/screens/library/editor/list_editor.dart:251-270 | lib/screens/library/editor/list_editor.dart:364-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/editor/list_editor.dart:251` 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 (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) package_manager.dart:300 — package_manager.dart:300-319 | package_manager.dart:328-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `package_manager.dart:300` 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 (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) lib/screens/anime/widgets/anime_stats.dart:607 — lib/screens/anime/widgets/anime_stats.dart:607-625 | lib/screens/anime/widgets/anime_stats.dart:732-750 | lib/screens/manga/widgets/manga_stats.dart:310-328 | lib/screens/manga/widgets/manga_stats.dart:774-792 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:607` 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 (18–19 lines × 4) · ×1
  • Duplicated block (18–19 lines × 4) lib/utils/color_profiler.dart:595 — lib/utils/color_profiler.dart:595-613 | lib/utils/color_profiler.dart:794-812 | lib/utils/color_profiler.dart:1031-1048 | lib/utils/color_profiler.dart:1306-1324 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/color_profiler.dart:595` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/utils/color_profiler.dart:593` calls `Opacity` and `lib/utils/color_profiler.dart:793` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:198 — lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:198-216 | lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:181-199 | lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:331-349 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) lib/widgets/dialogs/logo_animation_preview_dialog.dart:131 — lib/widgets/dialogs/logo_animation_preview_dialog.dart:131-147 | lib/widgets/dialogs/logo_animation_preview_dialog.dart:254-272 — both copies are in the same file, so extract the 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 (18 lines × 10) · ×1
  • Duplicated block (18 lines × 10) lib/controllers/services/anilist/anilist_auth.dart:1525 — lib/controllers/services/anilist/anilist_auth.dart:1525-1545 | lib/controllers/services/anilist/anilist_auth.dart:1561-1578 | lib/controllers/services/anilist/anilist_auth.dart:1594-1611 | lib/controllers/services/anilist/anilist_auth.dart:1627-1644 | lib/controllers/services/anilist/anilist_auth.dart:1660-1677 | lib/controllers/services/anilist/anilist_auth.dart:1755-1773 | lib/controllers/services/anilist/anilist_auth.dart:1793-1813 | lib/controllers/services/anilist/anilist_auth.dart:1835-1853 | lib/controllers/services/anilist/anilist_auth.dart:1868-1892 | lib/controllers/services/anilist/anilist_auth.dart:1917-1935 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1525` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18 lines × 8) · ×1
  • Duplicated block (18 lines × 8) lib/controllers/services/anilist/anilist_auth.dart:1525 — lib/controllers/services/anilist/anilist_auth.dart:1525-1545 | lib/controllers/services/anilist/anilist_auth.dart:1594-1611 | lib/controllers/services/anilist/anilist_auth.dart:1627-1644 | lib/controllers/services/anilist/anilist_auth.dart:1793-1814 | lib/controllers/services/anilist/anilist_auth.dart:1835-1853 | lib/controllers/services/anilist/anilist_auth.dart:1868-1892 | lib/controllers/services/anilist/anilist_auth.dart:1917-1935 | lib/controllers/services/anilist/anilist_auth.dart:2613-2635 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_auth.dart:1525` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 4) · ×1
  • Duplicated block (17–18 lines × 4) lib/screens/anime/widgets/anime_stats.dart:654 — lib/screens/anime/widgets/anime_stats.dart:654-671 | lib/screens/anime/widgets/anime_stats.dart:694-710 | lib/screens/manga/widgets/manga_stats.dart:357-374 | lib/screens/manga/widgets/manga_stats.dart:736-752 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:654` 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 (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) lib/screens/library/widgets/library_deps.dart:163 — lib/screens/library/widgets/library_deps.dart:163-180 | lib/widgets/common/custom_tiles.dart:151-168 | lib/widgets/common/custom_tiles.dart:245-262 | lib/widgets/common/custom_tiles.dart:345-362 — before extracting anything, compare `lib/screens/library/widgets/library_deps.dart` and `lib/widgets/common/custom_tiles.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/widgets/library_deps.dart:163` 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 (15–18 lines × 3) · ×1
  • Duplicated block (15–18 lines × 3) lib/screens/profile/activity_details_page.dart:632 — lib/screens/profile/activity_details_page.dart:632-646 | lib/screens/profile/widgets/social_tab.dart:298-315 | lib/widgets/non_widgets/activity_card.dart:381-395 — before extracting anything, compare `lib/screens/profile/activity_details_page.dart` and `lib/screens/profile/widgets/social_tab.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/activity_details_page.dart:632` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–18 lines × 2) · ×1
  • Duplicated block (14–18 lines × 2) lib/screens/anime/details/media_details_page.dart:1217 — lib/screens/anime/details/media_details_page.dart:1217-1234 | lib/screens/manga/widgets/chapter_list_builder.dart:282-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:1217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–17 lines × 5) · ×1
  • Duplicated block (15–17 lines × 5) lib/services/commentum_service.dart:678 — lib/services/commentum_service.dart:678-694 | lib/services/commentum_service.dart:725-741 | lib/services/commentum_service.dart:775-789 | lib/services/commentum_service.dart:813-828 | lib/services/commentum_service.dart:934-950 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) lib/screens/profile/widgets/profile_header.dart:119 — lib/screens/profile/widgets/profile_header.dart:119-135 | lib/screens/profile/widgets/profile_header.dart:831-847 | lib/screens/profile/widgets/user_profile_app_bar.dart:255-271 | lib/screens/profile/widgets/user_profile_header.dart:100-116 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:119` 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 (14–17 lines × 3) · ×1
  • Duplicated block (14–17 lines × 3) lib/screens/anime/widgets/anime_stats.dart:599 — lib/screens/anime/widgets/anime_stats.dart:599-615 | lib/screens/manga/widgets/manga_stats.dart:302-318 | lib/screens/profile/widgets/profile_stats_tab.dart:422-435 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:599` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) lib/screens/manga/widgets/manga_stats.dart:421 — lib/screens/manga/widgets/manga_stats.dart:421-435 | lib/screens/settings/sub_settings/settings_donation.dart:260-276 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/manga_stats.dart:421` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 6) · ×1
  • Duplicated block (16 lines × 6) lib/screens/anime/home_page.dart:240 — lib/screens/anime/home_page.dart:240-255 | lib/screens/extensions/ExtensionScreen.dart:211-226 | lib/screens/home_page.dart:348-363 | lib/screens/library/my_library.dart:151-166 | lib/screens/manga/home_page.dart:129-144 | lib/screens/novel/home_page.dart:91-106 — `lib/screens/anime/home_page.dart` and `lib/screens/manga/home_page.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/home_page.dart:240` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15–16 lines × 4) · ×1
  • Duplicated block (15–16 lines × 4) lib/screens/anime/widgets/anime_stats.dart:288 — lib/screens/anime/widgets/anime_stats.dart:288-303 | lib/screens/anime/widgets/anime_stats.dart:352-366 | lib/screens/anime/widgets/anime_stats.dart:414-429 | lib/screens/manga/widgets/manga_stats.dart:403-417 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/anime_stats.dart:288` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–15 lines × 6) · ×1
  • Duplicated block (14–15 lines × 6) lib/screens/anime/watch/controls/bottom_controls.dart:269 — lib/screens/anime/watch/controls/bottom_controls.dart:269-283 | lib/screens/anime/watch/controls/bottom_controls.dart:331-345 | lib/screens/anime/watch/controls/bottom_controls.dart:356-370 | lib/screens/anime/watch/controls/bottom_controls.dart:424-438 | lib/screens/anime/watch/controls/bottom_controls.dart:458-472 | lib/screens/anime/watch/controls/top_controls.dart:363-376 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/bottom_controls.dart:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/anime/watch/controls/bottom_controls.dart:457` calls `SizedBox` and `lib/screens/anime/watch/controls/bottom_controls.dart:423` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:374 — lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:374-388 | lib/screens/anime/watch/controls/widgets/progress_slider.dart:291-305 | lib/screens/anime/widgets/video_slider.dart:53-67 | lib/widgets/common/anymex_slider_m3.dart:403-417 | lib/widgets/common/slider_semantics.dart:139-153 | lib/widgets/common/slider_semantics.dart:284-298 — before extracting anything, compare `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart` and `lib/widgets/common/anymex_slider_m3.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/themes/media_indicator_themes/default_media_indicator_theme.dart:374` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 5) · ×1
  • Duplicated block (14–15 lines × 5) lib/services/commentum_service.dart:440 — lib/services/commentum_service.dart:440-454 | lib/services/commentum_service.dart:541-555 | lib/services/commentum_service.dart:633-647 | lib/services/commentum_service.dart:891-905 | lib/services/commentum_service.dart:998-1011 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/commentum_service.dart:440` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) lib/widgets/anymex_widgets/anymex_tile.dart:197 — lib/widgets/anymex_widgets/anymex_tile.dart:197-211 | lib/widgets/anymex_widgets/anymex_tile.dart:367-381 | lib/widgets/anymex_widgets/anymex_tile.dart:505-519 | lib/widgets/anymex_widgets/anymex_tile.dart:587-601 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_tile.dart:197` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) lib/controllers/services/anilist/anilist_data.dart:308 — lib/controllers/services/anilist/anilist_data.dart:308-320 | lib/controllers/services/mal/mal_service.dart:166-180 — before extracting anything, compare `lib/controllers/services/anilist/anilist_data.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/anilist/anilist_data.dart:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) lib/screens/local_source/local_source_view.dart:499 — lib/screens/local_source/local_source_view.dart:499-512 | lib/screens/local_source/local_source_view.dart:582-595 | lib/screens/local_source/local_source_view.dart:650-663 | lib/screens/local_source/local_source_view.dart:716-729 | lib/screens/local_source/local_source_view.dart:1169-1182 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/local_source/local_source_view.dart:499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) lib/controllers/discord/discord_rpc.dart:542 — lib/controllers/discord/discord_rpc.dart:542-555 | lib/controllers/discord/discord_rpc.dart:693-705 | lib/controllers/discord/discord_rpc.dart:800-811 | lib/controllers/discord/discord_rpc.dart:924-936 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/discord/discord_rpc.dart:542` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/controllers/discord/discord_rpc.dart:707` calls `toString` and `lib/controllers/discord/discord_rpc.dart:813` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 4) · ×1
  • Duplicated block (13–14 lines × 4) lib/screens/settings/sub_settings/player/settings_player_engine.dart:674 — lib/screens/settings/sub_settings/player/settings_player_engine.dart:674-686 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:689-702 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:705-717 | lib/screens/settings/sub_settings/player/settings_player_engine.dart:720-732 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/player/settings_player_engine.dart:674` 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 (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) lib/screens/downloads/download_screen.dart:1132 — lib/screens/downloads/download_screen.dart:1132-1145 | lib/screens/downloads/download_screen.dart:1412-1425 | lib/screens/downloads/widgets/download_server_selector.dart:411-423 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/download_screen.dart:1132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/downloads/widgets/download_server_selector.dart:409` calls `Row` and `lib/screens/downloads/download_screen.dart:1131` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) lib/controllers/services/anilist/anilist_data.dart:286 — lib/controllers/services/anilist/anilist_data.dart:286-296 | lib/controllers/services/mal/mal_service.dart:134-147 — before extracting anything, compare `lib/controllers/services/anilist/anilist_data.dart` and `lib/controllers/services/mal/mal_service.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) lib/screens/profile/widgets/profile_header.dart:967 — lib/screens/profile/widgets/profile_header.dart:967-979 | lib/screens/profile/widgets/profile_header.dart:997-1009 | lib/screens/profile/widgets/user_profile_app_bar.dart:498-509 | lib/screens/profile/widgets/user_profile_app_bar.dart:534-546 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:967` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) lib/screens/settings/sub_settings/settings_common.dart:41 — lib/screens/settings/sub_settings/settings_common.dart:41-53 | lib/screens/settings/sub_settings/settings_logs.dart:24-35 | lib/screens/settings/sub_settings/settings_storage_manager.dart:183-194 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_common.dart:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 8) · ×1
  • Duplicated block (12 lines × 8) lib/screens/anime/home_page.dart:236 — lib/screens/anime/home_page.dart:236-247 | lib/screens/extensions/ExtensionScreen.dart:207-218 | lib/screens/home_page.dart:344-355 | lib/screens/library/history_page.dart:218-229 | lib/screens/library/my_library.dart:147-158 | lib/screens/manga/home_page.dart:125-136 | lib/screens/novel/home_page.dart:87-98 | lib/screens/stats/user_stats_page.dart:228-239 — `lib/screens/anime/home_page.dart` and `lib/screens/manga/home_page.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/home_page.dart:236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) lib/screens/settings/sub_settings/settings_moderation.dart:545 — lib/screens/settings/sub_settings/settings_moderation.dart:545-556 | lib/widgets/non_widgets/reasons_sheet.dart:257-268 | lib/widgets/non_widgets/recommend_sheet.dart:406-417 | lib/widgets/non_widgets/recommend_sheet.dart:612-623 | lib/widgets/non_widgets/recommend_sheet.dart:1094-1105 | lib/widgets/non_widgets/recommend_sheet.dart:1173-1184 — before extracting anything, compare `lib/widgets/non_widgets/reasons_sheet.dart` and `lib/widgets/non_widgets/recommend_sheet.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 159 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 (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) lib/screens/library/editor/history_editor.dart:273 — lib/screens/library/editor/history_editor.dart:273-284 | lib/screens/library/editor/history_editor.dart:373-384 | lib/screens/library/editor/history_editor.dart:798-809 | lib/screens/library/editor/list_editor.dart:174-185 | lib/screens/library/editor/list_editor.dart:324-335 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) lib/screens/anime/widgets/episode_list_builder.dart:1183 — lib/screens/anime/widgets/episode_list_builder.dart:1183-1194 | lib/screens/anime/widgets/episode_list_builder.dart:1215-1226 | lib/screens/manga/widgets/chapter_list_builder.dart:1302-1313 | lib/screens/manga/widgets/chapter_list_builder.dart:1334-1345 — before extracting anything, compare `lib/screens/anime/widgets/episode_list_builder.dart` and `lib/screens/manga/widgets/chapter_list_builder.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 457 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode_list_builder.dart:1183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) lib/models/Media/media.dart:288 — lib/models/Media/media.dart:288-296 | lib/models/Media/media.dart:515-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Media/media.dart:288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–11 lines × 5) · ×1
  • Duplicated block (8–11 lines × 5) lib/screens/anime/details/media_details_page.dart:894 — lib/screens/anime/details/media_details_page.dart:894-902 | lib/screens/anime/widgets/comments/comments_section.dart:370-379 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:692-702 | lib/screens/library/widgets/library_deps.dart:247-254 | lib/widgets/anime/media_header.dart:441-449 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/anime/widgets/comments/comments_section.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:692` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 5) · ×1
  • Duplicated block (9–11 lines × 5) lib/screens/library/online/anime_list.dart:599 — lib/screens/library/online/anime_list.dart:599-609 | lib/screens/library/online/manga_list.dart:583-593 | lib/widgets/common/navbar/styles/classic_navbar.dart:157-166 | lib/widgets/common/navbar/styles/floating_pill_navbar.dart:136-145 | lib/widgets/header/header.dart:1043-1051 — before extracting anything, compare `lib/screens/library/online/anime_list.dart` and `lib/screens/library/online/manga_list.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 765 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/library/online/anime_list.dart:599` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) lib/screens/profile/widgets/profile_header.dart:641 — lib/screens/profile/widgets/profile_header.dart:641-651 | lib/screens/profile/widgets/profile_header.dart:658-669 | lib/screens/profile/widgets/profile_header.dart:675-686 | lib/screens/profile/widgets/profile_header.dart:692-703 | lib/screens/profile/widgets/user_profile_app_bar.dart:90-100 — before extracting anything, compare `lib/screens/profile/widgets/profile_header.dart` and `lib/screens/profile/widgets/user_profile_app_bar.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/profile/widgets/profile_header.dart:641` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:139 — lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:139-146 | lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:286-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/backup_restore/parsers/tachiyomi_backup_parser.dart:139` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) lib/screens/anime/misc/dub_service.dart:184 — lib/screens/anime/misc/dub_service.dart:184-192 | lib/screens/anime/misc/dub_service.dart:213-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/misc/dub_service.dart:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:556 — lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:556-565 | lib/screens/watchium/watchium_page.dart:384-393 | lib/widgets/non_widgets/reasons_sheet.dart:260-269 | lib/widgets/non_widgets/recommend_sheet.dart:409-418 | lib/widgets/non_widgets/recommend_sheet.dart:615-624 | lib/widgets/watchium/watchium_create_dialog.dart:482-491 — before extracting anything, compare `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart` and `lib/widgets/watchium/watchium_create_dialog.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/watch_together_popup.dart:556` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) lib/screens/manga/widgets/reader/top_controls.dart:80 — lib/screens/manga/widgets/reader/top_controls.dart:80-88 | lib/screens/manga/widgets/reader/top_controls.dart:179-188 | lib/screens/novel/reader/widgets/top_controls.dart:57-65 | lib/screens/novel/reader/widgets/top_controls.dart:163-171 — before extracting anything, compare `lib/screens/manga/widgets/reader/top_controls.dart` and `lib/screens/novel/reader/widgets/top_controls.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/top_controls.dart:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) lib/screens/anime/widgets/episode/styles/detailed_style.dart:201 — lib/screens/anime/widgets/episode/styles/detailed_style.dart:201-208 | lib/screens/downloads/widgets/download_server_selector.dart:518-527 | lib/widgets/watchium/watchium_server_sheet.dart:241-250 — before extracting anything, compare `lib/screens/downloads/widgets/download_server_selector.dart` and `lib/widgets/watchium/watchium_server_sheet.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/widgets/episode/styles/detailed_style.dart:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/screens/downloads/widgets/download_server_selector.dart:515` calls `SizedBox` and `lib/widgets/watchium/watchium_server_sheet.dart:239` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–10 lines × 3) · ×1
  • Duplicated block (7–10 lines × 3) lib/screens/settings/sub_settings/settings_network.dart:455 — lib/screens/settings/sub_settings/settings_network.dart:455-464 | lib/screens/settings/sub_settings/settings_network.dart:777-786 | lib/widgets/watchium/watchium_party_popup.dart:762-768 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/settings/sub_settings/settings_network.dart:455` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–10 lines × 4) · ×1
  • Duplicated block (5–10 lines × 4) package_manager.dart:111 — package_manager.dart:111-120 | package_manager.dart:123-127 | package_manager.dart:131-138 | package_manager.dart:142-151 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `package_manager.dart:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) lib/controllers/source/source_mapper.dart:228 — lib/controllers/source/source_mapper.dart:228-237 | lib/controllers/source/source_mapper.dart:240-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/source/source_mapper.dart:228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) lib/screens/downloads/widgets/download_server_selector.dart:445 — lib/screens/downloads/widgets/download_server_selector.dart:445-454 | lib/screens/downloads/widgets/downloaded_media_view.dart:755-762 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/download_server_selector.dart:445` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6–9 lines × 6) · ×1
  • Duplicated block (6–9 lines × 6) lib/screens/anime/details/media_details_page.dart:893 — lib/screens/anime/details/media_details_page.dart:893-899 | lib/screens/anime/widgets/comments/comments_section.dart:368-376 | lib/screens/anime/widgets/comments/widgets/comments_replies_sheet.dart:691-699 | lib/screens/library/widgets/library_deps.dart:246-251 | lib/widgets/anime/media_header.dart:440-446 | lib/widgets/common/no_source.dart:20-25 — before extracting anything, compare `lib/screens/anime/details/media_details_page.dart` and `lib/screens/anime/widgets/comments/comments_section.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/details/media_details_page.dart:893` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:182 — lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:182-188 | lib/screens/downloads/widgets/download_server_selector.dart:443-451 | lib/screens/downloads/widgets/downloaded_media_view.dart:753-759 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/anime/watch/controls/widgets/sync_subs_popup.dart:182` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–9 lines × 3) · ×1
  • Duplicated block (6–9 lines × 3) lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:83 — lib/screens/downloads/nested_screens/active_downloads/active_downloads.dart:83-88 | lib/screens/downloads/widgets/manga_chapter_download_confirm.dart:129-135 | lib/utils/updater.dart:600-608 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/widgets/manga_chapter_download_confirm.dart:129` 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–16 lines × 3) · ×1
  • Duplicated block (11–16 lines × 3) lib/models/Anilist/anilist_activity.dart:94 — lib/models/Anilist/anilist_activity.dart:94-109 | lib/models/Anilist/anilist_activity.dart:111-121 | lib/models/Anilist/anilist_activity.dart:141-152 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/Anilist/anilist_activity.dart:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) lib/widgets/common/installed_extensions_gridview.dart:102 — lib/widgets/common/installed_extensions_gridview.dart:102-110 | lib/widgets/dialogs/donation_dialog.dart:159-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/common/installed_extensions_gridview.dart:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–7 lines × 4) · ×1
  • Duplicated block (6–7 lines × 4) lib/controllers/services/community_service.dart:1031 — lib/controllers/services/community_service.dart:1031-1037 | lib/controllers/services/community_service.dart:1062-1068 | lib/controllers/services/community_service.dart:1093-1098 | lib/controllers/services/community_service.dart:1117-1122 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/controllers/services/community_service.dart:1031` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) lib/screens/downloads/controller/download_controller.dart:729 — lib/screens/downloads/controller/download_controller.dart:729-734 | lib/screens/downloads/controller/download_controller.dart:748-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/downloads/controller/download_controller.dart:729` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–7 lines × 3) · ×1
  • Duplicated block (3–7 lines × 3) lib/screens/manga/widgets/reader/top_controls.dart:453 — lib/screens/manga/widgets/reader/top_controls.dart:453-459 | lib/screens/manga/widgets/reader/top_controls.dart:468-473 | lib/screens/manga/widgets/reader/top_controls.dart:636-638 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/screens/manga/widgets/reader/top_controls.dart:453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–7 lines × 2) · ×1
  • Duplicated block (5–7 lines × 2) lib/utils/sub_parser.dart:104 — lib/utils/sub_parser.dart:104-110 | lib/utils/sub_parser.dart:118-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/utils/sub_parser.dart:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) lib/widgets/non_widgets/recommend_sheet.dart:273 — lib/widgets/non_widgets/recommend_sheet.dart:273-278 | lib/widgets/non_widgets/recommend_sheet.dart:315-320 | lib/widgets/non_widgets/recommend_sheet.dart:758-761 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/non_widgets/recommend_sheet.dart:273` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) lib/screens/anime/widgets/anime_stats.dart:914 — lib/screens/anime/widgets/anime_stats.dart:914-923 | lib/screens/manga/widgets/manga_stats.dart:824-833 | lib/screens/novel/details/widgets/novel_stats.dart:216-227 — before extracting anything, compare `lib/screens/anime/widgets/anime_stats.dart` and `lib/screens/manga/widgets/manga_stats.dart` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 461 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 (3–5 lines × 3) · ×1
  • Duplicated block (3–5 lines × 3) lib/widgets/anymex_widgets/anymex_animated_logo.dart:528 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:528-532 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:823-827 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:1026-1028 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_animated_logo.dart:528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/widgets/anymex_widgets/anymex_animated_logo.dart:527` calls `clamp` and `lib/widgets/anymex_widgets/anymex_animated_logo.dart:1026` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–5 lines × 4) · ×1
  • Duplicated block (4–5 lines × 4) lib/widgets/anymex_widgets/anymex_animated_logo.dart:668 — lib/widgets/anymex_widgets/anymex_animated_logo.dart:668-671 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:906-910 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:1122-1126 | lib/widgets/anymex_widgets/anymex_animated_logo.dart:1317-1320 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/anymex_widgets/anymex_animated_logo.dart:906` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) lib/widgets/common/cards/styles/exotic_card.dart:33 — lib/widgets/common/cards/styles/exotic_card.dart:33-41 | lib/widgets/common/cards/styles/minimal_exotic_card.dart:33-41 | lib/widgets/common/cards/styles/modern_card.dart:30-38 | lib/widgets/common/cards/styles/saikou_card.dart:30-38 | lib/widgets/common/cards/styles/simple_card.dart:33-41 — before extracting anything, compare `lib/widgets/common/cards/styles/exotic_card.dart` and `lib/widgets/common/cards/styles/minimal_exotic_card.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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.
IC1 · Incompleteness & stubs · Hollow method · ×1
  • Hollow method — returns a constant without doing the work lib/widgets/anymex_widgets/anymex_header.dart:47 — `onScrollNotification` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm lib/widgets/subsampling_scale_image_view/subsampling_scale_image_view.dart:580 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha256.convert(…)` from `package:crypto`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×1
  • Redirected process stream is never drained (deadlock) android/app/src/main/kotlin/com/ryan/anymex/MainActivity.kt:375 — The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`).
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap lib/database/comments/model/comment.dart:153 — `Comment.fromMap` is public and takes `Map m` from its caller, and it calls itself at line 153 (`Comment.fromMap`) with a piece of `m` — and nowhere in `Comment.fromMap` 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 `Comment.fromMap` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 118 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate lib/utils/deeplink.dart:408 — `!Get.isRegistered<ServiceHandler>() || Get.context == null` appears character-identically in 2 files — lib/utils/deeplink.dart, lib/utils/notification.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/anime/widgets/comments/comments_section.dart:632 — `!c.deleted && name.isNotEmpty && name.toLowerCase() != '[deleted]' && seen.add(name.toLowerCase())` appears character-identically in 2 files — lib/screens/anime/widgets/comments/comments_section.dart, lib/screens/anime/widgets/comments/widgets/comment_input_bar.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/services/fcm_service.dart:88 — `!data.containsKey('url') && message.notification?.android?.link != null` appears character-identically in 2 files — lib/services/fcm_service.dart, lib/utils/notification.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/anime/misc/calendar.dart:227 — `!mounted || index < 0 || index >= _tabKeys.length` appears character-identically in 3 files — lib/screens/anime/misc/calendar.dart, lib/screens/library/online/anime_list.dart, lib/screens/library/online/manga_list.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/manga/controller/reader_controller.dart:307 — `!overscrollToChapter.value || _isNavigating` appears character-identically in 2 files — lib/screens/manga/controller/reader_controller.dart, lib/screens/novel/reader/controller/reader_controller.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/widgets/animation/slide_scale.dart:32 — `!s.enableAnimation || s.animationDuration <= 0` appears character-identically in 2 files — lib/widgets/animation/slide_scale.dart, lib/widgets/animation/widget_animations.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/anime/widgets/comments/comments_section.dart:3150 — `!snapshot.hasData || snapshot.data == null` appears character-identically in 2 files — lib/screens/anime/widgets/comments/comments_section.dart, lib/utils/al_about_me.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/anime/details/widgets/media_stats_section.dart:1873 — `!snapshot.hasData || snapshot.data!.error != null || !snapshot.data!.hasAdaptation` appears character-identically in 2 files — lib/screens/anime/details/widgets/media_stats_section.dart, lib/screens/anime/details/widgets/media_stats_section_new.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/anime/details/widgets/media_stats_section.dart:1892 — `!snapshot.hasData || snapshot.data!.error != null || snapshot.data!.nextChapter == null` appears character-identically in 2 files — lib/screens/anime/details/widgets/media_stats_section.dart, lib/screens/anime/details/widgets/media_stats_section_new.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/anime/details/widgets/media_stats_section.dart:1838 — `!snapshot.hasData || snapshot.data!.isEmpty` appears character-identically in 5 files — lib/screens/anime/details/widgets/media_stats_section.dart, lib/screens/anime/details/widgets/media_stats_section_new.dart, lib/screens/anime/widgets/anime_stats.dart, lib/screens/anime/widgets/episode_watch_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/controllers/offline/offline_storage_controller.dart:922 — `(c.link != null && c.link!.isNotEmpty && c.link == chapter.link) || (c.number != null && c.number == chapter.number)` appears character-identically in 3 files — lib/controllers/offline/offline_storage_controller.dart, lib/screens/anime/details/controller/media_details_controller.dart, lib/screens/manga/widgets/chapter_list_builder.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/extensions/ExtensionScreen.dart:537 — `AnymeXRuntimeBridge.isPluginInstalled || AnymeXRuntimeBridge.controller.isReady.value` appears character-identically in 2 files — lib/screens/extensions/ExtensionScreen.dart, lib/screens/settings/sub_settings/settings_extensions.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/widgets/media_items/media_peek_popup.dart:151 — `CommunityService.votingEnabled && widget.voteMediaType != null && widget.voteMediaId != null` appears character-identically in 2 files — lib/widgets/media_items/media_peek_popup.dart, lib/widgets/non_widgets/reasons_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/manga/controller/reader_controller.dart:508 — `Get.isBottomSheetOpen == true || Get.isDialogOpen == true || Get.isOverlaysOpen == true` appears character-identically in 2 files — lib/screens/manga/controller/reader_controller.dart, lib/screens/novel/reader/controller/reader_controller.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/database/isar_models/offline_media.dart:43 — `Get.isRegistered<AnilistAuth>() && Get.find<AnilistAuth>().isLoggedIn.value` appears character-identically in 2 files — lib/database/isar_models/offline_media.dart, lib/models/Media/media.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/discord/discord_rpc.dart:135 — `Get.isRegistered<Settings>() && Get.find<Settings>().isIncognito.value` appears character-identically in 5 files — lib/controllers/discord/discord_rpc.dart, lib/controllers/offline/offline_storage_controller.dart, lib/controllers/service_handler/service_handler.dart, lib/screens/search/search_view.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/database/isar_models/offline_media.dart:32 — `Get.isRegistered<Settings>() && Get.find<Settings>().useAlternateTitle.value` appears character-identically in 3 files — lib/database/isar_models/offline_media.dart, lib/models/Anilist/anilist_media_user.dart, lib/models/Media/media.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/anime/widgets/episode_list_builder.dart:1903 — `Get.isRegistered<TrackBindingController>() && Get.find<TrackBindingController>().hasAnyBinding(mediaData.id)` appears character-identically in 2 files — lib/screens/anime/widgets/episode_list_builder.dart, lib/screens/manga/widgets/chapter_list_builder.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/services/anilist/anilist_auth.dart:212 — `Platform.isWindows || Platform.isLinux || Platform.isMacOS` appears character-identically in 8 files — lib/controllers/services/anilist/anilist_auth.dart, lib/controllers/services/mal/mal_service.dart, lib/controllers/services/simkl/simkl_service.dart, lib/screens/manga/widgets/reader/themes/reader_control_themes/ios_reader_control_theme.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/online/anime_list.dart:828 — `_searchQuery.isNotEmpty || _selectedGenres.isNotEmpty` appears character-identically in 3 files — lib/screens/library/online/anime_list.dart, lib/screens/library/online/manga_list.dart, lib/screens/profile/widgets/user_media_list_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/screens/library/online/anime_list.dart:778 — `_tabController == null || _tabController!.length != orderedTabs.length` appears character-identically in 2 files — lib/screens/library/online/anime_list.dart, lib/screens/library/online/manga_list.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/community/community_recommendations_page.dart:151 — `anilistId == null && malId == null && simklId == null` appears character-identically in 3 files — lib/screens/community/community_recommendations_page.dart, lib/widgets/media_items/media_peek_popup.dart, lib/widgets/non_widgets/reasons_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/controllers/services/anilist/anilist_auth.dart:105 — `apiMessage != null && apiMessage.isNotEmpty` appears character-identically in 2 files — lib/controllers/services/anilist/anilist_auth.dart, lib/controllers/services/anilist/anilist_error_handler.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/anime/details/media_details_page.dart:1214 — `auth.isLoggedIn.value && auth.serviceType.value != ServicesType.extensions` appears character-identically in 5 files — lib/screens/anime/details/media_details_page.dart, lib/screens/anime/widgets/episode_list_builder.dart, lib/screens/anime/widgets/episode_watch_screen.dart, lib/screens/novel/details/widgets/chapter_item.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/services/widgets/widgets_builders.dart:422 — `avatarUrl != null && avatarUrl!.isNotEmpty` appears character-identically in 6 files — lib/controllers/services/widgets/widgets_builders.dart, lib/controllers/sync/progress_sync_section.dart, lib/screens/community/community_recommendations_page.dart, lib/screens/community/user_recommendations_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.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×19
  • Interpolated log message defeats structured logging repo/update_source.py:120 — `exception` at line 120 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:123 — `exception` at line 123 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:162 — `exception` at line 162 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:175 — `info` at line 175 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:196 — `info` at line 196 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:239 — `warning` at line 239 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:289 — `info` at line 289 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:315 — `info` at line 315 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:328 — `info` at line 328 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:353 — `exception` at line 353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:356 — `exception` at line 356 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:372 — `warning` at line 372 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:390 — `warning` at line 390 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:445 — `exception` at line 445 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:460 — `info` at line 460 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:468 — `info` at line 468 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:470 — `exception` at line 470 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:493 — `info` at line 493 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging repo/update_source.py:496 — `exception` at line 496 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×15
  • Hand-rolled JSON/XML parsing via regex package_manager.dart:134 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex package_manager.dart:148 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex package_manager.dart:154 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex package_manager.dart:163 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/widgets/non_widgets/activity_card.dart:930 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/utils/al_about_me.dart:44 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/utils/al_about_me.dart:53 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/utils/al_about_me.dart:79 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/utils/al_about_me.dart:156 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/utils/al_about_me.dart:293 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/utils/anime_adaptation_util.dart:139 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/utils/anime_adaptation_util.dart:141 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/screens/novel/reader/controller/reader_controller.dart:482 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/screens/novel/reader/controller/reader_controller.dart:916 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/screens/novel/reader/controller/reader_controller.dart:919 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
X7 · Silent fallback defaults · Silent fallback default in catch · ×10
  • Silent fallback default in catch lib/controllers/custom_logo/custom_logo_service.dart:40 — `getSelectedCustomLogoId` turns every thrown error into `''` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/controllers/services/backup_restore/backup_restore_service.dart:443 — `getExtensionsDataCount` 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.
  • Silent fallback default in catch lib/controllers/services/backup_restore/parsers/kotatsu_backup_parser.dart:254 — `_readJsonSection` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/screens/anime/widgets/comments/controller/comments_controller.dart:511 — `formatCommentTimestamp` turns every thrown error into `''` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/screens/anime/widgets/comments/widgets/user_comments_sheet.dart:979 — `_until` turns every thrown error into `'active'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/screens/extensions/widgets/plugin_manager.dart:196 — `fetchReleases` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/screens/local_source/controller/local_source_controller.dart:465 — `getFileSize` turns every thrown error into `'Unknown'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/utils/anime_adaptation_util.dart:58 — `getAnimeNews` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/utils/external_font_loader.dart:273 — `getCustomFontNames` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/utils/watch_order_util.dart:183 — `fetchWatchOrder` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
D34 · Knowledge Freshness · Orphaned file · ×8
  • Orphaned file lib/screens/novel/reader/widgets/dictionary_popup.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file lib/utils/lanczos_image.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file lib/screens/news/news_page.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file lib/utils/anime_themes_api.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file lib/models/Media/staff.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file lib/models/animethemes/anime_theme.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file lib/utils/subtitle_translator.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file lib/screens/manga/widgets/reader/reader_color_overlay.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
AX6 · Interface segregation · Fat interface · ×4
  • Fat interface: BasePlayer (32 abstract methods) lib/screens/anime/watch/player/base_player.dart:5 — `BasePlayer` declares 32 abstract methods: `positionStream`, `durationStream`, `bufferStream`, `playingStream`, `bufferingStream`, `tracksStream`, `rateStream`, `errorStream`, `subtitleStream`, `heightStream`, `completedStream`, `state`, `initialize`, `open`, `seek`, `play`, `pause`, `stop`, `playOrPause`, `setRate`, `setVolume`, `setVideoTrack`, `setAudioTrack`, `setSubtitleTrack`, `setSubtitleDelay`, `setAudioDelay`, `setAudioChannelLayout`, `toggleVideoFit`, `screenshot`, `dispose`, `getVideoWidget`, `setHardwareDecoding`. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. 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.
  • Fat interface: RustLibApi (28 abstract methods) packages/rhttp/lib/src/rust/frb_generated.dart:88 — `RustLibApi` declares 28 abstract methods: `crateApiStreamDart2RustStreamSinkAdd`, `crateApiStreamDart2RustStreamSinkClose`, `crateApiHttpCancelRequest`, `crateApiHttpCancelRunningRequests`, `crateApiClientClientSettingsDefault`, `crateApiClientCreateDynamicResolverSync`, `crateApiClientCreateStaticResolverSync`, `crateApiStreamCreateStream`, `crateApiInitInitApp`, `crateApiHttpMakeHttpRequest`, `crateApiHttpMakeHttpRequestReceiveStream`, `crateApiHttpRegisterClient`, `crateApiHttpRegisterClientSync`, `rust_arc_increment_strong_count_CancellationToken`, `rust_arc_decrement_strong_count_CancellationToken`, `rust_arc_decrement_strong_count_CancellationTokenPtr`, `rust_arc_increment_strong_count_Dart2RustStreamReceiver`, `rust_arc_decrement_strong_count_Dart2RustStreamReceiver`, `rust_arc_decrement_strong_count_Dart2RustStreamReceiverPtr`, `rust_arc_increment_strong_count_Dart2RustStreamSink`, `rust_arc_decrement_strong_count_Dart2RustStreamSink`, `rust_arc_decrement_strong_count_Dart2RustStreamSinkPtr`, `rust_arc_increment_strong_count_DnsSettings`, `rust_arc_decrement_strong_count_DnsSettings`, `rust_arc_decrement_strong_count_DnsSettingsPtr`, `rust_arc_increment_strong_count_RequestClient`, `rust_arc_decrement_strong_count_RequestClient`, `rust_arc_decrement_strong_count_RequestClientPtr`. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. 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.
  • Fat interface: RustLibApiImplPlatform (302 abstract methods) packages/rhttp/lib/src/rust/frb_generated.io.dart:17 — `RustLibApiImplPlatform` declares 302 abstract methods: `dco_decode_AnyhowException`, `dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Chrono_Duration`, `dco_decode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken_Output_unit_AnyhowException`, `dco_decode_DartFn_Inputs_String_Output_list_String_AnyhowException`, `dco_decode_DartFn_Inputs_http_response_Output_unit_AnyhowException`, `dco_decode_DartFn_Inputs_rhttp_error_Output_unit_AnyhowException`, `dco_decode_DartOpaque`, `dco_decode_Map_String_String_None`, `dco_decode_Map_String_list_String_None`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_StreamSink_list_prim_u_8_strict_Sse`, `dco_decode_String`, `dco_decode_bool`, `dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_box_autoadd_Chrono_Duration`, `dco_decode_box_autoadd_client_certificate`, `dco_decode_box_autoadd_client_settings`, `dco_decode_box_autoadd_cookie_settings`, `dco_decode_box_autoadd_http_body`, `dco_decode_box_autoadd_http_headers`, `dco_decode_box_autoadd_http_method`, `dco_decode_box_autoadd_http_response_body`, `dco_decode_box_autoadd_multipart_payload`, `dco_decode_box_autoadd_proxy_settings`, `dco_decode_box_autoadd_redirect_settings`, `dco_decode_box_autoadd_static_dns_settings`, and 262 more. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. 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.
  • Fat interface: RustLibApiImplPlatform (302 abstract methods) packages/rhttp/lib/src/rust/frb_generated.web.dart:19 — `RustLibApiImplPlatform` declares 302 abstract methods: `dco_decode_AnyhowException`, `dco_decode_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_Chrono_Duration`, `dco_decode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken_Output_unit_AnyhowException`, `dco_decode_DartFn_Inputs_String_Output_list_String_AnyhowException`, `dco_decode_DartFn_Inputs_http_response_Output_unit_AnyhowException`, `dco_decode_DartFn_Inputs_rhttp_error_Output_unit_AnyhowException`, `dco_decode_DartOpaque`, `dco_decode_Map_String_String_None`, `dco_decode_Map_String_list_String_None`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient`, `dco_decode_StreamSink_list_prim_u_8_strict_Sse`, `dco_decode_String`, `dco_decode_bool`, `dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver`, `dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings`, `dco_decode_box_autoadd_Chrono_Duration`, `dco_decode_box_autoadd_client_certificate`, `dco_decode_box_autoadd_client_settings`, `dco_decode_box_autoadd_cookie_settings`, `dco_decode_box_autoadd_http_body`, `dco_decode_box_autoadd_http_headers`, `dco_decode_box_autoadd_http_method`, `dco_decode_box_autoadd_http_response_body`, `dco_decode_box_autoadd_multipart_payload`, `dco_decode_box_autoadd_proxy_settings`, `dco_decode_box_autoadd_redirect_settings`, `dco_decode_box_autoadd_static_dns_settings`, and 262 more. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. 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.
IC1 · Incompleteness & stubs · Member throws UnsupportedError · ×2
  • Member throws UnsupportedError packages/rhttp/lib/src/client/io/io_response.dart:38 — `detachSocket`'s body only throws an UnsupportedError or an UnimplementedError that gives its reason — sometimes a deliberate refusal, often an unfinished stub. Confirm it's intentional.
  • Member throws UnsupportedError packages/rhttp/lib/src/client/io/io_response.dart:77 — `redirect`'s body only throws an UnsupportedError or an UnimplementedError that gives its reason — sometimes a deliberate refusal, often an unfinished stub. Confirm it's intentional.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example packages/rhttp/cargokit/build_tool/README.md:1 — `build_tool` is runnable (`executables:` or `bin/` in its pub package) and neither `packages/rhttp/cargokit/build_tool/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found packages/rhttp/cargokit/build_tool/bin/build_tool.dart:6 — 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/`. ADRs are expected here because `packages/rhttp/cargokit/build_tool/bin/build_tool.dart` makes this repository a deployable product (line 6).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion pubspec.yaml:1 — `(repository root)` (238716 LoC, 944 module-visible types across 144 directories) overshoots its size bounds. 1 of 11 build unit(s) (Cargo, Gradle, Xcode, pub) overshoot their size bounds, lowering Project Cohesion to 8.2/10. 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
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 8 of 488 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 488 of the 638 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: lib/screens/novel/reader/widgets/dictionary_popup.dart, lib/utils/lanczos_image.dart, lib/screens/news/news_page.dart, lib/utils/anime_themes_api.dart, lib/models/Media/staff.dart, lib/models/animethemes/anime_theme.dart, lib/utils/subtitle_translator.dart, lib/screens/manga/widgets/reader/reader_color_overlay.dart. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×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.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P10 · Library API & versioning · Implementation type on the public API · ×1
  • Implementation type on the public API packages/rhttp/lib/src/rust/frb_generated.dart:201 — 6 public types in `repository.src` are marked as implementation by their own namespace, folder or name: `RustLibApiImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:201, name ends in `Impl`), `CancellationTokenImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4190, name ends in `Impl`), `Dart2RustStreamReceiverImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4214, name ends in `Impl`), `Dart2RustStreamSinkImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4243, name ends in `Impl`), `DnsSettingsImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4280, name ends in `Impl`), `RequestClientImpl` (packages/rhttp/lib/src/rust/frb_generated.dart:4300, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 4/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `ios`, `macos`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:4 — No static application security testing detected. For this repository's stack, add the Dart analyzer's security lints plus `semgrep --config=auto` as a CI step. What was searched, so you can tell an absence from a miss: the 10 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation packages/rhttp/rust/Cargo.toml:9 — `packages/rhttp/rust/Cargo.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
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.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected firebase.json:1 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `firebase.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository runs an HTTP server that is not bound to the loopback interface alone — or binds it at an address its source does not spell out — and nothing in its Dart source secures the transport: no `HttpServer.bindSecure` or `securityContext:`, no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: lib/services/cast/cast_proxy_server.dart:29 — `HttpServer.bind(`.
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/5 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.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×1
  • Diagnostic log message is built whether or not it is wanted packages/rhttp/cargokit/build_tool/lib/src/util.dart:109 — `finer` at line 109 is called with an argument built by `arguments.join('…')` (line 109), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because finer is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-2ba90672f4224c13a397e96e1abc2516/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-2ba90672f4224c13a397e96e1abc2516/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=1418" --report-format json --report-path /tmp/watchdog-gitleaks-2ba90672f4224c13a397e96e1abc2516/history-2.json --exit-code 0 --source .14artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-2ba90672f4224c13a397e96e1abc2516/tree.json --exit-code 0 --source .6artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude lib/controllers/services/backup_restore/proto --exclude packages/flutter_iconly/lib/src --exclude packages/rhttp/lib/src/rust .53artifacts/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 . /tmp/codehealth-osv-sbom-6a9ed9fadb6e4878b180a29c6234e71e0artifacts/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) — `packages/rhttp/android/settings.gradle.kts` — 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 . /tmp/codehealth-osv-sbom-6a9ed9fadb6e4878b180a29c6234e71e0artifacts/raw/osv-scanner.json

Run 01a1ebaa-d3b9-79a0-99e7-2a13ad01ea43 · 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