Public report of AimesSoft/NipaPlay-Reload, 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 reportMeasured 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, 19:35 UTC · Survey ID cd_bdf79420920846289320ecb36b34172b
AimesSoft/NipaPlay-Reload
Measured 17 November 2026, 19:33 UTC, at code version bdb4fc6
CAI scoreAt riskUp 2.7 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 455,951 lines of product code in 39 projects, tests not counted · Estimated rebuild effort: about 3.5 person-years · Weakest lens: Security and Compliance, 50.4
Findings by how serious they are
150 critical3012 serious166 minor
14 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 19:33 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
69of 69 dimensions measured by tools.
3310of 3328 findings point to an exact file and line, so you can open each one in the code. The other 18 concern the repository as a whole, such as missing documentation.
69dimensions across 7 lenses, read from 455,951 lines of product code in 39 projects.
AimesSoft/NipaPlay-Reload is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because two of the dependencies have a known vulnerability and it has pipeline tools referenced by a changeable name. It scores 55.4 out of 100, which the At risk rating leaves unchanged.
Security and Compliance, at 50.4, is the weakest lens and counts most in the score. The best first step for the work it takes is adding a reporting contact to the security policy, worth about 2.4 points. Replacing the weak hashes comes next, worth about 3.5 points. Raising Security and Compliance to 70 would lift the score to about 58.9.
Eighty-five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Twenty known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version and updating the vulnerable packages would close both risks. Passing outside input through environment variables would fix the 17 pipeline steps that put outside input straight into a shell command, and the six unsafe settings in infrastructure or container files need changing to safe values. The 13 sets of files in separate parts that keep changing together need that dependency made explicit.
The product code is 455,951 lines, about €500,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 forThe 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.
If Security and Compliance rose from 50.4 to 70, the lowest score rated Strong, the score would rise from 55.4 to about 58.9.
Code composition: what the lines of code are
Product code 91%Tests 9%
New since the last survey: 470 findings
These 470 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.
Code Duplication · Near-duplicate member family (4 members, 45 shared lines) lib/services/remote_subtitle_service.dart
Code Duplication · Near-duplicate member pair (68 shared lines) lib/services/dandanplay_service_io.dart
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/pages/media_server_detail_page.dart
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/pages/new_series_page.dart
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/pages/new_series_page.dart
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/providers/shared_remote_library_provider.dart
Code Duplication · Edited copy of a member (431 corresponding lines) lib/themes/nipaplay/widgets/danmaku_list_menu.dart
Code Duplication · Edited copy of a member (139 corresponding lines) lib/player_abstraction/media_kit_player_adapter.dart
Code Duplication · Edited copy of a member (139 corresponding lines) lib/themes/nipaplay/widgets/emby_library_card.dart
Code Duplication · Edited copy of a member (118 corresponding lines) lib/settings/pages/plugin_settings_content.dart
Code Duplication · Edited copy of a member (76 corresponding lines) rust/src/api/file_scan.rs
Code Duplication · Edited copy of a member (92 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (85 corresponding lines) lib/services/local_media_management_api.dart
Code Duplication · Edited copy of a member (72 corresponding lines) lib/services/local_media_share_service.dart
Code Duplication · Edited copy of a member (96 corresponding lines) lib/services/emby_dandanplay_matcher.dart
Code Duplication · Edited copy of a member (84 corresponding lines) lib/services/emby_service.dart
Code Duplication · Edited copy of a member (66 corresponding lines) lib/services/shared_remote_playback_sync_service.dart
Code Duplication · Edited copy of a member (71 corresponding lines) lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart
Code Duplication · Edited copy of a member (73 corresponding lines) lib/themes/nipaplay/widgets/local_library_control_bar.dart
Code Duplication · Edited copy of a member (50 corresponding lines) rust/src/next2_engine/engine/renderer_draw.rs
Code Duplication · Edited copy of a member (56 corresponding lines) lib/services/episode_navigation_service.dart
Code Duplication · Edited copy of a member (70 corresponding lines) lib/themes/nipaplay/widgets/modern_video_controls.dart
Code Duplication · Edited copy of a member (69 corresponding lines) lib/services/local_media_share_api.dart
Code Duplication · Edited copy of a member (67 corresponding lines) lib/services/dandanplay_service_stub.dart
Code Duplication · Edited copy of a member (59 corresponding lines) lib/services/remote_control_client_service.dart
Code Duplication · Edited copy of a member (59 corresponding lines) lib/services/remote_subtitle_service.dart
Code Duplication · Edited copy of a member (63 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (62 corresponding lines) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart
Code Duplication · Edited copy of a member (47 corresponding lines) lib/services/dandanplay_service_io.dart
Code Duplication · Edited copy of a member (52 corresponding lines) lib/services/smb_proxy_service.dart
Code Duplication · Edited copy of a member (44 corresponding lines) lib/services/playback_source_service.dart
Code Duplication · Edited copy of a member (53 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart
Code Duplication · Edited copy of a member (63 corresponding lines) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart
Code Duplication · Edited copy of a member (54 corresponding lines) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart
Code Duplication · Edited copy of a member (60 corresponding lines) lib/pages/dashboard_home_page.dart
Code Duplication · Edited copy of a member (58 corresponding lines) lib/themes/nipaplay/pages/settings/backup_restore_page.dart
Code Duplication · Edited copies of one member (4 members, 50+ corresponding lines) lib/services/dandanplay_service_io.dart
Code Duplication · Edited copy of a member (35 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart
Code Duplication · Edited copies of one member (3 members, 43+ corresponding lines) lib/themes/nipaplay/widgets/lock_controls_button.dart
Code Duplication · Edited copy of a member (52 corresponding lines) lib/settings/pages/developer_options_settings_content.dart
Code Duplication · Edited copy of a member (43 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (41 corresponding lines) lib/services/playback_source_service.dart
Code Duplication · Edited copy of a member (57 corresponding lines) lib/themes/nipaplay/widgets/network_media_library_view.dart
Code Duplication · Edited copy of a member (43 corresponding lines) lib/services/emby_service.dart
Code Duplication · Edited copy of a member (41 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (53 corresponding lines) lib/utils/watch_history_auto_match_helper.dart
Code Duplication · Edited copy of a member (38 corresponding lines) lib/services/dandanplay_service_io.dart
Code Duplication · Edited copy of a member (63 corresponding lines) lib/services/file_picker_service.dart
Code Duplication · Edited copy of a member (43 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (40 corresponding lines) lib/services/local_media_management_api.dart
Code Duplication · Edited copy of a member (44 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (29 corresponding lines) lib/pages/anime_detail_page.dart
Code Duplication · Edited copies of one member (3 members, 38+ corresponding lines) lib/services/remote_subtitle_service.dart
Code Duplication · Edited copy of a member (45 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart
Code Duplication · Edited copy of a member (62 corresponding lines) lib/settings/pages/network_settings_content.dart
Code Duplication · Edited copy of a member (41 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart
Code Duplication · Edited copy of a member (39 corresponding lines) lib/themes/nipaplay/widgets/playback_info_menu.dart
Code Duplication · Edited copy of a member (48 corresponding lines) lib/services/dandanplay_service_io.dart
Code Duplication · Edited copy of a member (35 corresponding lines) lib/services/emby_dandanplay_matcher.dart
Code Duplication · Edited copy of a member (40 corresponding lines) lib/services/external_player_console_window_service.dart
Code Duplication · Edited copy of a member (39 corresponding lines) lib/themes/cupertino/widgets/cupertino_player_menu.dart
Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart
Code Duplication · Edited copy of a member (40 corresponding lines) lib/models/watch_history_model.dart
Code Duplication · Edited copy of a member (40 corresponding lines) lib/services/emby_dandanplay_matcher.dart
Code Duplication · Edited copy of a member (44 corresponding lines) lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart
Code Duplication · Edited copy of a member (45 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart
Code Duplication · Edited copy of a member (45 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (33 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copy of a member (42 corresponding lines) lib/models/external_player_session/mpv_session.dart
Code Duplication · Edited copies of one member (3 members, 43+ corresponding lines) lib/models/watch_history_model.dart
Code Duplication · Edited copy of a member (37 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart
Code Duplication · Edited copy of a member (37 corresponding lines) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart
Code Duplication · Edited copy of a member (28 corresponding lines) lib/services/emby_service.dart
Code Duplication · Edited copy of a member (31 corresponding lines) lib/themes/nipaplay/widgets/large_screen_mode_actions.dart
Code Duplication · Edited copy of a member (30 corresponding lines) lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart
Code Duplication · Edited copy of a member (42 corresponding lines) lib/services/file_picker_service.dart
Code Duplication · Edited copy of a member (36 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart
Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart
Code Duplication · Edited copies of one member (4 members, 38+ corresponding lines) lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart
Code Duplication · Edited copy of a member (33 corresponding lines) lib/models/watch_history_model.dart
Code Duplication · Edited copy of a member (33 corresponding lines) lib/themes/nipaplay/widgets/plugin_market_dialog.dart
Code Duplication · Edited copy of a member (30 corresponding lines) lib/themes/nipaplay/pages/settings/watch_history_page.dart
Code Duplication · Edited copy of a member (34 corresponding lines) lib/themes/nipaplay/widgets/playback_rate_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: 562 findings
These 562 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.
€170,000 to €840,000, for 2,794 to 8,865 hours of work, about 3.5 person-years for 2 to 7 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 55. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 455,951 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 REDACTED finding(s) in Vulnerability-disclosure Policy — start with REDACTED.
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.
This repository constructs a collision-broken hash (MD5/SHA1) at 21 sites, not one: `lib/player_abstraction/video_player_adapter.dart:703` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:756` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1052` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1605` (md5.convert(…)), `lib/services/dandanplay_service_stub.dart:672` (md5.convert(…)), `lib/services/file_picker_service.dart:364` (md5.convert(…)), `lib/services/local_media_share_service.dart:189` (sha1.convert(…)), `lib/services/remote_subtitle_service.dart:387` (sha1.convert(…)), and 13 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED (4).
Raises the score by about 1.5 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 €500,000 to build again, about 3.5 person-years of work. Its weakest lens is Security and Compliance, at 50.4 (Adequate). 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
Resolve the 1 REDACTED finding(s) in Vulnerability-disclosure Policy. Of all the actions in this report, it raises the score most for the work it takes: about 2.4 points for low effort, because it clears the 1 Vulnerability-disclosure Policy findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 113,968 lines over the last 90 days, which is about 462,204 lines a year. At that pace, the extra work comes to an estimated 73 to 437.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.
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.
101 modules, with 109 dependencies between them. 2 loops run through 19 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 61 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
librqbit_dualstack_sockets.connect uses librqbit_dualstack_sockets.bind_device, so a change to librqbit_dualstack_sockets.bind_device can break librqbit_dualstack_sockets.connect, while a change to librqbit_dualstack_sockets.connect can't break librqbit_dualstack_sockets.bind_device.
Position
Below the diagonal: librqbit_dualstack_sockets.connect uses a module listed above it, which is the healthy direction.
librqbit_dualstack_sockets.multicast uses librqbit_dualstack_sockets.bind_device, so a change to librqbit_dualstack_sockets.bind_device can break librqbit_dualstack_sockets.multicast, while a change to librqbit_dualstack_sockets.multicast can't break librqbit_dualstack_sockets.bind_device.
Position
Below the diagonal: librqbit_dualstack_sockets.multicast uses a module listed above it, which is the healthy direction.
librqbit_dualstack_sockets.socket uses librqbit_dualstack_sockets.bind_device, so a change to librqbit_dualstack_sockets.bind_device can break librqbit_dualstack_sockets.socket, while a change to librqbit_dualstack_sockets.socket can't break librqbit_dualstack_sockets.bind_device.
Position
Below the diagonal: librqbit_dualstack_sockets.socket uses a module listed above it, which is the healthy direction.
repository.app uses repository.l10n, so a change to repository.l10n can break repository.app, while a change to repository.app can't break repository.l10n.
Position
Below the diagonal: repository.app uses a module listed above it, which is the healthy direction.
13→34 repository.plugins uses repository.utilspart of a loop✕
Connections
1 pair of types, where a type in repository.plugins uses a type in repository.utils.
repository.plugins uses repository.utils, so a change to repository.utils can break repository.plugins, while a change to repository.plugins can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.src uses repository.l10n, so a change to repository.l10n can break repository.src, while a change to repository.src can't break repository.l10n.
Position
Below the diagonal: repository.src uses a module listed above it, which is the healthy direction.
repository.src uses repository.types, so a change to repository.types can break repository.src, while a change to repository.src can't break repository.types.
Position
Below the diagonal: repository.src uses a module listed above it, which is the healthy direction.
14→34 repository.src uses repository.utilspart of a loop✕
Connections
1 pair of types, where a type in repository.src uses a type in repository.utils.
repository.src uses repository.utils, so a change to repository.utils can break repository.src, while a change to repository.src can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rust_lib_nipaplay.next2_engine.engine.command_channel.win uses rust_lib_nipaplay.dfm_core.model, so a change to rust_lib_nipaplay.dfm_core.model can break rust_lib_nipaplay.next2_engine.engine.command_channel.win, while a change to rust_lib_nipaplay.next2_engine.engine.command_channel.win can't break rust_lib_nipaplay.dfm_core.model.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.command_channel.win uses a module listed above it, which is the healthy direction.
rust_lib_nipaplay.next2_engine.engine.motion uses rust_lib_nipaplay.dfm_core.model, so a change to rust_lib_nipaplay.dfm_core.model can break rust_lib_nipaplay.next2_engine.engine.motion, while a change to rust_lib_nipaplay.next2_engine.engine.motion can't break rust_lib_nipaplay.dfm_core.model.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.motion uses a module listed above it, which is the healthy direction.
rust_lib_nipaplay.next2_engine.present uses rust_lib_nipaplay.next2_engine.engine.frame_completion, so a change to rust_lib_nipaplay.next2_engine.engine.frame_completion can break rust_lib_nipaplay.next2_engine.present, while a change to rust_lib_nipaplay.next2_engine.present can't break rust_lib_nipaplay.next2_engine.engine.frame_completion.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.present uses a module listed above it, which is the healthy direction.
repository.media_kit_video_controls uses repository.src, so a change to repository.src can break repository.media_kit_video_controls, while a change to repository.media_kit_video_controls can't break repository.src.
Position
Below the diagonal: repository.media_kit_video_controls uses a module listed above it, which is the healthy direction.
repository.media_library uses repository.app, so a change to repository.app can break repository.media_library, while a change to repository.media_library can't break repository.app.
Position
Below the diagonal: repository.media_library uses a module listed above it, which is the healthy direction.
19→32 repository.media_library uses repository.themespart of a loop✕
Connections
2 pairs of types, where a type in repository.media_library uses a type in repository.themes.
repository.media_library uses repository.themes, so a change to repository.themes can break repository.media_library, while a change to repository.media_library can't break repository.themes.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→37 repository.media_library uses repository.modelspart of a loop✕
Connections
3 pairs of types, where a type in repository.media_library uses a type in repository.models.
repository.media_library uses repository.models, so a change to repository.models can break repository.media_library, while a change to repository.media_library can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.player_abstraction uses repository.src, so a change to repository.src can break repository.player_abstraction, while a change to repository.player_abstraction can't break repository.src.
Position
Below the diagonal: repository.player_abstraction uses a module listed above it, which is the healthy direction.
repository.theme uses repository.types, so a change to repository.types can break repository.theme, while a change to repository.theme can't break repository.types.
Position
Below the diagonal: repository.theme uses a module listed above it, which is the healthy direction.
repository.theme uses repository.src, so a change to repository.src can break repository.theme, while a change to repository.theme can't break repository.src.
Position
Below the diagonal: repository.theme uses a module listed above it, which is the healthy direction.
rust_lib_nipaplay.next2_engine.engine.command_channel uses rust_lib_nipaplay.dfm_core.model, so a change to rust_lib_nipaplay.dfm_core.model can break rust_lib_nipaplay.next2_engine.engine.command_channel, while a change to rust_lib_nipaplay.next2_engine.engine.command_channel can't break rust_lib_nipaplay.dfm_core.model.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.command_channel uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in rust_lib_nipaplay.next2_engine.engine.command_channel uses a type in rust_lib_nipaplay.next2_engine.engine.command_channel.win.
rust_lib_nipaplay.next2_engine.engine.command_channel uses rust_lib_nipaplay.next2_engine.engine.command_channel.win, so a change to rust_lib_nipaplay.next2_engine.engine.command_channel.win can break rust_lib_nipaplay.next2_engine.engine.command_channel, while a change to rust_lib_nipaplay.next2_engine.engine.command_channel can't break rust_lib_nipaplay.next2_engine.engine.command_channel.win.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.command_channel uses a module listed above it, which is the healthy direction.
repository.player_menu uses repository.player_abstraction, so a change to repository.player_abstraction can break repository.player_menu, while a change to repository.player_menu can't break repository.player_abstraction.
Position
Below the diagonal: repository.player_menu uses a module listed above it, which is the healthy direction.
23→34 repository.player_menu uses repository.utilspart of a loop✕
Connections
3 pairs of types, where a type in repository.player_menu uses a type in repository.utils.
repository.player_menu uses repository.utils, so a change to repository.utils can break repository.player_menu, while a change to repository.player_menu can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.widgets uses repository.danmaku_abstraction, so a change to repository.danmaku_abstraction can break repository.widgets, while a change to repository.widgets can't break repository.danmaku_abstraction.
Position
Below the diagonal: repository.widgets uses a module listed above it, which is the healthy direction.
repository.widgets uses repository.types, so a change to repository.types can break repository.widgets, while a change to repository.widgets can't break repository.types.
Position
Below the diagonal: repository.widgets uses a module listed above it, which is the healthy direction.
53 pairs of types, where a type in repository.widgets uses a type in repository.src. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository.widgets uses repository.src, so a change to repository.src can break repository.widgets, while a change to repository.widgets can't break repository.src.
Position
Below the diagonal: repository.widgets uses a module listed above it, which is the healthy direction.
repository.widgets uses repository.theme, so a change to repository.theme can break repository.widgets, while a change to repository.widgets can't break repository.theme.
Position
Below the diagonal: repository.widgets uses a module listed above it, which is the healthy direction.
24→26 repository.widgets uses repository.servicespart of a loop✕
Connections
2 pairs of types, where a type in repository.widgets uses a type in repository.services.
repository.widgets uses repository.services, so a change to repository.services can break repository.widgets, while a change to repository.widgets can't break repository.services.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→33 repository.widgets uses repository.providerspart of a loop✕
Connections
1 pair of types, where a type in repository.widgets uses a type in repository.providers.
repository.widgets uses repository.providers, so a change to repository.providers can break repository.widgets, while a change to repository.widgets can't break repository.providers.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→34 repository.widgets uses repository.utilspart of a loop✕
Connections
14 pairs of types, where a type in repository.widgets uses a type in repository.utils.
repository.widgets uses repository.utils, so a change to repository.utils can break repository.widgets, while a change to repository.widgets can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→37 repository.widgets uses repository.modelspart of a loop✕
Connections
6 pairs of types, where a type in repository.widgets uses a type in repository.models.
repository.widgets uses repository.models, so a change to repository.models can break repository.widgets, while a change to repository.widgets can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rust_lib_nipaplay.next2_engine.engine.runtime uses rust_lib_nipaplay.next2_engine.engine.frame_completion, so a change to rust_lib_nipaplay.next2_engine.engine.frame_completion can break rust_lib_nipaplay.next2_engine.engine.runtime, while a change to rust_lib_nipaplay.next2_engine.engine.runtime can't break rust_lib_nipaplay.next2_engine.engine.frame_completion.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.runtime uses a module listed above it, which is the healthy direction.
rust_lib_nipaplay.next2_engine.engine.runtime uses rust_lib_nipaplay.next2_engine.engine.command_channel, so a change to rust_lib_nipaplay.next2_engine.engine.command_channel can break rust_lib_nipaplay.next2_engine.engine.runtime, while a change to rust_lib_nipaplay.next2_engine.engine.runtime can't break rust_lib_nipaplay.next2_engine.engine.command_channel.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.runtime uses a module listed above it, which is the healthy direction.
25→27 rust_lib_nipaplay.next2_engine.engine.runtime uses rust_lib_nipaplay.next2_engine.engine.renderingpart of a loop✕
Connections
1 pair of types, where a type in rust_lib_nipaplay.next2_engine.engine.runtime uses a type in rust_lib_nipaplay.next2_engine.engine.rendering.
rust_lib_nipaplay.next2_engine.engine.runtime uses rust_lib_nipaplay.next2_engine.engine.rendering, so a change to rust_lib_nipaplay.next2_engine.engine.rendering can break rust_lib_nipaplay.next2_engine.engine.runtime, while a change to rust_lib_nipaplay.next2_engine.engine.runtime can't break rust_lib_nipaplay.next2_engine.engine.rendering.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.services uses repository.src, so a change to repository.src can break repository.services, while a change to repository.services can't break repository.src.
Position
Below the diagonal: repository.services uses a module listed above it, which is the healthy direction.
repository.services uses repository.widgets, so a change to repository.widgets can break repository.services, while a change to repository.services can't break repository.widgets.
Position
Below the diagonal: repository.services uses a module listed above it, which is the healthy direction.
26→33 repository.services uses repository.providerspart of a loop✕
Connections
2 pairs of types, where a type in repository.services uses a type in repository.providers.
repository.services uses repository.providers, so a change to repository.providers can break repository.services, while a change to repository.services can't break repository.providers.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26→34 repository.services uses repository.utilspart of a loop✕
Connections
11 pairs of types, where a type in repository.services uses a type in repository.utils.
repository.services uses repository.utils, so a change to repository.utils can break repository.services, while a change to repository.services can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26→37 repository.services uses repository.modelspart of a loop✕
Connections
83 pairs of types, where a type in repository.services uses a type in repository.models. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository.services uses repository.models, so a change to repository.models can break repository.services, while a change to repository.services can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rust_lib_nipaplay.next2_engine.engine.rendering uses rust_lib_nipaplay.next2_engine.engine.motion, so a change to rust_lib_nipaplay.next2_engine.engine.motion can break rust_lib_nipaplay.next2_engine.engine.rendering, while a change to rust_lib_nipaplay.next2_engine.engine.rendering can't break rust_lib_nipaplay.next2_engine.engine.motion.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.rendering uses a module listed above it, which is the healthy direction.
rust_lib_nipaplay.next2_engine.engine.rendering uses rust_lib_nipaplay.next2_engine.present, so a change to rust_lib_nipaplay.next2_engine.present can break rust_lib_nipaplay.next2_engine.engine.rendering, while a change to rust_lib_nipaplay.next2_engine.engine.rendering can't break rust_lib_nipaplay.next2_engine.present.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.rendering uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in rust_lib_nipaplay.next2_engine.engine.rendering uses a type in rust_lib_nipaplay.next2_engine.engine.command_channel.
rust_lib_nipaplay.next2_engine.engine.rendering uses rust_lib_nipaplay.next2_engine.engine.command_channel, so a change to rust_lib_nipaplay.next2_engine.engine.command_channel can break rust_lib_nipaplay.next2_engine.engine.rendering, while a change to rust_lib_nipaplay.next2_engine.engine.rendering can't break rust_lib_nipaplay.next2_engine.engine.command_channel.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.rendering uses a module listed above it, which is the healthy direction.
rust_lib_nipaplay.next2_engine.engine.rendering uses rust_lib_nipaplay.next2_engine.engine.runtime, so a change to rust_lib_nipaplay.next2_engine.engine.runtime can break rust_lib_nipaplay.next2_engine.engine.rendering, while a change to rust_lib_nipaplay.next2_engine.engine.rendering can't break rust_lib_nipaplay.next2_engine.engine.runtime.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.rendering uses a module listed above it, which is the healthy direction.
27→30 rust_lib_nipaplay.next2_engine.engine.rendering uses rust_lib_nipaplay.next2_engine.engine.framepart of a loop✕
Connections
2 pairs of types, where a type in rust_lib_nipaplay.next2_engine.engine.rendering uses a type in rust_lib_nipaplay.next2_engine.engine.frame.
rust_lib_nipaplay.next2_engine.engine.rendering uses rust_lib_nipaplay.next2_engine.engine.frame, so a change to rust_lib_nipaplay.next2_engine.engine.frame can break rust_lib_nipaplay.next2_engine.engine.rendering, while a change to rust_lib_nipaplay.next2_engine.engine.rendering can't break rust_lib_nipaplay.next2_engine.engine.frame.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.downloads uses repository.services, so a change to repository.services can break repository.downloads, while a change to repository.downloads can't break repository.services.
Position
Below the diagonal: repository.downloads uses a module listed above it, which is the healthy direction.
28→37 repository.downloads uses repository.modelspart of a loop✕
Connections
3 pairs of types, where a type in repository.downloads uses a type in repository.models.
repository.downloads uses repository.models, so a change to repository.models can break repository.downloads, while a change to repository.downloads can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.search uses repository.services, so a change to repository.services can break repository.search, while a change to repository.search can't break repository.services.
Position
Below the diagonal: repository.search uses a module listed above it, which is the healthy direction.
29→37 repository.search uses repository.modelspart of a loop✕
Connections
1 pair of types, where a type in repository.search uses a type in repository.models.
repository.search uses repository.models, so a change to repository.models can break repository.search, while a change to repository.search can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
rust_lib_nipaplay.next2_engine.engine.frame uses rust_lib_nipaplay.next2_engine.engine.rendering, so a change to rust_lib_nipaplay.next2_engine.engine.rendering can break rust_lib_nipaplay.next2_engine.engine.frame, while a change to rust_lib_nipaplay.next2_engine.engine.frame can't break rust_lib_nipaplay.next2_engine.engine.rendering.
Position
Below the diagonal: rust_lib_nipaplay.next2_engine.engine.frame uses a module listed above it, which is the healthy direction.
repository.pages uses repository.services, so a change to repository.services can break repository.pages, while a change to repository.pages can't break repository.services.
Position
Below the diagonal: repository.pages uses a module listed above it, which is the healthy direction.
repository.pages uses repository.downloads, so a change to repository.downloads can break repository.pages, while a change to repository.pages can't break repository.downloads.
Position
Below the diagonal: repository.pages uses a module listed above it, which is the healthy direction.
31→32 repository.pages uses repository.themespart of a loop✕
Connections
3 pairs of types, where a type in repository.pages uses a type in repository.themes.
repository.pages uses repository.themes, so a change to repository.themes can break repository.pages, while a change to repository.pages can't break repository.themes.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
31→33 repository.pages uses repository.providerspart of a loop✕
Connections
1 pair of types, where a type in repository.pages uses a type in repository.providers.
repository.pages uses repository.providers, so a change to repository.providers can break repository.pages, while a change to repository.pages can't break repository.providers.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
31→34 repository.pages uses repository.utilspart of a loop✕
Connections
3 pairs of types, where a type in repository.pages uses a type in repository.utils.
repository.pages uses repository.utils, so a change to repository.utils can break repository.pages, while a change to repository.pages can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
31→37 repository.pages uses repository.modelspart of a loop✕
Connections
20 pairs of types, where a type in repository.pages uses a type in repository.models.
repository.pages uses repository.models, so a change to repository.models can break repository.pages, while a change to repository.pages can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.themes uses repository.remote, so a change to repository.remote can break repository.themes, while a change to repository.themes can't break repository.remote.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.app, so a change to repository.app can break repository.themes, while a change to repository.themes can't break repository.app.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.src, so a change to repository.src can break repository.themes, while a change to repository.themes can't break repository.src.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.media_library, so a change to repository.media_library can break repository.themes, while a change to repository.themes can't break repository.media_library.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.player_abstraction, so a change to repository.player_abstraction can break repository.themes, while a change to repository.themes can't break repository.player_abstraction.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.player_menu, so a change to repository.player_menu can break repository.themes, while a change to repository.themes can't break repository.player_menu.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.widgets, so a change to repository.widgets can break repository.themes, while a change to repository.themes can't break repository.widgets.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.services, so a change to repository.services can break repository.themes, while a change to repository.themes can't break repository.services.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.downloads, so a change to repository.downloads can break repository.themes, while a change to repository.themes can't break repository.downloads.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.search, so a change to repository.search can break repository.themes, while a change to repository.themes can't break repository.search.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
repository.themes uses repository.pages, so a change to repository.pages can break repository.themes, while a change to repository.themes can't break repository.pages.
Position
Below the diagonal: repository.themes uses a module listed above it, which is the healthy direction.
32→33 repository.themes uses repository.providerspart of a loop✕
Connections
12 pairs of types, where a type in repository.themes uses a type in repository.providers.
repository.themes uses repository.providers, so a change to repository.providers can break repository.themes, while a change to repository.themes can't break repository.providers.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
32→34 repository.themes uses repository.utilspart of a loop✕
Connections
46 pairs of types, where a type in repository.themes uses a type in repository.utils. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository.themes uses repository.utils, so a change to repository.utils can break repository.themes, while a change to repository.themes can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
32→37 repository.themes uses repository.modelspart of a loop✕
Connections
48 pairs of types, where a type in repository.themes uses a type in repository.models. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository.themes uses repository.models, so a change to repository.models can break repository.themes, while a change to repository.themes can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
32→38 repository.themes uses repositorypart of a loop✕
Connections
3 pairs of types, where a type in repository.themes uses a type in repository.
repository.providers uses repository.constants, so a change to repository.constants can break repository.providers, while a change to repository.providers can't break repository.constants.
Position
Below the diagonal: repository.providers uses a module listed above it, which is the healthy direction.
repository.providers uses repository.app, so a change to repository.app can break repository.providers, while a change to repository.providers can't break repository.app.
Position
Below the diagonal: repository.providers uses a module listed above it, which is the healthy direction.
repository.providers uses repository.services, so a change to repository.services can break repository.providers, while a change to repository.providers can't break repository.services.
Position
Below the diagonal: repository.providers uses a module listed above it, which is the healthy direction.
repository.providers uses repository.themes, so a change to repository.themes can break repository.providers, while a change to repository.providers can't break repository.themes.
Position
Below the diagonal: repository.providers uses a module listed above it, which is the healthy direction.
33→34 repository.providers uses repository.utilspart of a loop✕
Connections
1 pair of types, where a type in repository.providers uses a type in repository.utils.
repository.providers uses repository.utils, so a change to repository.utils can break repository.providers, while a change to repository.providers can't break repository.utils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
33→37 repository.providers uses repository.modelspart of a loop✕
Connections
14 pairs of types, where a type in repository.providers uses a type in repository.models.
repository.providers uses repository.models, so a change to repository.models can break repository.providers, while a change to repository.providers can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.utils uses repository.constants, so a change to repository.constants can break repository.utils, while a change to repository.utils can't break repository.constants.
Position
Below the diagonal: repository.utils uses a module listed above it, which is the healthy direction.
repository.utils uses repository.danmaku_abstraction, so a change to repository.danmaku_abstraction can break repository.utils, while a change to repository.utils can't break repository.danmaku_abstraction.
Position
Below the diagonal: repository.utils uses a module listed above it, which is the healthy direction.
repository.utils uses repository.types, so a change to repository.types can break repository.utils, while a change to repository.utils can't break repository.types.
Position
Below the diagonal: repository.utils uses a module listed above it, which is the healthy direction.
repository.utils uses repository.plugins, so a change to repository.plugins can break repository.utils, while a change to repository.utils can't break repository.plugins.
Position
Below the diagonal: repository.utils uses a module listed above it, which is the healthy direction.
repository.utils uses repository.player_abstraction, so a change to repository.player_abstraction can break repository.utils, while a change to repository.utils can't break repository.player_abstraction.
Position
Below the diagonal: repository.utils uses a module listed above it, which is the healthy direction.
repository.utils uses repository.services, so a change to repository.services can break repository.utils, while a change to repository.utils can't break repository.services.
Position
Below the diagonal: repository.utils uses a module listed above it, which is the healthy direction.
repository.utils uses repository.providers, so a change to repository.providers can break repository.utils, while a change to repository.utils can't break repository.providers.
Position
Below the diagonal: repository.utils uses a module listed above it, which is the healthy direction.
34→37 repository.utils uses repository.modelspart of a loop✕
Connections
5 pairs of types, where a type in repository.utils uses a type in repository.models.
repository.utils uses repository.models, so a change to repository.models can break repository.utils, while a change to repository.utils can't break repository.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
repository.danmaku_gpu uses repository.danmaku_abstraction, so a change to repository.danmaku_abstraction can break repository.danmaku_gpu, while a change to repository.danmaku_gpu can't break repository.danmaku_abstraction.
Position
Below the diagonal: repository.danmaku_gpu uses a module listed above it, which is the healthy direction.
repository.danmaku_gpu uses repository.utils, so a change to repository.utils can break repository.danmaku_gpu, while a change to repository.danmaku_gpu can't break repository.utils.
Position
Below the diagonal: repository.danmaku_gpu uses a module listed above it, which is the healthy direction.
repository.danmaku_next uses repository.danmaku_abstraction, so a change to repository.danmaku_abstraction can break repository.danmaku_next, while a change to repository.danmaku_next can't break repository.danmaku_abstraction.
Position
Below the diagonal: repository.danmaku_next uses a module listed above it, which is the healthy direction.
repository.danmaku_next uses repository.utils, so a change to repository.utils can break repository.danmaku_next, while a change to repository.danmaku_next can't break repository.utils.
Position
Below the diagonal: repository.danmaku_next uses a module listed above it, which is the healthy direction.
repository.models uses repository.constants, so a change to repository.constants can break repository.models, while a change to repository.models can't break repository.constants.
Position
Below the diagonal: repository.models uses a module listed above it, which is the healthy direction.
repository.models uses repository.utils, so a change to repository.utils can break repository.models, while a change to repository.models can't break repository.utils.
Position
Below the diagonal: repository.models uses a module listed above it, which is the healthy direction.
repository uses repository.services, so a change to repository.services can break repository, while a change to repository can't break repository.services.
Position
Below the diagonal: repository uses a module listed above it, which is the healthy direction.
repository.danmaku_dfm uses repository.utils, so a change to repository.utils can break repository.danmaku_dfm, while a change to repository.danmaku_dfm can't break repository.utils.
Position
Below the diagonal: repository.danmaku_dfm uses a module listed above it, which is the healthy direction.
repository.danmaku_dfm uses repository.danmaku_next, so a change to repository.danmaku_next can break repository.danmaku_dfm, while a change to repository.danmaku_dfm can't break repository.danmaku_next.
Position
Below the diagonal: repository.danmaku_dfm uses a module listed above it, which is the healthy direction.
repository.settings uses repository.constants, so a change to repository.constants can break repository.settings, while a change to repository.settings can't break repository.constants.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.danmaku_abstraction, so a change to repository.danmaku_abstraction can break repository.settings, while a change to repository.settings can't break repository.danmaku_abstraction.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.plugins, so a change to repository.plugins can break repository.settings, while a change to repository.settings can't break repository.plugins.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.player_abstraction, so a change to repository.player_abstraction can break repository.settings, while a change to repository.settings can't break repository.player_abstraction.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.services, so a change to repository.services can break repository.settings, while a change to repository.settings can't break repository.services.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.themes, so a change to repository.themes can break repository.settings, while a change to repository.settings can't break repository.themes.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.providers, so a change to repository.providers can break repository.settings, while a change to repository.settings can't break repository.providers.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.utils, so a change to repository.utils can break repository.settings, while a change to repository.settings can't break repository.utils.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
repository.settings uses repository.models, so a change to repository.models can break repository.settings, while a change to repository.settings can't break repository.models.
Position
Below the diagonal: repository.settings uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 60.2 · Adequate · gated by D2 ·
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 category
Findings
Severity
A05:2025 — Injection
118
High / Critical
A03:2025 — Software Supply Chain Failures
57
High / Critical
A02:2025 — Security Misconfiguration
17
High / Critical
A07:2025 — Authentication Failures
5
High / Critical
Roadmap
Top priorities: 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. This repository constructs a collision-broken hash (MD5/SHA1) at 21 sites, not one: `lib/player_abstraction/video_player_adapter.dart:703` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:756` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1052` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1605` (md5.convert(…)), `lib/services/dandanplay_service_stub.dart:672` (md5.convert(…)), `lib/services/file_picker_service.dart:364` (md5.convert(…)), `lib/services/local_media_share_service.dart:189` (sha1.convert(…)), `lib/services/remote_subtitle_service.dart:387` (sha1.convert(…)), and 13 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place; 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; Resolve the 1 REDACTED finding(s) in Vulnerability-disclosure Policy — start with REDACTED.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 REDACTED finding(s) in Vulnerability-disclosure Policy — start with REDACTED.
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. This repository constructs a collision-broken hash (MD5/SHA1) at 21 sites, not one: `lib/player_abstraction/video_player_adapter.dart:703` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:756` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1052` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1605` (md5.convert(…)), `lib/services/dandanplay_service_stub.dart:672` (md5.convert(…)), `lib/services/file_picker_service.dart:364` (md5.convert(…)), `lib/services/local_media_share_service.dart:189` (sha1.convert(…)), `lib/services/remote_subtitle_service.dart:387` (sha1.convert(…)), and 13 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
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.
Name the access rules — Serverpod scopes (requiredScopes, a Scope subclass) or roles and permissions declared once — and consult them where access is checked, so the rule set is reviewable and testable on its own.
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 — 150
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 — 3012
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 — 166
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 14
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 69 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 — 69 dimensions across the health lenses
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
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, 3310 of 3328 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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: this repository's production source spans .rs, .dart, and our analyzer cannot run the .dart test suite(s) — so no coverage was collected for the repository as a whole. The Rust half did build and run, and its own line coverage came back at 61.1% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.dart, .rs) 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 — 17 Maven/Gradle manifest(s) were read, stating a version for 17 dependency(ies) and leaving 2 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its pub package dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Cargo manifest, but the licence verdict published here was taken over its pub package dependencies. Nothing was read about its Cargo dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its pub package dependencies. Nothing was read about its Gradle dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D20 ADR Quality — 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. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `packages/media_kit/assets/web/hls1.4.10.js`, `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift`, `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via ToolchainServer (server/dandanplay-gateway). the service exited before it opened a port — `cargo run --locked --bin 'nipaplay-dandanplay-gateway'`: om legacy endpoint [3murl[0m[2m=[0m"https://kurisu.aimes-soft.com/nipaplay.php" [3merror[0m[2m=[0merror sending request for url (https://kurisu.aimes-soft.com/nipaplay.php)
[2m2026-11-17T19:3…; runtime evidence skipped (launch chosen because 'axum' dependency in server/dandanplay-gateway/Cargo.toml, binary 'nipaplay-dandanplay-gateway').
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'package:sqflite' is imported (tool/ohos_native_smoke.dart:15), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'package:sqflite' is imported (tool/ohos_native_smoke.dart:15), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'package:sqflite' is imported (tool/ohos_native_smoke.dart:15), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'package:sqflite' is imported (tool/ohos_native_smoke.dart:15), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
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.
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. 243 further occurrence(s) are not listed individually; the score already reflects all 283.
X26 Unsynchronised callback handoff — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 450 further occurrence(s) are not listed individually; the score already reflects all 490.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
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.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
364 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DanmakuAtlasPainter.paint at 147. A further 4 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 LocalMediaShareService.determineContentType at 22 — they are counted neither in the figure above nor in this dimension's score. 2 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/services/local_media_share_service.dart (LocalMediaShareService.determineContentType at 22), lib/settings/unified_setting_content.dart (UnifiedSettingContent.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.
+ 347 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with DanmakuAtlasPainter.paint (cyclomatic 147). — Refactoring it lifts Cyclomatic Complexity from 4.5 to about 4.8/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 632 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 48 bodies over 60 down to 60 or less in Cognitive Complexity — start with DanmakuAtlasPainter.paint (cognitive 314), _PlaylistMenuState._playEpisode (cognitive 201), SubtitleManager.autoDetectAndLoadSubtitle (cognitive 200). — 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 48 together lifts Cognitive Complexity from 2.0 to about 4.1/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.
Do you agree with this assessment?
D3 · God Classes7.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 178 MethodTooLong finding(s) in God Classes — start with library_management_tab.dart (10), anime_detail_page.dart (4), media_kit_player_adapter.dart (4). — One of this dimension's main actionable groups (178 warning-level).
Resolve the 124 FileTooLong finding(s) in God Classes — start with library_management_tab.dart, anime_detail_page.dart, media_kit_player_adapter.dart. — One of this dimension's main actionable groups (124 warning-level).
Resolve the 109 ClassTooLong finding(s) in God Classes — start with custom_media_info_dialog.dart (2), jellyfin_dandanplay_matcher.dart (2), emby_dandanplay_matcher.dart (2). — One of this dimension's main actionable groups (109 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
802 duplicated block group(s) detected. 8.9 % of the production lines (40,676 of 455,951) are in a reported copy. A further 405 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 1207 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.
+ 321 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 36 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with rendering.rs (4), cupertino_danmaku_settings_pane.dart (3), emby_dandanplay_matcher.dart (2). — One of this dimension's main actionable groups (36 warning-level).
Resolve the 34 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with dandanplay_service_io.dart (3), cupertino_remote_controller_settings_page.dart (2), cupertino_subtitle_list_pane.dart (2). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 33 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with cupertino_subtitle_settings_pane.dart (3), emby_service.dart (2), cupertino_playlist_pane.dart (2). — One of this dimension's main actionable groups (33 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
36 production modules (Gradle+Cargo+npm+SwiftPM+pub+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 0 module(s) off the main sequence, with abstractness counted on 6 of the 36 (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).
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.
Resolve the 51 Low cohesion finding(s) in Cohesion (LCOM4) — start with network_media_library_view.dart (3), main.dart (2), video_player_state.dart. — One of this dimension's main actionable groups (51 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
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.
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.
0 of 219 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 4 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 65 package(s) locked at an older version the licence read is that of the package's latest analysed release, not of the locked one. 3 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 package.json, a Cargo manifest and a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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.
Top hotspots: lib/utils/subtitle_manager.dart (19×62=1178); lib/pages/anime_detail_page.dart (13×81=1053); lib/pages/play_video_page.dart (13×72=936) Repeated repair below the complexity floor: lib/player_abstraction/mdk_player_adapter_io.dart (7 of 7 changes were fixes); lib/widgets/danmaku_overlay.dart (6 of 8 changes were fixes); rust/src/next2_engine/engine/motion.rs (5 of 6 changes were fixes)
Resolve the 60 Hotspot finding(s) in Churn × Complexity Hotspots — start with subtitle_manager.dart, anime_detail_page.dart, play_video_page.dart. — One of this dimension's main actionable groups (60 warning-level).
Resolve the 17 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mdk_player_adapter_io.dart, danmaku_overlay.dart, motion.rs. — One of this dimension's main actionable groups (17 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.6 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
129 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is lib/danmaku_next/danmaku_atlas_painter.dart. Counted over 896 of the 1270 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×6
Further sole-owners (lower concentration)
What to do
Resolve the 6 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (6 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
6 naming inconsistencies among 90 declarations measured against a convention their peers follow.
`_matchWithDandanPlayAPI` spells `API` where 36 names in the project spell it `Api` · ×2lib/services/emby_dandanplay_matcher.dart:677
`_launchURL` spells `URL` where 22 names in the project spell it `Url`lib/settings/pages/about_settings_content.dart:683
`WebDAVFileSorter` spells `DAV` where 14 names in the project spell it `Dav`lib/utils/webdav_file_sorter.dart:9
`_disableMic` spells `Mic` where 18 names in the project spell it `MIC`third_party/smb_connect/lib/src/smb/spnego_context.dart:28
`_requireMic` spells `Mic` where 18 names in the project spell it `MIC`third_party/smb_connect/lib/src/smb/spnego_context.dart:29
What to do
Resolve the 2 `_matchWithDandanPlayAPI` spells `API` where 36 names in the project… finding(s) in Naming Consistency — start with emby_dandanplay_matcher.dart, jellyfin_dandanplay_matcher.dart. — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 `_launchURL` spells `URL` where 22 names in the project spell it `Url` finding(s) in Naming Consistency — start with about_settings_content.dart. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `WebDAVFileSorter` spells `DAV` where 14 names in the project spell it… finding(s) in Naming Consistency — start with webdav_file_sorter.dart. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
4 finding(s): 0 critical, 4 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
Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
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.
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).
119 finding(s): 0 critical, 106 high, 10 medium, 3 low. 68 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 59 file(s) — `.github/workflows/scripts/submit-macos-notarization.sh` (line 5), `android/app/src/main/jniLibs/arm64-v8a/mdk-sdk/include/mdk/AudioFrame.h` (line 17), `android/app/src/main/jniLibs/arm64-v8a/mdk-sdk/include/mdk/Player.h`, `android/app/src/main/jniLibs/arm64-v8a/mdk-sdk/include/mdk/VideoFrame.h` (line 17), `android/app/src/main/jniLibs/arm64-v8a/mdk-sdk/include/mdk/c/Player.h`, … (+54 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 9 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
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 REDACTED finding(s) charged to Static Analysis (SAST) — the other 68 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (85 issue-level, 17 of them charged here).
Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (15), REDACTED, REDACTED. — One of this dimension's main actionable groups (17 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 18 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (17), REDACTED. — One of this dimension's main actionable groups (18 issue-level).
Resolve the 12 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8), REDACTED (4). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 6 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 8 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (5), REDACTED (3). — One of this dimension's main actionable groups (8 warning-level).
Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
18 of 896 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is lib/services/emby_media_preference_store.dart. Counted over 896 of the 1270 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with emby_media_preference_store.dart. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 17 Orphaned file finding(s) in Knowledge Freshness — start with multi_address_server_service.dart, nipaplay_next_old_canvas_painter.dart, danmaku_sprite_atlas.dart. — One of this dimension's main actionable groups (17 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 13 Boundary-crossing change coupling finding(s) in Change Coupling — start with mpv_session.dart (2), dfm_plus_overlay.dart (2), episode_navigation_service.dart. — One of this dimension's main actionable groups (13 issue-level).
Resolve the 12 Change coupling finding(s) in Change Coupling — start with dandanplay_remote_library_view.dart (2), main.dart (2), cupertino_playlist_pane.dart. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (REDACTED or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a REDACTED (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
A vulnerability-disclosure policy (REDACTED) is present but lists no reporting contact.
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Vulnerability-disclosure Policy — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d37_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 13 platform declaration(s) and 18 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.
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.
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.
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.
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.
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.
`AppLocalizations` declares 593 abstract methods: `appTitle`, `tabHome`, `tabVideoPlay`, `tabMediaLibrary`, `tabTorrentDownload`, `tabAccount`, `tabDanmakuConsole`, `externalPlayerConsoleTitle`, `externalPlayerConsoleEmptyTitle`, `externalPlayerConsoleEmptyDescription`, `externalPlayerConsoleAnime`, `externalPlayerConsoleEpisode`, `externalPlayerConsoleEpisodeId`, `externalPlayerConsoleProcessId`, `externalPlayerConsoleMediaPath`, `externalPlayerConsoleUnknownAnime`, `externalPlayerConsoleUnknownEpisode`, `externalPlayerConsoleProgress`, `externalPlayerConsoleProgressUnsupported`, `externalPlayerConsoleProgressLoading`, `externalPlayerConsoleTimestampLabel`, `externalPlayerConsoleTimestampHint`, `externalPlayerConsoleTimestampInvalid`, `externalPlayerConsoleTimestampSeek`, `externalPlayerConsoleDanmakuList`, `externalPlayerConsoleDanmakuStats`, `externalPlayerConsoleDanmakuEmpty`, `externalPlayerConsoleDanmakuUnknownSender`, `externalPlayerConsoleDanmakuSender`, `externalPlayerConsoleDanmakuTypeScroll`, `externalPlayerConsoleDanmakuTypeTop`, `externalPlayerConsoleDanmakuTypeBottom`, `externalPlayerConsoleDanmakuActive`, `externalPlayerConsoleDanmakuFollowEnabled`, `externalPlayerConsoleDanmakuFollowDisabled`, `externalPlayerConsoleDanmakuKeywordFilter`, `externalPlayerConsoleDanmakuKeywordHint`, `externalPlayerConsoleDanmakuKeywordAdd`, `externalPlayerConsoleDanmakuBlocked`, `externalPlayerConsoleDanmakuBlockModeKeyword`, and 553 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. — lib/l10n/app_localizations.dart:13
`FluentLocalizations` declares 185 abstract methods: `backButtonTooltip`, `closeButtonLabel`, `searchLabel`, `closeNavigationTooltip`, `openNavigationTooltip`, `clickToSearch`, `modalBarrierDismissLabel`, `minimizeWindowTooltip`, `restoreWindowTooltip`, `closeWindowTooltip`, `dialogLabel`, `cutActionLabel`, `copyActionLabel`, `pasteActionLabel`, `selectAllActionLabel`, `undoActionLabel`, `newTabLabel`, `closeTabLabelSuffix`, `scrollTabBackwardLabel`, `scrollTabForwardLabel`, `noResultsFoundLabel`, `copyActionTooltip`, `cutActionTooltip`, `pasteActionTooltip`, `selectAllActionTooltip`, `undoActionTooltip`, `hour`, `minute`, `am`, `pm`, `month`, `day`, `year`, `pickADate`, `seeMore`, `seeLess`, `redLabel`, `greenLabel`, `blueLabel`, `opacityLabel`, and 145 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. — packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations.dart:51
`ExternalPlayerLaunchSession` declares 16 abstract methods: `type`, `playerPath`, `mediaPath`, `processId`, `ipcPath`, `duration`, `position`, `isPaused`, `fraction`, `isClosed`, `launch`, `terminate`, `togglePause`, `seekToFraction`, `seekToPosition`, `refreshDanmaku`. 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/models/external_player_session/session.dart:10
`AbstractPlayer` declares 29 abstract methods: `volume`, `playbackRate`, `state`, `textureId`, `media`, `mediaInfo`, `activeSubtitleTracks`, `activeAudioTracks`, `position`, `bufferedPosition`, `setBufferRange`, `supportsExternalSubtitles`, `updateTexture`, `setMedia`, `prepare`, `seek`, `dispose`, `snapshot`, `setDecoders`, `getDecoders`, `getProperty`, `setProperty`, `setVideoSurfaceSize`, `setChapter`, `playDirectly`, `pauseDirectly`, `setPlaybackRate`, `stepForward`, `stepBackward`. 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/player_abstraction/abstract_player.dart:98
`MediaServerServiceBase` declares 23 abstract methods: `serviceName`, `serviceType`, `prefsKeyPrefix`, `serverNameFallback`, `notConnectedMessage`, `serverUrl`, `username`, `password`, `accessToken`, `userId`, `isConnected`, `isReady`, `selectedLibraryIds`, `currentProfile`, `currentAddressId`, `normalizeRequestPath`, `testConnection`, `performAuthentication`, `getServerId`, `getServerName`, `loadAvailableLibraries`, `loadTranscodeSettings`, `clearServiceData`. 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/services/media_server_service_base.dart:16
`RustLibApi` declares 61 abstract methods: `crateApiDanmakuAnalyticsAnalyzeDensity`, `crateApiAssConverterAssResolveFontSize`, `crateApiIncrementalSyncBackupPrepareRestore`, `crateApiAssConverterConvertDanmakuToAss`, `crateApiAssConverterConvertPreparedDanmakuToAss`, `crateApiDanmakuAnalyticsDensityStats`, `crateApiDfmPlusDfmPlusDropLayout`, `crateApiDfmPlusDfmPlusFontMetrics`, `crateApiDfmPlusDfmPlusLayoutFrame`, `crateApiDfmPlusDfmPlusMeasureTextWidth`, `crateApiDfmPlusDfmPlusMeasureTextWidths`, `crateApiDfmPlusDfmPlusPrepareLayout`, `crateApiDfmPlusDfmPlusPrepareLayoutFull`, `crateApiFileScanDiffVideoFiles`, `crateApiDanmakuAnalyticsFindPeakSegments`, `crateApiMediaProbeHashFileHead`, `crateApiSimpleInitApp`, `crateApiPerformanceIsPerformanceProbeAvailable`, `crateApiTorrentIsTorrentEngineAvailable`, `crateApiMediaMetadataMediaBaseNameWithoutExtension`, `crateApiMediaMetadataMediaExtractAnimeTitleKeyword`, `crateApiMediaMetadataNaturalCompare`, `crateApiMediaMetadataNaturalCompareCaseSensitive`, `crateApiNext2Next2LayoutFrame`, `crateApiNext2Next2PrepareLayout`, `crateApiClientNotificationsNotifyClient`, `crateApiStartupCommandsParseStartupCommand`, `crateApiWebdavMultistatusParseWebdavMultistatus`, `crateApiMediaProbeProbeRemoteMedia`, `crateApiStartupCommandsReportStartupCommandResult`, `crateApiPerformanceSampleCpuCounters`, `crateApiPerformanceSampleGpuPercent`, `crateApiPerformanceSampleMemoryRssMb`, `crateApiPerformanceSamplePerformance`, `crateApiFileScanScanVideoFiles`, `crateApiDanmakuAnalyticsSmoothDensity`, `crateApiRemoteDirectorySortRemoteEntryIndices`, `crateApiClientNotificationsSubscribeClientNotifications`, `crateApiMediaMetadataSubtitleComputeMatchScore`, `crateApiMediaMetadataSubtitleExtractMatchTokens`, and 21 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. — lib/src/rust/frb_generated.dart:97
`RustLibApiImplPlatform` declares 276 abstract methods: `dco_decode_AnyhowException`, `dco_decode_StreamSink_client_notification_Sse`, `dco_decode_String`, `dco_decode_bool`, `dco_decode_box_autoadd_client_notification`, `dco_decode_box_autoadd_dfm_plus_frame_request`, `dco_decode_box_autoadd_dfm_plus_prepare_request`, `dco_decode_box_autoadd_f_64`, `dco_decode_box_autoadd_i_32`, `dco_decode_box_autoadd_i_64`, `dco_decode_box_autoadd_rust_ass_export_settings`, `dco_decode_box_autoadd_rust_next_2_frame_request`, `dco_decode_box_autoadd_rust_next_2_prepare_request`, `dco_decode_box_autoadd_u_32`, `dco_decode_client_notification`, `dco_decode_dfm_plus_danmaku_item`, `dco_decode_dfm_plus_font_metrics`, `dco_decode_dfm_plus_frame_item`, `dco_decode_dfm_plus_frame_layout`, `dco_decode_dfm_plus_frame_request`, `dco_decode_dfm_plus_prepare_request`, `dco_decode_dfm_plus_prepared_item`, `dco_decode_dfm_plus_prepared_layout`, `dco_decode_dfm_plus_raw_danmaku_item`, `dco_decode_f_64`, `dco_decode_i_32`, `dco_decode_i_64`, `dco_decode_list_String`, `dco_decode_list_bool`, `dco_decode_list_dfm_plus_danmaku_item`, `dco_decode_list_dfm_plus_frame_item`, `dco_decode_list_dfm_plus_prepared_item`, `dco_decode_list_dfm_plus_raw_danmaku_item`, `dco_decode_list_list_prim_u_8_strict`, `dco_decode_list_prim_f_64_loose`, `dco_decode_list_prim_f_64_strict`, `dco_decode_list_prim_i_64_strict`, `dco_decode_list_prim_u_32_strict`, `dco_decode_list_prim_u_8_loose`, `dco_decode_list_prim_u_8_strict`, and 236 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) — lib/src/rust/frb_generated.io.dart:26, lib/src/rust/frb_generated.web.dart:28
`Configuration` declares 33 abstract methods: `debugPrint`, `debugPrintLowLevel`, `forceSmb1`, `random`, `bufferCache`, `minimumVersion`, `maximumVersion`, `isPort139FailoverEnabled`, `isUseUnicode`, `isUseBatching`, `nativeOs`, `nativeLanman`, `receiveBufferSize`, `sendBufferSize`, `soTimeout`, `connTimeout`, `responseTimeout`, `credentials`, `domain`, `username`, `password`, `capabilities`, `flags2`, `oemEncoding`, `localTimezone`, `pid`, `maximumBufferSize`, `transactionBufferSize`, `bufferCacheSize`, `listCount`, `listSize`, `getBatchLimit`, `machineId`. 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. — third_party/smb_connect/lib/src/configuration.dart:12
`Response` declares 17 abstract methods: `isReceived`, `setReceived`, `clearReceived`, `getGrantedCredits`, `getErrorCode`, `setMid`, `getMid`, `verifySignature`, `isVerifyFailed`, `isError`, `error`, `getExpiration`, `setExpiration`, `reset`, `getException`, `setException`, `getNextResponse`. 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. — third_party/smb_connect/lib/src/connect/transport/response.dart:4
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
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.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ 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.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
What to do
Name the access rules — Serverpod scopes (requiredScopes, a Scope subclass) or roles and permissions declared once — and consult them where access is checked, so the rule set is reviewable and testable on its own.
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.
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.
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.
`maybeControllerOf` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:60
`isSecondaryWindow` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:66
`fromWindowId` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:67
`createPopupWindow` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:80
`createTooltipWindow` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:92
`setMinimumSize` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:195
`setPictureInPictureMode` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:233
`startDragging` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:217
`updateDragging` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:218
`endDragging` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:219
`// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead. (×30) — packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations.dart:49, packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ar.dart:5, packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_be.dart:5, …
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.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
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.
packages/adaptive_platform_ui/README.md links to `.github/CONTRIBUTING.md`, but `packages/adaptive_platform_ui/.github/CONTRIBUTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/adaptive_platform_ui/README.md:1284
packages/liquid_glass_widgets/README.md links to `docs/LIQUID_MORPH_ENGINE.md`, but `packages/liquid_glass_widgets/docs/LIQUID_MORPH_ENGINE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/liquid_glass_widgets/README.md:21
packages/liquid_glass_widgets/README.md links to `docs/ADAPTIVE_QUALITY.md`, but `packages/liquid_glass_widgets/docs/ADAPTIVE_QUALITY.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/liquid_glass_widgets/README.md:567
packages/adaptive_platform_ui/test/README.md claims "23 widgets", but the reader.Tree holds 739 Dart classes extending StatelessWidget or StatefulWidget. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/adaptive_platform_ui/test/README.md:106
What to do
Reconcile the README with reality: packages/adaptive_platform_ui/README.md links to `.github/CONTRIBUTING.md`, but `packages/adaptive_platform_ui/.github/CONTRIBUTING.md` does not exist; packages/liquid_glass_widgets/README.md links to `docs/LIQUID_MORPH_ENGINE.md`, but `packages/liquid_glass_widgets/docs/LIQUID_MORPH_ENGINE.md` does not exist; packages/liquid_glass_widgets/README.md links to `docs/ADAPTIVE_QUALITY.md`, but `packages/liquid_glass_widgets/docs/ADAPTIVE_QUALITY.md` does not exist; packages/adaptive_platform_ui/test/README.md claims "23 widgets", but the reader.Tree holds 739 Dart classes extending StatelessWidget or StatefulWidget.
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.
Do you agree with this assessment?
P10 · Library API & versioning9.8 / 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.
14 public types in `repository.src` are marked as implementation by their own namespace, folder or name: `GlassDragBuilder` (packages/liquid_glass_widgets/lib/src/renderer/internal/glass_drag_builder.dart:5, `internal`), `GlassShadowPaints` (packages/liquid_glass_widgets/lib/src/renderer/internal/glass_shadow_paints.dart:6, `internal`), `InteractionNotification` (packages/liquid_glass_widgets/lib/src/renderer/internal/interaction_notification.dart:3, `internal`), `MultiShaderBuilder` (packages/liquid_glass_widgets/lib/src/renderer/internal/multi_shader_builder.dart:16, `internal`), `LiquidGlassGeometryState` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:14, `internal`), `RenderLiquidGlassGeometry` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:33, `internal`), `GeometryCache` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:291, `internal`), `UnrenderedGeometryCache` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:329, `internal`), and 6 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — packages/liquid_glass_widgets/lib/src/renderer/internal/glass_drag_builder.dart:5
What to do
Hide `repository.src` (`GlassDragBuilder`, `GlassShadowPaints`, `InteractionNotification`, `MultiShaderBuilder`, `LiquidGlassGeometryState`, `RenderLiquidGlassGeometry`, `GeometryCache`, `UnrenderedGeometryCache`, and 6 more) (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`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
Do you agree with this assessment?
P2 · Observability6.5 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 9/18 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/adaptive_platform_ui/example`, `packages/adaptive_platform_ui/example/ios`, `packages/file_selector_ohos/example`, `packages/liquid_glass_widgets/example` and 4 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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 16 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:13
`package.json` 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`. — package.json:2
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.
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.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
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.
`launch` 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/models/external_player_session/mpv_session.dart:94
`refreshDanmaku` is async and calls renameSync, 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/models/external_player_session/mpv_session.dart:240
`_initDB` 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/models/watch_history_database.dart:78
`snapshot` 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/player_abstraction/video_player_adapter.dart:556
`_prepareTrayIconPath` 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/services/desktop_exit_handler.dart:490
`_loadLocalEpisodes` 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/services/playback_source_service.dart:754
`_ensureThumbnailDirectory` 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/services/server_history_sync_service.dart:497
`_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. — rust_builder/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. — rust_builder/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. — rust_builder/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. — rust_builder/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. — rust_builder/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. — rust_builder/cargokit/build_tool/lib/src/precompile_binaries.dart:52
`_loadFileSystemEpisodes` 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/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:217
`scanVideoFiles` 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/themes/nipaplay/widgets/custom_media_info_dialog.dart:1520
`_loadFileSystemData` 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/themes/nipaplay/widgets/playlist_menu.dart:74
`_prepareHotSwapTraceFile` 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/player_kernel_manager.dart:29
`autoDetectAndLoadSubtitle` 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/subtitle_manager.dart:1434
`_registerRemainingSubtitlesAfterRestore` 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/subtitle_manager.dart:1895
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.
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 (pubspec.yaml:40 — depends on `shelf`), 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.
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. (×21) — lib/player_abstraction/video_player_adapter.dart:703, lib/services/dandanplay_service_io.dart:756, lib/services/dandanplay_service_io.dart:1052, …
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 `REDACTED` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — REDACTED:2
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: pubspec.yaml:40 — depends on `shelf`.
What to do
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. This repository constructs a collision-broken hash (MD5/SHA1) at 21 sites, not one: `lib/player_abstraction/video_player_adapter.dart:703` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:756` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1052` (md5.convert(…)), `lib/services/dandanplay_service_io.dart:1605` (md5.convert(…)), `lib/services/dandanplay_service_stub.dart:672` (md5.convert(…)), `lib/services/file_picker_service.dart:364` (md5.convert(…)), `lib/services/local_media_share_service.dart:189` (sha1.convert(…)), `lib/services/remote_subtitle_service.dart:387` (sha1.convert(…)), and 13 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
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.
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.
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.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
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.
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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.8 / 10Critical✓ 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.
`clone` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 35 with a piece of the document (and at line 36) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/src/next2_engine/engine/command_channel.rs:35
`send` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 42 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `send` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/src/next2_engine/engine/command_channel.rs:42
`try_recv` is public and takes a `Receiver` as its receiver from its caller, and it calls itself at line 56 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `try_recv` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/src/next2_engine/engine/command_channel.rs:56
`recv_timeout` is public and takes a `Receiver` as its receiver from its caller, and it calls itself at line 79 with a piece of the document (and at line 83) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `recv_timeout` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/src/next2_engine/engine/command_channel.rs:79
`canonicalJson` is public, takes a document from its caller (line 392) and hands it to `_canonicalize`, which calls itself at line 399 (`_canonicalize`) with a piece of `value` (and at line 402) — and nowhere in `_canonicalize` 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 `_canonicalize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/services/incremental_sync_repository.dart:399
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.
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.
`AutoSuggestBoxState` carries a disposal duty — a `State`, so the framework calls its `dispose()` when it leaves the tree — and it creates `_overlayNode` itself (line 476, `FocusScopeNode`), which makes that instance its own. Nothing in the class releases it — no `_overlayNode.dispose()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `FocusScopeNode` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_overlayNode.dispose();` in `dispose()` before `super.dispose()`. — packages/fluent_ui-4.15.1/lib/src/controls/form/auto_suggest_box.dart:476
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
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.
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/9 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.
`requestAllRequiredPermissions` calls `audio.request(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/utils/android_storage_helper.dart:92
`webDavAuthenticatedGet` calls `dio.getUri(…)` 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/webdav_http_auth.dart:145
`_listManagedLibraryCandidates` 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`. — lib/services/remote_subtitle_service.dart:927
`_listSharedRemoteCandidates` 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`. — lib/services/remote_subtitle_service.dart:1049
`_listSharedRemoteAudioCandidates` 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`. — lib/services/remote_subtitle_service.dart:1153
`_listSharedRemoteFontCandidates` 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`. — lib/services/remote_subtitle_service.dart:1271
`_downloadSharedRemoteAudio` 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`. — lib/services/remote_subtitle_service.dart:1392
`_downloadSharedRemoteFont` 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`. — lib/services/remote_subtitle_service.dart:1455
`_downloadSharedRemoteSubtitle` 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`. — lib/services/remote_subtitle_service.dart:1928
What to do
Thread a CancelToken through functions that make requests, so the work stops when its caller gives up.
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.
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.
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. — rust_builder/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.
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.
`JellyfinDandanplayMatcher` looks up `"episodeTitle"` and falls back to `name` when the caller supplies none — but line 202 of this same type looks up `"episodeTitle"` and falls back to `episodeTitle`, which is the member that key names. The two cannot both be right: every caller who configures `episodeTitle` and passes no `"episodeTitle"` override silently gets `name` instead, and nothing reports that the value was ignored. Fall back to `episodeTitle` here as line 202 does — or, if `name` genuinely is the intended source, look it up under its own key so the two sites stop disagreeing. (×2) — lib/services/jellyfin_dandanplay_matcher.dart:477, lib/services/jellyfin_dandanplay_matcher.dart:483
`SyncPatch.created_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rust/src/api/incremental_sync.rs:65
`SyncPatch.device_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rust/src/api/incremental_sync.rs:67
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
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 walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries 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. Whether a `foreach` leaves the array or collection it is walking alone — PHP raises nothing, but the loop's view and the collection part: an array walked by value (and a Doctrine or Laravel collection) is walked as the snapshot taken when the loop began, so an element added in the body is never visited and one removed is visited anyway; an array walked by reference (`as &$v`) and an SPL container (`SplObjectStorage`, `ArrayObject`, `SplQueue`) are walked live, so an added element is walked too and a removal skips the next one; and after an `array_splice`, `array_shift` or sort every later key names a different element.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
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. (×35) — rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:524, rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:537, rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:550, …
`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. (×2) — packages/media_kit/lib/src/player/web/player/real.dart:1486, packages/fluent_ui-4.15.1/lib/src/controls/form/number_box.dart:807
`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. (×3) — packages/fluent_ui-4.15.1/lib/src/controls/pickers/color_picker/color_state.dart:193, packages/danmaku_canvas/lib/canvas_danmaku_renderer.dart:650, packages/adaptive_platform_ui/lib/src/widgets/ios26/ios26_native_search_tab_bar.dart:123
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
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.
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.
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.
Do you agree with this assessment?
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.
Unscored — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 21 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'package:sqflite' (tool/ohos_native_smoke.dart:15) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'package:sqflite' (tool/ohos_native_smoke.dart:15) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'package:sqflite' (tool/ohos_native_smoke.dart:15) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 50 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 class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state 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. PHP builds its object graph per request and shares none of it between requests. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
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
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the service exited before it opened a port — `cargo run --locked --bin 'nipaplay-dandanplay-gateway'`: om legacy endpoint [3murl[0m[2m=[0m"https://kurisu.aimes-soft.com/nipaplay.php" [3merror[0m[2m=[0merror sending request for url (https://kurisu.aimes-soft.com/nipaplay.php)
[2m2026-11-17T19:3…; runtime evidence skipped (launch chosen because 'axum' dependency in server/dandanplay-gateway/Cargo.toml, binary 'nipaplay-dandanplay-gateway') This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: this repository stores data through 'package:sqflite' (tool/ohos_native_smoke.dart:15) but declares no persisted model this check reads (Drift tables, Isar/ObjectBox/Floor/Hive entities, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
D10 Test Quality — ~47250 lines of test source are present (.dart, .rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — no .dart test runner
D12 Dependency Hygiene — Not scored — 17 Maven/Gradle manifest(s) were read, stating a version for 17 dependency(ies) and leaving 2 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.
D17 Explicit Debt — the C# workspace loaded 0 projects, so explicit-debt density could not be measured
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D20 ADR Quality — 1 ADR(s) are written in a language our ADR lexicon does not cover, or are too short to tell (undetermined); their sections and statuses were not judged.
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust, Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — 24 of 32 comment blocks were not judged (22 in a non-Latin script, 2 in a language other than English): redundancy is judged by word overlap with the code's identifiers, which cannot be measured across languages.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.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.
D32 Data Compliance (PII/GDPR) — 3 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
DM1 Aggregate boundaries — not scored for Dart: aggregate-vs-value-object classification cannot be told apart in source (every class-holding-class reads alike), and a child COLLECTION (legitimate membership) vs a single embedded aggregate is indistinguishable — reported as guidance rather than measured
DM2 Strongly-typed ids — no in-repo typed-id idiom — primitive-obsession recorded as advisory DM8, DM2 not gated
DM3 Integration-event coupling — not scored for Dart: a cross-package domain leak cannot be told apart in source from a legitimate shared-kernel package, and most repositories ship a single package — reported as guidance rather than measured
DM4 Rich vs anemic domain model — this Dart repository declares no domain-layer entity carrying stored data (every type is a typed-id wrapper, DTO/config, ORM row or presentation container), so DM4's rich-vs-anemic read has no population to be taken over
DM6 Domain ↔ infrastructure boundary — this Dart repository maps no type to a persistence framework (drift/floor/isar/objectbox/hive), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not scored for Dart: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P9 Domain vs controller coverage — coverage data present for 1 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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 — X26 reached only 2% of this repository's production lines — dart (280,609 lines), rust (16,661 lines), cpp (3,681 lines), c (1,225 lines), php (493 lines), javascript (236 lines), objectivec (76 lines), typescript (76 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Boundary-crossing change coupling: mpv_session.dart ↔ external_player_console_service.dart lib/models/external_player_session/mpv_session.dart:1— `lib/models/external_player_session/mpv_session.dart` (context models) and `lib/services/external_player_console_service.dart` (context services) sit in DIFFERENT parts of the tree yet change together 82% of the time (14 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `cdacdc8d` fix(mpv): stabilize danmaku reload and sync console style settings (#…; `c7b0fc13` refactor(external-player): 由 MpvSession 管理弹幕资源; `1208fb13` refractor(external-player): 进一步整理逻辑, 删除DanmakuLaunchAssets — run `git show` on any of them.
Boundary-crossing change coupling: episode_navigation_service.dart ↔ playlist_menu.dart lib/services/episode_navigation_service.dart:1— `lib/services/episode_navigation_service.dart` (context services) and `lib/themes/nipaplay/widgets/playlist_menu.dart` (context themes) sit in DIFFERENT parts of the tree yet change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `eeaa5072` Add a standalone skip danmaku matching policy; `d8a84fe2` 失败重试; `1d0a1842` 修复续播失效 — run `git show` on any of them.
Boundary-crossing change coupling: external_player_console_service.dart ↔ danmaku_ass_converter.dart lib/services/external_player_console_service.dart:1— `lib/services/external_player_console_service.dart` (context services) and `lib/utils/danmaku_ass_converter.dart` (context utils) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `c7b0fc13` refactor(external-player): 由 MpvSession 管理弹幕资源; `5a83a42b` refractor: 将 allowStacking 整合进 AssExportSettings; `5cf5387c` feat: improve the macOS mpv danmaku console (#768) — run `git show` on any of them.
Boundary-crossing change coupling: dfm_plus_overlay.dart ↔ renderer_core.rs lib/danmaku_dfm/dfm_plus_overlay.dart:1— `lib/danmaku_dfm/dfm_plus_overlay.dart` (context danmaku_dfm) and `rust/src/next2_engine/engine/renderer_core.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a95a3a74` fix(ios): pace DFM frames with the native display clock; `3864f7f5` fix(dfm): gate playback on glyph prewarm; `98763816` 移除高刷库、诊断代码和临时 build CI — run `git show` on any of them.
Boundary-crossing change coupling: mpv_session.dart ↔ external_player_console_page.dart lib/models/external_player_session/mpv_session.dart:1— `lib/models/external_player_session/mpv_session.dart` (context models) and `lib/pages/external_player_console_page.dart` (context pages) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `cdacdc8d` fix(mpv): stabilize danmaku reload and sync console style settings (#…; `a4ad1020` Windows外部播放器控制台支持; `5cf5387c` feat: improve the macOS mpv danmaku console (#768) — run `git show` on any of them.
Boundary-crossing change coupling: erika_player_adapter.dart ↔ playback_info_menu.dart lib/player_abstraction/erika_player_adapter.dart:1— `lib/player_abstraction/erika_player_adapter.dart` (context player_abstraction) and `lib/themes/nipaplay/widgets/playback_info_menu.dart` (context themes) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `03968fd1` feat(erika): adopt 0.3.4 upscalers and custom models in Classic; `cd274814` fix(erika): Classic's playback info shows Erika's codec, frame rate a…; `853184a9` feat(linux): integrate Erika texture playback and source builds — run `git show` on any of them.
Boundary-crossing change coupling: auto_next_episode_service.dart ↔ cupertino_playlist_pane.dart lib/services/auto_next_episode_service.dart:1— `lib/services/auto_next_episode_service.dart` (context services) and `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` (context themes) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `d8a84fe2` 失败重试; `1d0a1842` 修复续播失效; `c7f66fe8` refactor(external-player): 完成播放入口收敛 — run `git show` on any of them.
Boundary-crossing change coupling: shared_remote_library_provider.dart ↔ web_api_service.dart lib/providers/shared_remote_library_provider.dart:1— `lib/providers/shared_remote_library_provider.dart` (context providers) and `lib/services/web_api_service.dart` (context services) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a1951902` 1; `5c666f92` 1; `27ae633e` webUI — run `git show` on any of them.
Boundary-crossing change coupling: emby_provider.dart ↔ jellyfin_service.dart lib/providers/emby_provider.dart:1— `lib/providers/emby_provider.dart` (context providers) and `lib/services/jellyfin_service.dart` (context services) sit in DIFFERENT parts of the tree yet change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `22331504` feat: Enhance Jellyfin service and UI for mixed library navigation; `1a3ee797` feat: emby支持转码播放; `6a4c928e` feat: provider-level ready signals and dashboard pending-refresh clea… — run `git show` on any of them.
Boundary-crossing change coupling: video_player_adapter.dart ↔ video_player_state.dart lib/player_abstraction/video_player_adapter.dart:1— `lib/player_abstraction/video_player_adapter.dart` (context player_abstraction) and `lib/utils/video_player_state.dart` (context utils) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `30687b02` feat(player): auto-detect and load external mka audio track with meta…; `6570b22b` 2025-0803; `3dbf8359` Revert "1" — run `git show` on any of them.
Boundary-crossing change coupling: dfm_plus_overlay.dart ↔ rendering.rs lib/danmaku_dfm/dfm_plus_overlay.dart:1— `lib/danmaku_dfm/dfm_plus_overlay.dart` (context danmaku_dfm) and `rust/src/next2_engine/engine/rendering.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `3864f7f5` fix(dfm): gate playback on glyph prewarm; `98763816` 移除高刷库、诊断代码和临时 build CI; `6ec75e20` 修复首播卡顿build_apk — run `git show` on any of them.
Boundary-crossing change coupling: play_video_page.dart ↔ video_player_state_capture.dart lib/pages/play_video_page.dart:1— `lib/pages/play_video_page.dart` (context pages) and `lib/utils/video_player_state/video_player_state_capture.dart` (context utils) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `c5eb175b` feat(capture): support lossless PNG alongside JPEG quality presets (#…; `f4cf03fe` GIF 菜单修复和优化; `22c88fb6` fix(player): correct aspect layout and screenshot controls — run `git show` on any of them.
Boundary-crossing change coupling: subtitle_settings_menu.dart ↔ video_player_state_player_setup.dart lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:1— `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` (context themes) and `lib/utils/video_player_state/video_player_state_player_setup.dart` (context utils) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `66e376ad` Update Erika integration for streaming and subtitles (#673); `f2dc1ef7` review solve2; `51b43f2c` review solve — run `git show` on any of them.
Orphaned knowledge lib/services/emby_media_preference_store.dart:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
MethodTooLong: _PlayerSettingsContentState.build lib/settings/pages/player_settings_content.dart:291— MethodTooLong — build runs 655 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 555 over it, 6.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _DanmakuSettingsContentState.build lib/settings/pages/danmaku_settings_content.dart:773— MethodTooLong — build runs 636 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 536 over it, 6.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CustomMediaInfoDialog._showStep1 lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:64— MethodTooLong — _showStep1 runs 632 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 532 over it, 6.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DanmakuAtlasPainter.paint lib/danmaku_next/danmaku_atlas_painter.dart:392— MethodTooLong — paint runs 562 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 462 over it, 5.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: _AppearanceSettingsContentState.build lib/settings/pages/appearance_settings_content.dart:73— MethodTooLong — build runs 537 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 437 over it, 5.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PlayerRemoteControlBridge._buildParameters lib/services/player_remote_control_bridge.dart:213— MethodTooLong — _buildParameters runs 525 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 425 over it, 5.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _DanmakuListMenuState.build lib/themes/nipaplay/widgets/danmaku_list_menu.dart:374— MethodTooLong — build runs 425 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 325 over it, 4.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _AnimeDetailPageState._buildEpisodesListView lib/pages/anime_detail_page.dart:1942— MethodTooLong — _buildEpisodesListView runs 414 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 314 over it, 4.14× 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: _ModernVideoControlsState.build lib/themes/nipaplay/widgets/modern_video_controls.dart:660— MethodTooLong — build runs 365 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× 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: _SeekStepMenuState.build lib/themes/nipaplay/widgets/seek_step_menu.dart:124— MethodTooLong — build runs 345 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 245 over it, 3.45× 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: _CupertinoDanmakuSettingsPaneState.build lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:304— MethodTooLong — build runs 337 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 237 over it, 3.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _PlayVideoPageState._buildMaterialControls lib/pages/play_video_page.dart:995— MethodTooLong — _buildMaterialControls runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _SubtitleListMenuState.build lib/themes/nipaplay/widgets/subtitle_list_menu.dart:580— MethodTooLong — build runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _AnimeMatchDialogState.build lib/services/emby_dandanplay_matcher.dart:1357— MethodTooLong — build runs 307 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _AnimeMatchDialogState.build lib/services/jellyfin_dandanplay_matcher.dart:1405— MethodTooLong — build runs 307 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _WebDAVQuickSettingsContentState.build lib/settings/pages/webdav_quick_settings_content.dart:42— MethodTooLong — build runs 307 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _SubtitleTracksMenuState.build lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:687— MethodTooLong — build runs 275 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _ExternalSubtitleOverlayState._buildPathBlock lib/widgets/external_subtitle_overlay.dart:163— MethodTooLong — _buildPathBlock runs 271 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 171 over it, 2.71× 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: JellyfinDandanplayMatcher._matchWithDandanPlay lib/services/jellyfin_dandanplay_matcher.dart:285— MethodTooLong — _matchWithDandanPlay runs 267 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× 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: EmbyDandanplayMatcher._matchWithDandanPlay lib/services/emby_dandanplay_matcher.dart:297— MethodTooLong — _matchWithDandanPlay runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× 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: _NipaplayWindowScaffoldState.build lib/themes/nipaplay/widgets/nipaplay_window.dart:248— MethodTooLong — build runs 260 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _PlaylistMenuState._playEpisode lib/themes/nipaplay/widgets/playlist_menu.dart:680— MethodTooLong — _playEpisode runs 259 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 159 over it, 2.59× 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: _DanmakuContainerState._getYPosition lib/widgets/danmaku_container.dart:430— MethodTooLong — _getYPosition runs 252 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 152 over it, 2.52× 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: _AnimeDetailPageState._buildDetailContent lib/pages/anime_detail_page.dart:1585— MethodTooLong — _buildDetailContent runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HotkeyService._getKeyCodeFromString lib/utils/hotkey_service.dart:461— MethodTooLong — _getKeyCodeFromString runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: widgets/library_management_tab.dart lib/themes/nipaplay/widgets/library_management_tab.dart— FileTooLong — 4770 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: _LibraryManagementTabState (236-6622). The bar is 500 significant lines; this is 4270 over it, 9.54× 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: pages/anime_detail_page.dart lib/pages/anime_detail_page.dart— FileTooLong — 3054 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: _AnimeDetailPageState (202-3911). The bar is 500 significant lines; this is 2554 over it, 6.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: player_abstraction/media_kit_player_adapter.dart lib/player_abstraction/media_kit_player_adapter.dart— FileTooLong — 2670 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: MediaKitPlayerAdapter (62-3830). The bar is 500 significant lines; this is 2170 over it, 5.34× 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: pages/torrent_download_page.dart lib/pages/torrent_download_page.dart— FileTooLong — 2066 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1566 over it, 4.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/dandanplay_service_io.dart lib/services/dandanplay_service_io.dart— FileTooLong — 2023 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DandanplayService (22-2929). The bar is 500 significant lines; this is 1523 over it, 4.05× 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/dandanplay_service_stub.dart lib/services/dandanplay_service_stub.dart— FileTooLong — 1979 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DandanplayService (16-2778). The bar is 500 significant lines; this is 1479 over it, 3.96× 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/network_media_library_view.dart lib/themes/nipaplay/widgets/network_media_library_view.dart— FileTooLong — 1718 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: _NetworkMediaLibraryViewState (172-2403). The bar is 500 significant lines; this is 1218 over it, 3.44× 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: pages/media_server_detail_page.dart lib/pages/media_server_detail_page.dart— FileTooLong — 1708 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: _MediaServerDetailPageState (120-2355). The bar is 500 significant lines; this is 1208 over it, 3.42× 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/video_player_state.dart lib/utils/video_player_state.dart— FileTooLong — 1608 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: VideoPlayerState (316-2207). The bar is 500 significant lines; this is 1108 over it, 3.22× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: providers/shared_remote_library_provider.dart lib/providers/shared_remote_library_provider.dart— FileTooLong — 1596 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: SharedRemoteLibraryProvider (27-2165). The bar is 500 significant lines; this is 1096 over it, 3.19× 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/subtitle_manager.dart lib/utils/subtitle_manager.dart— FileTooLong — 1583 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: SubtitleManager (20-2381). The bar is 500 significant lines; this is 1083 over it, 3.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.
FileTooLong: lib/main.dart lib/main.dart— FileTooLong — 1579 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1079 over it, 3.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/webdav_service.dart lib/services/webdav_service.dart— FileTooLong — 1568 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: WebDAVService (187-2260). The bar is 500 significant lines; this is 1068 over it, 3.14× 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: pages/webdav_browser_page.dart lib/pages/webdav_browser_page.dart— FileTooLong — 1567 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: _WebDAVBrowserPageState (42-2097). The bar is 500 significant lines; this is 1067 over it, 3.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: player_abstraction/erika_player_adapter.dart lib/player_abstraction/erika_player_adapter.dart— FileTooLong — 1536 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: ErikaPlayerAdapter (574-2015). The bar is 500 significant lines; this is 1036 over it, 3.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: services/remote_subtitle_service.dart lib/services/remote_subtitle_service.dart— FileTooLong — 1467 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: RemoteSubtitleService (171-1997). The bar is 500 significant lines; this is 967 over it, 2.93× 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/emby_service.dart lib/services/emby_service.dart— FileTooLong — 1415 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: EmbyService (51-2086). The bar is 500 significant lines; this is 915 over it, 2.83× 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/episode_navigation_service.dart lib/services/episode_navigation_service.dart— FileTooLong — 1404 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: EpisodeNavigationService (84-2295). The bar is 500 significant lines; this is 904 over it, 2.81× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: widgets/shared_remote_library_view.dart lib/themes/nipaplay/widgets/shared_remote_library_view.dart— FileTooLong — 1399 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: _SharedRemoteLibraryViewState (50-1921). The bar is 500 significant lines; this is 899 over it, 2.80× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: widgets/custom_media_info_dialog.dart lib/themes/nipaplay/widgets/custom_media_info_dialog.dart— FileTooLong — 1322 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 822 over it, 2.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/jellyfin_service.dart lib/services/jellyfin_service.dart— FileTooLong — 1319 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: JellyfinService (26-1962). The bar is 500 significant lines; this is 819 over it, 2.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: pages/remote_media_library_settings_content.dart lib/settings/pages/remote_media_library_settings_content.dart— FileTooLong — 1293 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: _RemoteMediaLibrarySettingsContentState (46-1678). The bar is 500 significant lines; this is 793 over it, 2.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: plugins/plugin_service.dart lib/plugins/plugin_service.dart— FileTooLong — 1263 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: PluginService (32-1754). The bar is 500 significant lines; this is 763 over it, 2.53× 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: video_player_state/video_player_state_danmaku.dart lib/utils/video_player_state/video_player_state_danmaku.dart— FileTooLong — 1237 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 737 over it, 2.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: pages/external_player_console_page.dart lib/pages/external_player_console_page.dart— FileTooLong — 1228 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 728 over it, 2.46× 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.
ClassTooLong: _LibraryManagementTabState lib/themes/nipaplay/widgets/library_management_tab.dart:236— ClassTooLong — 4590 significant lines (blank, comment-only and punctuation-only lines excluded), 132 methods. The bar is 400 significant lines; this is 4190 over it, 11.48× 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: _AnimeDetailPageState lib/pages/anime_detail_page.dart:202— ClassTooLong — 2695 significant lines (blank, comment-only and punctuation-only lines excluded), 78 methods. The bar is 400 significant lines; this is 2295 over it, 6.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: MediaKitPlayerAdapter lib/player_abstraction/media_kit_player_adapter.dart:61— ClassTooLong — 2491 significant lines (blank, comment-only and punctuation-only lines excluded), 126 methods. The bar is 400 significant lines; this is 2091 over it, 6.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: DandanplayService lib/services/dandanplay_service_io.dart:22— ClassTooLong — 2002 significant lines (blank, comment-only and punctuation-only lines excluded), 91 methods. The bar is 400 significant lines; this is 1602 over it, 5.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DandanplayService lib/services/dandanplay_service_stub.dart:16— ClassTooLong — 1965 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 400 significant lines; this is 1565 over it, 4.91× 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: _MediaServerDetailPageState lib/pages/media_server_detail_page.dart:120— ClassTooLong — 1612 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 1212 over it, 4.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SharedRemoteLibraryProvider lib/providers/shared_remote_library_provider.dart:27— ClassTooLong — 1575 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 1175 over it, 3.94× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _NetworkMediaLibraryViewState lib/themes/nipaplay/widgets/network_media_library_view.dart:172— ClassTooLong — 1560 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 1160 over it, 3.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: SubtitleManager lib/utils/subtitle_manager.dart:19— ClassTooLong — 1558 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods. The bar is 400 significant lines; this is 1158 over it, 3.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: WebDAVService lib/services/webdav_service.dart:187— ClassTooLong — 1428 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 1028 over it, 3.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _WebDAVBrowserPageState lib/pages/webdav_browser_page.dart:42— ClassTooLong — 1420 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 1020 over it, 3.55× 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: EmbyService lib/services/emby_service.dart:51— ClassTooLong — 1379 significant lines (blank, comment-only and punctuation-only lines excluded), 84 methods. The bar is 400 significant lines; this is 979 over it, 3.45× 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: EpisodeNavigationService lib/services/episode_navigation_service.dart:54— ClassTooLong — 1362 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 962 over it, 3.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _SharedRemoteLibraryViewState lib/themes/nipaplay/widgets/shared_remote_library_view.dart:50— ClassTooLong — 1359 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 959 over it, 3.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.
ClassTooLong: VideoPlayerState lib/utils/video_player_state.dart:316— ClassTooLong — 1355 significant lines (blank, comment-only and punctuation-only lines excluded), 274 methods. The bar is 400 significant lines; this is 955 over it, 3.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RemoteSubtitleService lib/services/remote_subtitle_service.dart:171— ClassTooLong — 1313 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 913 over it, 3.28× 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: JellyfinService lib/services/jellyfin_service.dart:26— ClassTooLong — 1296 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods. The bar is 400 significant lines; this is 896 over it, 3.24× 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: _RemoteMediaLibrarySettingsContentState lib/settings/pages/remote_media_library_settings_content.dart:46— ClassTooLong — 1234 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 834 over it, 3.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PluginService lib/plugins/plugin_service.dart:32— ClassTooLong — 1220 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 400 significant lines; this is 820 over it, 3.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: _DanmakuSettingsContentState lib/settings/pages/danmaku_settings_content.dart:39— ClassTooLong — 1162 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 762 over it, 2.91× 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: PlayerRemoteControlBridge lib/services/player_remote_control_bridge.dart:17— ClassTooLong — 1156 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 756 over it, 2.89× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _PlayVideoPageState lib/pages/play_video_page.dart:97— ClassTooLong — 1055 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 655 over it, 2.64× 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: ErikaPlayerAdapter lib/player_abstraction/erika_player_adapter.dart:574— ClassTooLong — 1053 significant lines (blank, comment-only and punctuation-only lines excluded), 91 methods. The bar is 400 significant lines; this is 653 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _NipaplayLargeScreenScaffoldLayoutState lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:69— ClassTooLong — 1032 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 632 over it, 2.58× 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: _PlaylistMenuState lib/themes/nipaplay/widgets/playlist_menu.dart:46— ClassTooLong — 1030 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 630 over it, 2.58× 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: VideoPlayerState lib/utils/video_player_state.dart:316— TooManyMethods — 274 methods. The bar is 30 methods; this is 244 over it, 9.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _LibraryManagementTabState lib/themes/nipaplay/widgets/library_management_tab.dart:236— TooManyMethods — 132 methods. The bar is 30 methods; this is 102 over it, 4.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: MediaKitPlayerAdapter lib/player_abstraction/media_kit_player_adapter.dart:61— TooManyMethods — 126 methods. The bar is 30 methods; this is 96 over it, 4.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: ErikaPlayerAdapter lib/player_abstraction/erika_player_adapter.dart:574— TooManyMethods — 91 methods. The bar is 30 methods; this is 61 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DandanplayService lib/services/dandanplay_service_io.dart:22— TooManyMethods — 91 methods. The bar is 30 methods; this is 61 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EmbyService lib/services/emby_service.dart:51— 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: DandanplayService lib/services/dandanplay_service_stub.dart:16— TooManyMethods — 83 methods. The bar is 30 methods; this is 53 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.
TooManyMethods: PluginService lib/plugins/plugin_service.dart:32— TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SubtitleManager lib/utils/subtitle_manager.dart:19— TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: JellyfinService lib/services/jellyfin_service.dart:26— TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MediaServerServiceBase lib/services/media_server_service_base.dart:16— TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _AnimeDetailPageState lib/pages/anime_detail_page.dart:202— TooManyMethods — 78 methods. The bar is 30 methods; this is 48 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WebDAVService lib/services/webdav_service.dart:187— TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.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: Player lib/player_abstraction/player_abstraction.dart:45— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.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: SharedRemoteLibraryProvider lib/providers/shared_remote_library_provider.dart:27— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.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: _PluginSettingsContentState lib/settings/pages/plugin_settings_content.dart:33— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _NetworkMediaLibraryViewState lib/themes/nipaplay/widgets/network_media_library_view.dart:172— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WebDAVQuickAccessProvider lib/providers/webdav_quick_access_provider.dart:106— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _TagSearchModalState lib/themes/nipaplay/widgets/tag_search_widget.dart:203— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MdkPlayerAdapter lib/player_abstraction/mdk_player_adapter_io.dart:212— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RemoteSubtitleService lib/services/remote_subtitle_service.dart:171— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VideoPlayerAdapter lib/player_abstraction/video_player_adapter.dart:19— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. Most of these members implement player_abstraction.AbstractPlayer (30 of 45 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: HotkeyService lib/utils/hotkey_service.dart:26— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScanService lib/services/scan_service.dart:121— 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: EmbyProvider lib/providers/emby_provider.dart:12— 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.
Hotspot: lib/utils/subtitle_manager.dart lib/utils/subtitle_manager.dart:1434— lib/utils/subtitle_manager.dart changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in SubtitleManager.autoDetectAndLoadSubtitle at line 1434. 14 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/utils/subtitle_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/pages/anime_detail_page.dart lib/pages/anime_detail_page.dart:1942— lib/pages/anime_detail_page.dart changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in _AnimeDetailPageState._buildEpisodesListView at line 1942. 8 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/pages/anime_detail_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/pages/play_video_page.dart lib/pages/play_video_page.dart:995— lib/pages/play_video_page.dart changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in _PlayVideoPageState._buildMaterialControls at line 995. 7 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/pages/play_video_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/themes/nipaplay/widgets/video_player_ui.dart lib/themes/nipaplay/widgets/video_player_ui.dart:1151— lib/themes/nipaplay/widgets/video_player_ui.dart changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in _VideoPlayerUIState.build at line 1151. 9 of those changes were fix/bug commits, and the other 11 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/video_player_ui.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/player_abstraction/erika_player_adapter.dart lib/player_abstraction/erika_player_adapter.dart:1702— lib/player_abstraction/erika_player_adapter.dart changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ErikaPlayerAdapter._handleEvent at line 1702. 8 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/player_abstraction/erika_player_adapter.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: rust/src/next2_engine/engine/runtime.rs rust/src/next2_engine/engine/runtime.rs:707— rust/src/next2_engine/engine/runtime.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in rust_lib_nipaplay::next2_engine::engine::runtime::run_engine_loop at line 707. 10 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- rust/src/next2_engine/engine/runtime.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/settings/pages/player_settings_content.dart lib/settings/pages/player_settings_content.dart:291— lib/settings/pages/player_settings_content.dart changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in _PlayerSettingsContentState.build at line 291. 1 of those changes was a fix/bug commit, and the other 5 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/settings/pages/player_settings_content.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/themes/nipaplay/widgets/playlist_menu.dart lib/themes/nipaplay/widgets/playlist_menu.dart:680— lib/themes/nipaplay/widgets/playlist_menu.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in _PlaylistMenuState._playEpisode at line 680. 5 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/playlist_menu.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/danmaku_dfm/dfm_plus_overlay.dart lib/danmaku_dfm/dfm_plus_overlay.dart:667— lib/danmaku_dfm/dfm_plus_overlay.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in _DfmPlusOverlayState._tryUpdateTexture at line 667. 7 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/danmaku_dfm/dfm_plus_overlay.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/themes/nipaplay/widgets/library_management_tab.dart lib/themes/nipaplay/widgets/library_management_tab.dart:609— lib/themes/nipaplay/widgets/library_management_tab.dart changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in _LibraryManagementTabState._pickAndScanDirectory at line 609. 7 of those changes were fix/bug commits, and the other 8 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/library_management_tab.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:866— lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in _NipaplayLargeScreenScaffoldLayoutState._dispatchInputCommand at line 866. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/services/webdav_service.dart lib/services/webdav_service.dart:2082— lib/services/webdav_service.dart changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in WebDAVService._searchBreadthFirst at line 2082. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/services/webdav_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/widgets/external_subtitle_overlay.dart lib/widgets/external_subtitle_overlay.dart:163— lib/widgets/external_subtitle_overlay.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in _ExternalSubtitleOverlayState._buildPathBlock at line 163. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/widgets/external_subtitle_overlay.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/player_abstraction/media_kit_player_adapter.dart lib/player_abstraction/media_kit_player_adapter.dart:1002— lib/player_abstraction/media_kit_player_adapter.dart changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in MediaKitPlayerAdapter._addEventListeners at line 1002. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/player_abstraction/media_kit_player_adapter.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/themes/nipaplay/widgets/modern_video_controls.dart lib/themes/nipaplay/widgets/modern_video_controls.dart:660— lib/themes/nipaplay/widgets/modern_video_controls.dart changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in _ModernVideoControlsState.build at line 660. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/modern_video_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/media_library/adaptive_media_collection_view.dart lib/media_library/adaptive_media_collection_view.dart:113— lib/media_library/adaptive_media_collection_view.dart changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in LibraryNewContentTracker.load at line 113. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/media_library/adaptive_media_collection_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/pages/media_server_detail_page.dart lib/pages/media_server_detail_page.dart:1870— lib/pages/media_server_detail_page.dart changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in _MediaServerDetailPageState._playEpisode at line 1870. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/pages/media_server_detail_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/themes/nipaplay/widgets/shared_remote_library_view.dart lib/themes/nipaplay/widgets/shared_remote_library_view.dart:148— lib/themes/nipaplay/widgets/shared_remote_library_view.dart changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in _SharedRemoteLibraryViewState.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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/shared_remote_library_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/settings/pages/danmaku_settings_content.dart lib/settings/pages/danmaku_settings_content.dart:773— lib/settings/pages/danmaku_settings_content.dart changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in _DanmakuSettingsContentState.build at line 773. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/settings/pages/danmaku_settings_content.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/themes/nipaplay/widgets/media_capture_dialog.dart lib/themes/nipaplay/widgets/media_capture_dialog.dart:559— lib/themes/nipaplay/widgets/media_capture_dialog.dart changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in _MediaCaptureDialogContentState._buildImageTab at line 559. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/media_capture_dialog.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/services/dandanplay_service_io.dart lib/services/dandanplay_service_io.dart:1235— lib/services/dandanplay_service_io.dart changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in DandanplayService._getVideoInfoWithMetadata at line 1235. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/services/dandanplay_service_io.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/services/remote_subtitle_service.dart lib/services/remote_subtitle_service.dart:473— lib/services/remote_subtitle_service.dart changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in RemoteSubtitleService._ensureSingleSubtitleCached at line 473. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/services/remote_subtitle_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/themes/nipaplay/widgets/cached_network_image_widget.dart lib/themes/nipaplay/widgets/cached_network_image_widget.dart:403— lib/themes/nipaplay/widgets/cached_network_image_widget.dart changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in _CachedNetworkImageWidgetState.build at line 403. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/cached_network_image_widget.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: lib/themes/nipaplay/widgets/subtitle_list_menu.dart lib/themes/nipaplay/widgets/subtitle_list_menu.dart:580— lib/themes/nipaplay/widgets/subtitle_list_menu.dart changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in _SubtitleListMenuState.build at line 580. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/subtitle_list_menu.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/pages/webdav_browser_page.dart lib/pages/webdav_browser_page.dart:240— lib/pages/webdav_browser_page.dart changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in _WebDAVBrowserPageState._playVideo at line 240. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/pages/webdav_browser_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.
Low cohesion: VideoPlayerState (LCOM4 49) lib/utils/video_player_state.dart:316— VideoPlayerState's methods fall into 49 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 49 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: WebApiService (LCOM4 25) lib/services/web_api_service.dart:24— WebApiService's methods fall into 25 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 25 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: EmbyService (LCOM4 18) lib/services/emby_service.dart:51— EmbyService's methods fall into 18 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 18 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: JellyfinService (LCOM4 17) lib/services/jellyfin_service.dart:26— JellyfinService's methods fall into 17 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 17 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Directory (LCOM4 17) lib/utils/mock_path_provider.dart:9— Directory's methods fall into 17 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 17 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ErikaPlayerAdapter (LCOM4 11) lib/player_abstraction/erika_player_adapter.dart:574— ErikaPlayerAdapter'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: VideoPlayerAdapter (LCOM4 11) lib/player_abstraction/video_player_adapter.dart:19— VideoPlayerAdapter'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: WindowController (LCOM4 9) packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:164— WindowController's methods fall into 9 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 9 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: NipaplayLargeScreenWindowPageRoute (LCOM4 8) lib/themes/nipaplay/widgets/large_screen_window_page.dart:3— NipaplayLargeScreenWindowPageRoute'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: OtherSession (LCOM4 7) lib/models/external_player_session/other_session.dart:15— OtherSession'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: _CupertinoCommentDialogState (LCOM4 7) lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:48— _CupertinoCommentDialogState'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: _CupertinoDanmakuSettingsPaneState (LCOM4 7) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:39— _CupertinoDanmakuSettingsPaneState'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: _BatchDanmakuMatchDialogState (LCOM4 7) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:99— _BatchDanmakuMatchDialogState'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: _NetworkMediaLibraryViewState (LCOM4 7) lib/themes/nipaplay/widgets/network_media_library_view.dart:172— _NetworkMediaLibraryViewState'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: TransparentPageRoute (LCOM4 7) lib/themes/nipaplay/widgets/transparent_page_route.dart:4— TransparentPageRoute'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: _MediaServerDetailPageState (LCOM4 6) lib/pages/media_server_detail_page.dart:120— _MediaServerDetailPageState'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: _PlayVideoPageState (LCOM4 6) lib/pages/play_video_page.dart:97— _PlayVideoPageState'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: MdkPlayerAdapter (LCOM4 6) lib/player_abstraction/mdk_player_adapter_io.dart:212— MdkPlayerAdapter'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: TorrentDownloadService (LCOM4 6) lib/services/torrent_download_service.dart:19— TorrentDownloadService'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: _Step2DialogState (LCOM4 6) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1241— _Step2DialogState'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: _DanmakuSettingsMenuState (LCOM4 6) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:46— _DanmakuSettingsMenuState'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: _LibraryManagementTabState (LCOM4 6) lib/themes/nipaplay/widgets/library_management_tab.dart:236— _LibraryManagementTabState'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: _ManualDanmakuMatchDialogState (LCOM4 6) lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:34— _ManualDanmakuMatchDialogState'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: _NetworkMediaServerDialogState (LCOM4 6) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:379— _NetworkMediaServerDialogState'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: SystemResourceMonitor (LCOM4 6) lib/utils/system_resource_monitor.dart:16— SystemResourceMonitor'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.
Duplicated block (10 lines × 2) lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:21— lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:21-30 | lib/danmaku_gpu/lib/gpu_top_danmaku_renderer.dart:20-29 — before extracting anything, compare `lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart` and `lib/danmaku_gpu/lib/gpu_top_danmaku_renderer.dart` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:21` it does not close everything it opens, so those 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/models/emby_model.dart:402— lib/models/emby_model.dart:402-411 | lib/models/jellyfin_model.dart:427-436 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 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/models/emby_model.dart:402` 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/pages/anime_detail_page.dart:1971— lib/pages/anime_detail_page.dart:1971-1980 | lib/pages/anime_detail_page.dart:2009-2018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/anime_detail_page.dart:1971` it does not close everything it opens, so those 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/pages/torrent_download_page.dart:892— lib/pages/torrent_download_page.dart:892-901 | lib/pages/torrent_download_page.dart:920-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/torrent_download_page.dart:892` 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/providers/emby_provider.dart:505— lib/providers/emby_provider.dart:505-514 | lib/providers/jellyfin_provider.dart:81-90 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/providers/watch_history_provider.dart:414— lib/providers/watch_history_provider.dart:414-423 | lib/providers/watch_history_provider.dart:446-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/watch_history_provider.dart:414` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) lib/services/anime_info/anime_info_service_impl.dart:334— lib/services/anime_info/anime_info_service_impl.dart:334-343 | lib/services/anime_info/anime_info_service_impl.dart:357-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/anime_info/anime_info_service_impl.dart:334` it begins part-way through the construct above it, so those 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/services/danmaku_cache_manager.dart:184— lib/services/danmaku_cache_manager.dart:184-193 | lib/services/danmaku_cache_manager.dart:206-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) lib/services/emby_dandanplay_matcher.dart:989— lib/services/emby_dandanplay_matcher.dart:989-998 | lib/services/jellyfin_dandanplay_matcher.dart:1075-1084 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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 (10 lines × 2) lib/services/emby_service.dart:913— lib/services/emby_service.dart:913-922 | lib/services/jellyfin_service.dart:765-774 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:913` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) lib/services/emby_service.dart:935— lib/services/emby_service.dart:935-944 | lib/services/emby_service.dart:1004-1013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/emby_service.dart:935` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) lib/services/smb_proxy_service.dart:370— lib/services/smb_proxy_service.dart:370-379 | lib/services/smb_service.dart:697-707 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) lib/services/webdav_service.dart:1324— lib/services/webdav_service.dart:1324-1333 | lib/services/webdav_service.dart:1388-1397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/webdav_service.dart:1324` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) lib/settings/pages/network_settings_content.dart:611— lib/settings/pages/network_settings_content.dart:611-620 | lib/settings/widgets/media_server_connection_user_agent_setting.dart:161-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/network_settings_content.dart:611` it begins part-way through the construct above it, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:797— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:797-806 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:719-728 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:797` it does not close everything it opens, so those 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/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:143— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:143-152 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:183-192 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart` and `lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:143` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/custom_media_info_dialog.dart:1455— lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1455-1464 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1494-1503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1455` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/library_management_tab.dart:3307— lib/themes/nipaplay/widgets/library_management_tab.dart:3307-3316 | lib/themes/nipaplay/widgets/library_management_tab.dart:3332-3341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:3307` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/library_management_tab.dart:5263— lib/themes/nipaplay/widgets/library_management_tab.dart:5263-5272 | lib/themes/nipaplay/widgets/library_management_tab.dart:5357-5367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:5263` 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 × 2) lib/themes/nipaplay/widgets/local_library_control_bar.dart:298— lib/themes/nipaplay/widgets/local_library_control_bar.dart:298-307 | lib/themes/nipaplay/widgets/network_media_library_view.dart:2283-2292 — 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/themes/nipaplay/widgets/local_library_control_bar.dart:298` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) lib/services/dandanplay_service_io.dart:650— lib/services/dandanplay_service_io.dart:650-659 | lib/services/dandanplay_service_stub.dart:539-548 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (10 lines × 2) lib/services/emby_dandanplay_matcher.dart:1085— lib/services/emby_dandanplay_matcher.dart:1085-1094 | lib/services/jellyfin_dandanplay_matcher.dart:1159-1168 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/themes/cupertino/widgets/cupertino_remote_text_input_sheet.dart:49— lib/themes/cupertino/widgets/cupertino_remote_text_input_sheet.dart:49-58 | lib/themes/nipaplay/widgets/blur_login_dialog.dart:107-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:255— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:255-264 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:407-416 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:266— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:266-275 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:418-427 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Swallowed exception (empty catch) rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:524— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:537— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:550— 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) packages/media_kit/lib/src/player/web/player/real.dart:290— 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) packages/media_kit/lib/src/player/native/utils/android_helper.dart:34— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/media_kit/lib/src/player/native/utils/android_helper.dart:39— 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) packages/media_kit/lib/src/player/native/utils/android_helper.dart:44— 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) packages/media_kit/lib/src/player/native/utils/android_helper.dart:51— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/media_kit/lib/src/player/native/utils/android_helper.dart:57— 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) packages/media_kit/lib/src/player/native/utils/android_helper.dart:65— 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) packages/media_kit/lib/src/player/native/utils/android_helper.dart:73— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/media_kit/lib/src/player/native/utils/android_helper.dart:81— 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) packages/media_kit/lib/src/player/native/utils/android_helper.dart:89— 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) packages/media_kit/lib/src/player/native/utils/android_helper.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) packages/media_kit/lib/src/player/native/player/real.dart:84— 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) packages/media_kit/lib/src/player/native/player/real.dart:2293— 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) packages/media_kit/lib/src/player/native/core/execmem_restriction.dart:42— 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) packages/media_kit/lib/src/player/native/core/fallback_bitrate_handler.dart:21— 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) packages/media_kit/lib/src/player/native/core/fallback_bitrate_handler.dart:34— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/media_kit/lib/src/player/native/core/native_library.dart:44— 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) packages/media_kit/lib/src/player/native/core/native_library.dart:54— 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) packages/media_kit/lib/ffi/src/utf8.dart:64— 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) packages/fvp-0.37.3/lib/src/media_info.dart:94— 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) packages/fvp-0.37.3/lib/src/media_info.dart:180— 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) packages/fvp-0.37.3/lib/src/media_info.dart:234— 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.
Duplicated block (14 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:484— lib/danmaku_next/nipaplay_next_engine.dart:484-497 | lib/danmaku_next/nipaplay_next_old_engine.dart:361-374 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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/danmaku_next/nipaplay_next_engine.dart:484` 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/danmaku_next/nipaplay_next_old_overlay.dart:88— lib/danmaku_next/nipaplay_next_old_overlay.dart:88-101 | lib/danmaku_next/nipaplay_next_overlay.dart:94-107 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_old_overlay.dart` and `lib/danmaku_next/nipaplay_next_overlay.dart` as WHOLE FILES: this scan already matched 4 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. 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/danmaku_next/nipaplay_next_old_overlay.dart:88` it does not close everything it opens, so those 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 `oldWidget` to `covariant NipaPlayNextOldOverlay` in one and `covariant NipaPlayNextOverlay` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/danmaku_next/nipaplay_next_overlay.dart:110` calls `requestPrebuild` and `lib/danmaku_next/nipaplay_next_old_overlay.dart:102` 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 (14 lines × 2) lib/player_abstraction/erika_player_adapter.dart:1993— lib/player_abstraction/erika_player_adapter.dart:1993-2006 | lib/utils/subtitle_manager.dart:2367-2380 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) lib/player_abstraction/media_kit_player_adapter.dart:3725— lib/player_abstraction/media_kit_player_adapter.dart:3725-3738 | lib/player_abstraction/media_kit_player_adapter.dart:3740-3753 — both copies are in the same file, so extract the 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 (14 lines × 2) lib/providers/shared_remote_library_provider.dart:1761— lib/providers/shared_remote_library_provider.dart:1761-1774 | lib/providers/shared_remote_library_provider.dart:1910-1923 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1761` 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/dandanplay_service_io.dart:367— lib/services/dandanplay_service_io.dart:367-380 | lib/services/dandanplay_service_io.dart:901-914 — both copies are in the same file, so extract the 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/services/dandanplay_service_io.dart:366` calls `getAccountApiBaseUrl` and `lib/services/dandanplay_service_io.dart:900` 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 (14 lines × 2) lib/services/dandanplay_service_io.dart:1338— lib/services/dandanplay_service_io.dart:1338-1351 | lib/services/dandanplay_service_stub.dart:2241-2254 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/dandanplay_service_io.dart:1336` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:2239` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) lib/services/dandanplay_service_io.dart:1354— lib/services/dandanplay_service_io.dart:1354-1367 | lib/services/dandanplay_service_stub.dart:2291-2304 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (14 lines × 2) lib/services/danmaku_spoiler_filter_service.dart:236— lib/services/danmaku_spoiler_filter_service.dart:236-249 | lib/services/danmaku_spoiler_filter_service.dart:279-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/danmaku_spoiler_filter_service.dart:250` calls `toString`, `trim` and `lib/services/danmaku_spoiler_filter_service.dart:293` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) lib/services/emby_dandanplay_matcher.dart:1103— lib/services/emby_dandanplay_matcher.dart:1103-1116 | lib/services/jellyfin_dandanplay_matcher.dart:1177-1190 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) lib/services/emby_service.dart:1763— lib/services/emby_service.dart:1763-1776 | lib/services/jellyfin_service.dart:923-936 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:1763` it does not close everything it opens, so those exact lines 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/services/external_player_console_window_service.dart:43— lib/services/external_player_console_window_service.dart:43-56 | lib/services/external_player_console_window_service.dart:85-98 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/external_player_console_window_service.dart:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) lib/services/local_media_share_api.dart:323— lib/services/local_media_share_api.dart:323-336 | lib/services/local_media_share_api.dart:393-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) lib/services/remote_subtitle_service.dart:1026— lib/services/remote_subtitle_service.dart:1026-1039 | lib/services/remote_subtitle_service.dart:1138-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/services/remote_subtitle_service.dart:1026` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) lib/services/smb_proxy_service.dart:36— lib/services/smb_proxy_service.dart:36-49 | lib/services/webdav_proxy_service.dart:41-54 — before extracting anything, compare `lib/services/smb_proxy_service.dart` and `lib/services/webdav_proxy_service.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) lib/services/web_api_service.dart:537— lib/services/web_api_service.dart:537-550 | lib/services/web_api_service.dart:596-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/web_api_service.dart:537` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:466— lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:466-479 | lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:804-817 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:466` it does not close everything it opens, so those 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/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:1203— lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:1203-1216 | lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:1236-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. 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/themes/cupertino/widgets/cupertino_comment_dialog.dart:199— lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:199-212 | lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:229-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/cupertino_comment_dialog.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 (14 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:61— lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:61-74 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:221-234 — 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 (14 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:592— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:592-605 | lib/themes/nipaplay/widgets/playlist_menu.dart:1087-1100 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (14 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:205— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:205-218 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:317-330 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_list_menu.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/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:205` it does not close everything it opens, so those 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/themes/nipaplay/pages/settings/dependency_versions_window.dart:148— lib/themes/nipaplay/pages/settings/dependency_versions_window.dart:148-161 | lib/themes/nipaplay/pages/settings/nipaplay_ui_preview_window.dart:53-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/dependency_versions_window.dart:148` it does not close everything it opens, so those exact lines 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/themes/nipaplay/pages/settings/watch_history_page.dart:389— lib/themes/nipaplay/pages/settings/watch_history_page.dart:389-402 | lib/themes/nipaplay/pages/settings/watch_history_page.dart:415-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/watch_history_page.dart:389` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/danmaku_offset_menu.dart:217— lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:217-230 | lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:249-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:217` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/danmaku_offset_menu.dart:247` calls `SizedBox`, `_buildOffsetButton` and `lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:217` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:440— lib/danmaku_dfm/dfm_plus_layout_bridge.dart:440-446 | lib/danmaku_next/next2_layout_bridge.dart:133-139 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_layout_bridge.dart` and `lib/danmaku_next/next2_layout_bridge.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/danmaku_dfm/dfm_plus_layout_bridge.dart:440` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) lib/models/emby_model.dart:370— lib/models/emby_model.dart:370-376 | lib/models/emby_model.dart:379-385 — both copies are in the same file, so extract the block into 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/plugins/plugin_service.dart:1457— lib/plugins/plugin_service.dart:1457-1463 | lib/themes/nipaplay/widgets/plugin_market_dialog.dart:225-231 — 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/plugins/plugin_service.dart:1457` 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/services/dandanplay_remote_service.dart:343— lib/services/dandanplay_remote_service.dart:343-350 | lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:352-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) lib/services/danmaku_spoiler_filter_service.dart:230— lib/services/danmaku_spoiler_filter_service.dart:230-236 | lib/services/danmaku_spoiler_filter_service.dart:257-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/danmaku_spoiler_filter_service.dart:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/services/desktop_player_window_service.dart:393— lib/services/desktop_player_window_service.dart:393-399 | lib/services/desktop_player_window_service.dart:402-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) lib/services/emby_service.dart:832— lib/services/emby_service.dart:832-838 | lib/services/jellyfin_service.dart:693-699 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:832` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/services/remote_control_client_service.dart:29— lib/services/remote_control_client_service.dart:29-35 | lib/utils/network_settings.dart:406-412 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/remote_control_client_service.dart:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/remote_control_client_service.dart:36` calls `endsWith`, `substring` and `lib/utils/network_settings.dart:413` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) lib/services/remote_subtitle_service.dart:277— lib/services/remote_subtitle_service.dart:277-283 | lib/services/remote_subtitle_service.dart:492-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.
Duplicated block (7 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:326— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:326-332 | lib/themes/nipaplay/widgets/playlist_menu.dart:420-426 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:326` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:63— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:63-69 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:70-76 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/nipaplay/widgets/background_with_blur.dart:50— lib/themes/nipaplay/widgets/background_with_blur.dart:50-56 | lib/themes/nipaplay/widgets/background_with_blur.dart:58-64 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/background_with_blur.dart:50` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/themes/nipaplay/widgets/large_screen_mode_actions.dart:271— lib/themes/nipaplay/widgets/large_screen_mode_actions.dart:271-277 | lib/themes/nipaplay/widgets/large_screen_mode_actions.dart:359-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/large_screen_mode_actions.dart:271` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/smb_connection_dialog.dart:14— lib/themes/nipaplay/widgets/smb_connection_dialog.dart:14-20 | lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:15-21 — 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/themes/nipaplay/widgets/smb_connection_dialog.dart:14` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) lib/services/local_media_management_api.dart:158— lib/services/local_media_management_api.dart:158-164 | lib/services/local_media_management_api.dart:341-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) lib/utils/hotkey_service.dart:611— lib/utils/hotkey_service.dart:611-617 | lib/utils/hotkey_service.dart:670-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/hotkey_service.dart:611` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) lib/providers/emby_provider.dart:60— lib/providers/emby_provider.dart:60-66 | lib/providers/jellyfin_provider.dart:60-66 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/services/emby_service.dart:2011— lib/services/emby_service.dart:2011-2017 | lib/services/jellyfin_service.dart:1908-1914 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/local_media_management_api.dart:1070— lib/services/local_media_management_api.dart:1070-1076 | lib/services/network_media_settings_api.dart:178-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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/themes/cupertino/widgets/cupertino_comment_dialog.dart:80— lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:80-86 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:152-158 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_comment_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:51— lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:51-57 | lib/themes/nipaplay/widgets/playback_rate_menu.dart:59-65 — 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 (7 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:209— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:209-215 | lib/themes/nipaplay/widgets/playlist_menu.dart:313-319 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:176— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:176-183 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:213-219 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:211— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:211-217 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:247-253 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:187— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:187-193 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:109-116 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) lib/danmaku_dfm/dfm_plus_overlay.dart:264— lib/danmaku_dfm/dfm_plus_overlay.dart:264-272 | lib/danmaku_next/nipaplay_next2_overlay.dart:93-101 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_overlay.dart` and `lib/danmaku_next/nipaplay_next2_overlay.dart` as WHOLE FILES: this scan already matched 4 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `oldWidget` to `covariant DfmPlusOverlay` in one and `covariant NipaPlayNext2Overlay` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:219— lib/danmaku_next/nipaplay_next_engine.dart:219-227 | lib/danmaku_next/nipaplay_next_old_engine.dart:210-218 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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/danmaku_next/nipaplay_next_engine.dart:219` it does not close everything it opens, so those 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/pages/torrent_download_page.dart:2685— lib/pages/torrent_download_page.dart:2685-2693 | lib/pages/webdav_browser_page.dart:2219-2227 — 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/pages/torrent_download_page.dart:2685` it does not close everything it opens, so those exact lines 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/player_abstraction/media_kit_player_adapter.dart:1813— lib/player_abstraction/media_kit_player_adapter.dart:1813-1822 | lib/player_abstraction/media_kit_player_adapter.dart:2097-2105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/media_kit_player_adapter.dart:1813` it does not close everything it opens, so those exact lines 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/bangumi_service.dart:618— lib/services/bangumi_service.dart:618-626 | lib/services/bangumi_service.dart:722-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/services/bangumi_service.dart:618` it does not close everything it opens, so those exact lines 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/dandanplay_service_io.dart:736— lib/services/dandanplay_service_io.dart:736-744 | lib/services/dandanplay_service_stub.dart:620-628 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (9 lines × 2) lib/services/dandanplay_service_io.dart:750— lib/services/dandanplay_service_io.dart:750-758 | lib/services/dandanplay_service_stub.dart:666-674 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.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 (9 lines × 2) lib/services/dandanplay_service_io.dart:825— lib/services/dandanplay_service_io.dart:825-833 | lib/services/dandanplay_service_stub.dart:768-776 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:825` it does not close everything it opens, so those 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/dandanplay_service_io.dart:822` calls `getBangumiOAuthLoginUrl` and `lib/services/dandanplay_service_stub.dart:766` 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/services/dandanplay_service_io.dart:2526— lib/services/dandanplay_service_io.dart:2526-2534 | lib/services/dandanplay_service_io.dart:2660-2668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/dandanplay_service_io.dart:2526` it does not close everything it opens, so those exact lines 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/dandanplay_service_stub.dart:1067— lib/services/dandanplay_service_stub.dart:1067-1075 | lib/services/dandanplay_service_stub.dart:1632-1640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:1067` it begins part-way through the construct above it, so those 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/dandanplay_service_stub.dart:1630` calls `Exception` and `lib/services/dandanplay_service_stub.dart:1066` 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/services/episode_navigation_service.dart:1244— lib/services/episode_navigation_service.dart:1244-1252 | lib/services/playback_source_service.dart:621-629 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) lib/services/full_backup_service.dart:358— lib/services/full_backup_service.dart:358-366 | lib/services/web_api_service.dart:727-735 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) lib/services/playback_source_service.dart:500— lib/services/playback_source_service.dart:500-508 | lib/services/playback_source_service.dart:550-558 — both copies are in the same file, so extract the 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/services/playback_source_service.dart:549` calls `split` and `lib/services/playback_source_service.dart:499` 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/services/remote_subtitle_service.dart:1630— lib/services/remote_subtitle_service.dart:1630-1638 | lib/services/remote_subtitle_service.dart:1734-1742 — both copies are in the same file, so extract the block into 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/settings/pages/plugin_settings_content.dart:640— lib/settings/pages/plugin_settings_content.dart:640-648 | lib/settings/pages/plugin_settings_content.dart:759-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/plugin_settings_content.dart:640` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:196— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:196-204 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:275-283 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:55— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:55-63 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:56-64 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart` and `lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:64` calls `_loadServerSubtitles` and `lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:65` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:812— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:812-820 | lib/utils/auto_sync_settings.dart:203-211 — 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/themes/nipaplay/pages/settings/backup_restore_page.dart:812` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:1019— lib/themes/nipaplay/widgets/library_management_tab.dart:1019-1027 | lib/themes/nipaplay/widgets/library_management_tab.dart:1031-1039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:1019` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/library_management_tab.dart:6169— lib/themes/nipaplay/widgets/library_management_tab.dart:6169-6178 | lib/themes/nipaplay/widgets/library_management_tab.dart:6394-6402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:6169` 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 `file` to `WebDAVFile` in one and `SMBFileEntry` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:6405— lib/themes/nipaplay/widgets/library_management_tab.dart:6405-6413 | lib/themes/nipaplay/widgets/library_management_tab.dart:6553-6561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:6405` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/modern_video_controls.dart:343— lib/themes/nipaplay/widgets/modern_video_controls.dart:343-351 | lib/themes/nipaplay/widgets/modern_video_controls.dart:408-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/modern_video_controls.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 (9 lines × 2) lib/themes/nipaplay/widgets/plugin_market_dialog.dart:44— lib/themes/nipaplay/widgets/plugin_market_dialog.dart:44-52 | lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:30-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/plugin_market_dialog.dart:44` it does not close everything it opens, so those 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/models/external_player_session/mpv_session.dart:575— lib/models/external_player_session/mpv_session.dart:575-583 | lib/models/external_player_session/other_session.dart:226-234 — 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/models/external_player_session/mpv_session.dart:575` it begins part-way through the construct above it, so those exact lines 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/player_abstraction/erika_player_adapter.dart:345— lib/player_abstraction/erika_player_adapter.dart:345-353 | lib/widgets/macos_native_video_view.dart:332-340 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:120— lib/danmaku_dfm/dfm_plus_layout_bridge.dart:120-130 | lib/danmaku_next/next2_layout_bridge.dart:52-62 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_layout_bridge.dart` and `lib/danmaku_next/next2_layout_bridge.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/danmaku_dfm/dfm_plus_layout_bridge.dart:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) lib/models/emby_model.dart:186— lib/models/emby_model.dart:186-196 | lib/models/jellyfin_model.dart:212-222 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 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/models/emby_model.dart:186` 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/models/emby_model.dart:267— lib/models/emby_model.dart:267-277 | lib/models/jellyfin_model.dart:293-303 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) lib/pages/webdav_browser_page.dart:280— lib/pages/webdav_browser_page.dart:280-290 | lib/pages/webdav_browser_page.dart:354-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/webdav_browser_page.dart:280` it begins part-way through the construct above it, so those exact lines 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/providers/emby_provider.dart:324— lib/providers/emby_provider.dart:324-334 | lib/providers/jellyfin_provider.dart:357-367 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/providers/emby_provider.dart:324` it does not close everything it opens, so those exact lines 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/providers/emby_provider.dart:396— lib/providers/emby_provider.dart:396-406 | lib/providers/jellyfin_provider.dart:424-434 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) lib/services/dandanplay_service_io.dart:1128— lib/services/dandanplay_service_io.dart:1128-1138 | lib/services/dandanplay_service_stub.dart:1151-1161 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1128` it does not close everything it opens, so those exact lines 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/services/danmaku_spoiler_filter_service.dart:250— lib/services/danmaku_spoiler_filter_service.dart:250-260 | lib/services/danmaku_spoiler_filter_service.dart:269-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/services/danmaku_spoiler_filter_service.dart:250` it begins part-way through the construct above it, so those exact lines 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/services/emby_service.dart:1033— lib/services/emby_service.dart:1033-1043 | lib/services/jellyfin_service.dart:825-835 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:1033` it begins part-way through the construct above it, so those exact lines 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/services/episode_navigation_service.dart:1162— lib/services/episode_navigation_service.dart:1162-1172 | lib/services/episode_navigation_service.dart:1219-1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/episode_navigation_service.dart:1162` 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/services/remote_control_client_service.dart:30— lib/services/remote_control_client_service.dart:30-40 | lib/services/web_remote_access_service.dart:95-105 — 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 (11 lines × 2) lib/services/shared_remote_playback_sync_service.dart:75— lib/services/shared_remote_playback_sync_service.dart:75-85 | lib/services/shared_remote_playback_sync_service.dart:155-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/shared_remote_playback_sync_service.dart:75` it begins part-way through the construct above it, so those exact lines 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/services/web_api_service.dart:920— lib/services/web_api_service.dart:920-930 | lib/services/web_api_service.dart:934-944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) lib/settings/pages/remote_access_receiver_settings_section.dart:765— lib/settings/pages/remote_access_receiver_settings_section.dart:765-775 | lib/settings/pages/remote_media_library_settings_content.dart:454-464 — 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/settings/pages/remote_access_receiver_settings_section.dart:765` it does not close everything it opens, so those 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:224— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:224-234 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:135-145 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart` and `lib/themes/cupertino/widgets/cupertino_rating_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:224` it does not close everything it opens, so those 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:139— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:139-149 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:294-305 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:139` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/blur_dialog.dart:118— lib/themes/nipaplay/widgets/blur_dialog.dart:118-128 | lib/themes/nipaplay/widgets/blur_dialog.dart:144-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/blur_dialog.dart:118` 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/themes/nipaplay/widgets/blur_login_dialog.dart:172— lib/themes/nipaplay/widgets/blur_login_dialog.dart:172-182 | lib/themes/nipaplay/widgets/web_remote_access_gate.dart:175-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:687— lib/themes/nipaplay/widgets/library_management_tab.dart:687-697 | lib/themes/nipaplay/widgets/library_management_tab.dart:1709-1719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:687` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/library_management_tab.dart:933— lib/themes/nipaplay/widgets/library_management_tab.dart:933-943 | lib/themes/nipaplay/widgets/library_management_tab.dart:946-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:933` it does not close everything it opens, so those 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/themes/nipaplay/widgets/library_management_tab.dart:4372— lib/themes/nipaplay/widgets/library_management_tab.dart:4372-4382 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1133-1143 — before extracting anything, compare `lib/themes/nipaplay/widgets/library_management_tab.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 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/themes/nipaplay/widgets/playlist_menu.dart:1041— lib/themes/nipaplay/widgets/playlist_menu.dart:1041-1051 | lib/themes/nipaplay/widgets/playlist_menu.dart:1059-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/themes/nipaplay/widgets/playlist_menu.dart:1041` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/themes/nipaplay/widgets/playlist_menu.dart:1056` calls `split` and `lib/themes/nipaplay/widgets/playlist_menu.dart:1039` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) lib/themes/nipaplay/widgets/rating_dialog.dart:212— lib/themes/nipaplay/widgets/rating_dialog.dart:212-222 | lib/themes/nipaplay/widgets/rating_dialog.dart:259-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/rating_dialog.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.
Duplicated block (11 lines × 2) lib/widgets/danmaku_overlay.dart:90— lib/widgets/danmaku_overlay.dart:90-100 | lib/widgets/danmaku_overlay.dart:258-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:164— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:164-174 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:201-211 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (8 lines × 2) lib/models/watch_history_database.dart:344— lib/models/watch_history_database.dart:344-351 | lib/models/watch_history_database.dart:370-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/watch_history_database.dart:344` it does not close everything it opens, so those exact lines 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/watch_history_database.dart:961— lib/models/watch_history_database.dart:961-968 | lib/models/watch_history_model.dart:851-858 — 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/models/watch_history_database.dart:961` it begins part-way through the construct above it, so those exact lines 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/pages/media_server_detail_page.dart:1147— lib/pages/media_server_detail_page.dart:1147-1154 | lib/pages/media_server_detail_page.dart:1547-1554 — both copies are in the same file, so extract the block into 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/pages/torrent_download_page.dart:1582— lib/pages/torrent_download_page.dart:1582-1589 | lib/pages/torrent_download_page.dart:1685-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/pages/torrent_download_page.dart:1582` it does not close everything it opens, so those exact lines 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/pages/webdav_browser_page.dart:270— lib/pages/webdav_browser_page.dart:270-277 | lib/pages/webdav_browser_page.dart:318-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/pages/webdav_browser_page.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.
Duplicated block (8 lines × 2) lib/services/dandanplay_remote_service.dart:359— lib/services/dandanplay_remote_service.dart:359-366 | lib/services/media_server_service_base.dart:203-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/media_server_service_base.dart:203` it does not close everything it opens, so those 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/services/dandanplay_service_io.dart:109— lib/services/dandanplay_service_io.dart:109-116 | lib/services/dandanplay_service_stub.dart:105-112 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) lib/services/dandanplay_service_io.dart:175— lib/services/dandanplay_service_io.dart:175-182 | lib/services/dandanplay_service_stub.dart:180-187 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:175` it does not close everything it opens, so those exact lines 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/services/desktop_exit_handler.dart:272— lib/services/desktop_exit_handler.dart:272-279 | lib/services/desktop_exit_handler.dart:288-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/desktop_exit_handler.dart:272` it does not close everything it opens, so those exact lines 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/settings/pages/remote_media_library_settings_content.dart:114— lib/settings/pages/remote_media_library_settings_content.dart:114-122 | lib/settings/pages/remote_media_library_settings_content.dart:136-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) lib/themes/cupertino/widgets/cupertino_build_info_sheet.dart:35— lib/themes/cupertino/widgets/cupertino_build_info_sheet.dart:35-42 | lib/themes/cupertino/widgets/cupertino_dependency_versions_sheet.dart:89-96 — 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/themes/cupertino/widgets/cupertino_build_info_sheet.dart:35` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/cupertino_dependency_versions_sheet.dart:141— lib/themes/cupertino/widgets/cupertino_dependency_versions_sheet.dart:141-148 | lib/themes/nipaplay/pages/settings/dependency_versions_window.dart:72-79 — 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/themes/cupertino/widgets/emby_media_selection_sheet.dart:58— lib/themes/cupertino/widgets/emby_media_selection_sheet.dart:58-65 | lib/themes/nipaplay/widgets/emby_media_selection_dialog.dart:89-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:380— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:380-387 | lib/themes/nipaplay/widgets/audio_tracks_menu.dart:322-329 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart` and `lib/themes/nipaplay/widgets/audio_tracks_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:380` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_playback_info_pane.dart:19— lib/themes/cupertino/widgets/player_menu/cupertino_playback_info_pane.dart:19-28 | lib/themes/nipaplay/widgets/playback_info_menu.dart:803-810 — 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/themes/cupertino/widgets/player_menu/cupertino_playback_info_pane.dart:19` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:486— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:486-493 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1293-1300 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 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/themes/nipaplay/widgets/batch_danmaku_dialog.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. 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:484` calls `withOpacity` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1291` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:139— lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:139-146 | lib/utils/subtitle_manager.dart:452-459 — 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/themes/nipaplay/widgets/subtitle_tracks_menu.dart:139` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:137` calls `basename` and `lib/utils/subtitle_manager.dart:451` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:401— lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:401-408 | lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:467-474 — both copies are in the same file, so extract the block into 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/danmaku_dfm/dfm_plus_overlay.dart:485— lib/danmaku_dfm/dfm_plus_overlay.dart:485-492 | lib/danmaku_next/nipaplay_next2_overlay.dart:183-190 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_overlay.dart` and `lib/danmaku_next/nipaplay_next2_overlay.dart` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (8 lines × 2) lib/models/external_player_session/other_session.dart:183— lib/models/external_player_session/other_session.dart:183-190 | lib/models/external_player_session/vlc_session.dart:177-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) lib/providers/emby_provider.dart:79— lib/providers/emby_provider.dart:79-86 | lib/providers/jellyfin_provider.dart:116-123 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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 (8 lines × 2) lib/providers/emby_provider.dart:113— lib/providers/emby_provider.dart:113-120 | lib/providers/jellyfin_provider.dart:150-157 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) lib/services/emby_dandanplay_matcher.dart:971— lib/services/emby_dandanplay_matcher.dart:971-978 | lib/services/jellyfin_dandanplay_matcher.dart:1057-1064 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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 (8 lines × 2) lib/services/emby_dandanplay_matcher.dart:980— lib/services/emby_dandanplay_matcher.dart:980-987 | lib/services/jellyfin_dandanplay_matcher.dart:1066-1073 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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 (8 lines × 2) lib/services/smb_service.dart:559— lib/services/smb_service.dart:559-566 | lib/services/webdav_service.dart:697-704 — 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/danmaku_next/msdf_font_atlas.dart:457— lib/danmaku_next/msdf_font_atlas.dart:457-471 | lib/danmaku_next/msdf_font_atlas.dart:478-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/danmaku_next/msdf_font_atlas.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. 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/media_library/adaptive_media_collection_view.dart:141— lib/media_library/adaptive_media_collection_view.dart:141-155 | lib/media_library/adaptive_media_collection_view.dart:338-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/media_library/adaptive_media_collection_view.dart:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) lib/models/watch_history_model.dart:675— lib/models/watch_history_model.dart:675-689 | lib/models/watch_history_model.dart:704-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/watch_history_model.dart:675` it begins part-way through the construct above it, so those 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/models/watch_history_model.dart:700` calls `getAllHistory` and `lib/models/watch_history_model.dart:671` 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/pages/external_player_console_page.dart:292— lib/pages/external_player_console_page.dart:292-306 | lib/pages/external_player_console_page.dart:375-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/external_player_console_page.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.
Duplicated block (15 lines × 2) lib/pages/play_video_page.dart:131— lib/pages/play_video_page.dart:131-145 | lib/themes/nipaplay/widgets/custom_scaffold.dart:66-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) lib/player_abstraction/player_abstraction.dart:309— lib/player_abstraction/player_abstraction.dart:309-323 | lib/player_abstraction/player_abstraction.dart:328-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. 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/plugins/plugin_service.dart:369— lib/plugins/plugin_service.dart:369-383 | lib/themes/nipaplay/widgets/plugin_market_dialog.dart:149-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) lib/services/dandanplay_service_io.dart:2610— lib/services/dandanplay_service_io.dart:2610-2624 | lib/services/dandanplay_service_stub.dart:2012-2026 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2610` 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/services/dandanplay_service_io.dart:2661— lib/services/dandanplay_service_io.dart:2661-2675 | lib/services/dandanplay_service_stub.dart:2074-2088 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2661` it begins part-way through the construct above it, so those 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/services/dandanplay_service_io.dart:2677` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:2090` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) lib/services/dandanplay_service_io.dart:2785— lib/services/dandanplay_service_io.dart:2785-2799 | lib/services/dandanplay_service_stub.dart:2580-2594 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (15 lines × 2) lib/services/dandanplay_service_stub.dart:1900— lib/services/dandanplay_service_stub.dart:1900-1914 | lib/services/dandanplay_service_stub.dart:1968-1982 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:1900` it begins part-way through the construct above it, so those 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/dandanplay_service_stub.dart:1899` calls `encode` and `lib/services/dandanplay_service_stub.dart:1967` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) lib/services/emby_dandanplay_matcher.dart:713— lib/services/emby_dandanplay_matcher.dart:713-727 | lib/services/jellyfin_dandanplay_matcher.dart:748-762 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:713` it does not close everything it opens, so those 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/services/jellyfin_dandanplay_matcher.dart:765` calls `debugPrint` and `lib/services/emby_dandanplay_matcher.dart:729` 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/services/emby_service.dart:1049— lib/services/emby_service.dart:1049-1063 | lib/services/jellyfin_service.dart:841-855 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:1049` 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/settings/pages/remote_access_receiver_settings_section.dart:488— lib/settings/pages/remote_access_receiver_settings_section.dart:488-502 | lib/themes/nipaplay/pages/settings/debug_log_viewer_page.dart:656-670 — 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/settings/pages/remote_access_receiver_settings_section.dart:488` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:229— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:229-243 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:273-287 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart` and `lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 127 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:229` it does not close everything it opens, so those 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:322— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:322-336 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_tracks_pane.dart:79-93 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_tracks_pane.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:322` 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/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:177— lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:177-191 | lib/themes/cupertino/widgets/player_menu/cupertino_seek_step_pane.dart:168-182 — 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/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:177` 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/themes/nipaplay/widgets/anime_detail_shell.dart:116— lib/themes/nipaplay/widgets/anime_detail_shell.dart:116-130 | lib/themes/nipaplay/widgets/anime_detail_shell.dart:131-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/anime_detail_shell.dart:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) lib/themes/nipaplay/widgets/brightness_gesture_area.dart:69— lib/themes/nipaplay/widgets/brightness_gesture_area.dart:69-83 | lib/themes/nipaplay/widgets/volume_gesture_area.dart:69-83 — before extracting anything, compare `lib/themes/nipaplay/widgets/brightness_gesture_area.dart` and `lib/themes/nipaplay/widgets/volume_gesture_area.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/brightness_gesture_area.dart:69` 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/themes/nipaplay/widgets/library_management_tab.dart:748— lib/themes/nipaplay/widgets/library_management_tab.dart:748-762 | lib/themes/nipaplay/widgets/library_management_tab.dart:784-798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:748` 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 `child` to `const Text("打开设置", locale: Locale("zh-Hans", "zh"), style: TextStyle(color: Colors.lightBlueAccent))` in one and `const Text("知道了", locale: Locale("zh-Hans", "zh"), style: TextStyle(color: Colors.lightBlueAccent))` 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 (15 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:1888— lib/themes/nipaplay/widgets/library_management_tab.dart:1888-1902 | lib/themes/nipaplay/widgets/library_management_tab.dart:2066-2080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:1888` 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/themes/nipaplay/widgets/library_management_tab.dart:1904` calls `_buildSortDropdown` and `lib/themes/nipaplay/widgets/library_management_tab.dart:2082` 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/themes/nipaplay/widgets/playback_info_menu.dart:437— lib/themes/nipaplay/widgets/playback_info_menu.dart:437-451 | lib/themes/nipaplay/widgets/playback_info_menu.dart:714-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/playback_info_menu.dart:437` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/shared_remote_library_view.dart:669— lib/themes/nipaplay/widgets/shared_remote_library_view.dart:669-683 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:841-855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/shared_remote_library_view.dart:669` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:785— lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:785-799 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:919-933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) lib/widgets/danmaku_overlay.dart:166— lib/widgets/danmaku_overlay.dart:166-180 | lib/widgets/danmaku_overlay.dart:185-199 — both copies are in the same file, so extract the block into 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/danmaku_next/nipaplay_next_engine.dart:1141— lib/danmaku_next/nipaplay_next_engine.dart:1141-1153 | lib/danmaku_next/nipaplay_next_old_engine.dart:975-987 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (13 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:1155— lib/danmaku_next/nipaplay_next_engine.dart:1155-1167 | lib/danmaku_next/nipaplay_next_old_engine.dart:989-1001 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (13 lines × 2) lib/danmaku_next/nipaplay_next_old_overlay.dart:159— lib/danmaku_next/nipaplay_next_old_overlay.dart:159-171 | lib/danmaku_next/nipaplay_next_overlay.dart:185-197 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_old_overlay.dart` and `lib/danmaku_next/nipaplay_next_overlay.dart` as WHOLE FILES: this scan already matched 4 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. 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/danmaku_next/nipaplay_next_old_overlay.dart:159` it begins part-way through the construct above it, so those exact lines 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/models/emby_model.dart:415— lib/models/emby_model.dart:415-427 | lib/models/jellyfin_model.dart:440-452 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) lib/models/external_player_session/mpv_session.dart:599— lib/models/external_player_session/mpv_session.dart:599-611 | lib/models/external_player_session/other_session.dart:212-224 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) lib/player_abstraction/player_factory.dart:128— lib/player_abstraction/player_factory.dart:128-140 | lib/player_abstraction/player_factory.dart:199-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/player_abstraction/player_factory.dart:125` calls `_clampPrecacheBufferSizeMb` and `lib/player_abstraction/player_factory.dart:198` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) lib/services/dandanplay_service_io.dart:2059— lib/services/dandanplay_service_io.dart:2059-2071 | lib/services/dandanplay_service_stub.dart:1550-1562 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2398— lib/services/dandanplay_service_io.dart:2398-2410 | lib/services/dandanplay_service_stub.dart:1775-1787 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2398` it begins part-way through the construct above it, so those exact lines 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/services/emby_service.dart:462— lib/services/emby_service.dart:462-474 | lib/services/jellyfin_service.dart:1949-1961 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:749— lib/services/emby_service.dart:749-761 | lib/services/jellyfin_service.dart:565-577 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/full_backup_service.dart:970— lib/services/full_backup_service.dart:970-982 | lib/services/full_backup_service.dart:1022-1034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/full_backup_service.dart:970` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) lib/services/local_media_share_service.dart:918— lib/services/local_media_share_service.dart:918-930 | lib/services/local_media_share_service.dart:982-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.
Duplicated block (13 lines × 2) lib/settings/pages/player_settings_content.dart:584— lib/settings/pages/player_settings_content.dart:584-596 | lib/settings/pages/player_settings_content.dart:986-998 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/player_settings_content.dart:584` 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:163— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:163-175 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:98-110 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart` and `lib/themes/cupertino/widgets/cupertino_rating_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:111` calls `of`, `copyWith` and `lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:176` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:245— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:245-257 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:289-301 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart` and `lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 127 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:245` 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:151— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:151-163 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:222-234 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.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.
Duplicated block (13 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:300— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:300-312 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:418-430 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_list_menu.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. 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:910— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:910-922 | lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:1029-1041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:910` it does not close everything it opens, so those 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/themes/nipaplay/widgets/blur_dropdown.dart:390— lib/themes/nipaplay/widgets/blur_dropdown.dart:390-402 | lib/themes/nipaplay/widgets/blur_dropdown.dart:424-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/blur_dropdown.dart:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/themes/nipaplay/widgets/blur_dropdown.dart:422` calls `_handleMenuKeyEvent` and `lib/themes/nipaplay/widgets/blur_dropdown.dart:388` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) lib/themes/nipaplay/widgets/danmaku_list_menu.dart:86— lib/themes/nipaplay/widgets/danmaku_list_menu.dart:86-98 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:99-111 — before extracting anything, compare `lib/themes/nipaplay/widgets/danmaku_list_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_list_menu.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 92 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/themes/nipaplay/widgets/danmaku_list_menu.dart:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:143— lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:143-155 | lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:206-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/themes/nipaplay/widgets/danmaku_offset_menu.dart:143` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:616— lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:616-628 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:526-538 — before extracting anything, compare `lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart` and `lib/themes/nipaplay/widgets/large_screen_settings_panel.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. 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/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:329— lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:329-341 | lib/themes/nipaplay/widgets/video_player_ui.dart:226-238 — 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/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:329` it begins part-way through the construct above it, so those 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/widgets/danmaku_container.dart:584— lib/widgets/danmaku_container.dart:584-596 | lib/widgets/danmaku_container.dart:699-711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/danmaku_container.dart:584` it does not close everything it opens, so those exact lines 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/models/emby_model.dart:85— lib/models/emby_model.dart:85-97 | lib/models/jellyfin_model.dart:108-120 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 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 (12 lines × 2) lib/danmaku_next/next2_emoji_pipeline.dart:130— lib/danmaku_next/next2_emoji_pipeline.dart:130-141 | lib/danmaku_next/next2_texture_bridge.dart:264-275 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) lib/models/emby_model.dart:101— lib/models/emby_model.dart:101-112 | lib/models/jellyfin_model.dart:124-135 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) lib/models/watch_history_model.dart:392— lib/models/watch_history_model.dart:392-403 | lib/models/watch_history_model.dart:434-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/models/watch_history_model.dart:392` it does not close everything it opens, so those 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/player_abstraction/media_kit_player_adapter.dart:3546— lib/player_abstraction/media_kit_player_adapter.dart:3546-3557 | lib/player_abstraction/media_kit_player_adapter.dart:3692-3703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/media_kit_player_adapter.dart:3546` it does not close everything it opens, so those exact lines 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/services/concurrent_video_processor.dart:178— lib/services/concurrent_video_processor.dart:178-189 | lib/services/concurrent_video_processor.dart:193-204 — both copies are in the same file, so extract the block into 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/services/dandanplay_service_stub.dart:1208— lib/services/dandanplay_service_stub.dart:1208-1219 | lib/services/dandanplay_service_stub.dart:2060-2071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:1208` it begins part-way through the construct above it, so those exact lines 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/services/local_media_management_api.dart:1181— lib/services/local_media_management_api.dart:1181-1192 | lib/services/local_media_share_service.dart:1100-1111 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_management_api.dart:1181` it begins part-way through the construct above it, so those exact lines 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/services/player_remote_control_bridge.dart:488— lib/services/player_remote_control_bridge.dart:488-499 | lib/services/player_remote_control_bridge.dart:548-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/player_remote_control_bridge.dart:488` it does not close everything it opens, so those exact lines 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/services/remote_subtitle_service.dart:1256— lib/services/remote_subtitle_service.dart:1256-1267 | lib/services/remote_subtitle_service.dart:1374-1385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/remote_subtitle_service.dart:1256` 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/services/remote_subtitle_service.dart:1387` calls `debugPrint` and `lib/services/remote_subtitle_service.dart:1268` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) lib/settings/adaptive_settings_widgets.dart:116— lib/settings/adaptive_settings_widgets.dart:116-127 | lib/settings/adaptive_settings_widgets.dart:145-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/adaptive_settings_widgets.dart:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) lib/settings/adaptive_settings_widgets.dart:391— lib/settings/adaptive_settings_widgets.dart:391-402 | lib/settings/adaptive_settings_widgets.dart:649-660 — both copies are in the same file, so extract the 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 (12 lines × 2) lib/settings/pages/about_settings_content.dart:564— lib/settings/pages/about_settings_content.dart:564-575 | lib/themes/nipaplay/widgets/startup_notification_controller.dart:106-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/about_settings_content.dart:564` it does not close everything it opens, so those 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/settings/pages/developer_options_settings_content.dart:634— lib/settings/pages/developer_options_settings_content.dart:634-645 | lib/settings/pages/developer_options_settings_content.dart:791-802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/developer_options_settings_content.dart:634` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:183— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:183-194 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:262-273 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (12 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:286— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:286-297 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:429-440 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (12 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:129— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:129-140 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:169-180 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart` and `lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.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.
Duplicated block (12 lines × 2) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:488— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:488-499 | lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:573-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:488` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/danmaku_offset_menu.dart:128— lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:128-139 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1121-1132 — 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/themes/nipaplay/widgets/danmaku_offset_menu.dart:128` it does not close everything it opens, so those 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/themes/nipaplay/widgets/library_management_tab.dart:3195— lib/themes/nipaplay/widgets/library_management_tab.dart:3195-3206 | lib/themes/nipaplay/widgets/library_management_tab.dart:3254-3265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:3195` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/nipaplay_window.dart:189— lib/themes/nipaplay/widgets/nipaplay_window.dart:189-200 | lib/themes/nipaplay/widgets/nipaplay_window.dart:225-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/nipaplay_window.dart:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) lib/themes/nipaplay/widgets/playlist_menu.dart:725— lib/themes/nipaplay/widgets/playlist_menu.dart:725-736 | lib/themes/nipaplay/widgets/playlist_menu.dart:827-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/themes/nipaplay/widgets/playlist_menu.dart:725` it begins part-way through the construct above it, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:242— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:242-253 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:394-405 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:174— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:174-185 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:96-107 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) lib/pages/media_server_detail_page.dart:790— lib/pages/media_server_detail_page.dart:790-801 | lib/themes/nipaplay/pages/settings/watch_history_page.dart:665-676 — 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) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:99— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:99-110 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:93-104 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (18 lines × 2) lib/danmaku_dfm/dfm_plus_overlay.dart:369— lib/danmaku_dfm/dfm_plus_overlay.dart:369-386 | lib/danmaku_next/nipaplay_next2_overlay.dart:115-132 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_overlay.dart` and `lib/danmaku_next/nipaplay_next2_overlay.dart` as WHOLE FILES: this scan already matched 4 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/danmaku_dfm/dfm_plus_overlay.dart:369` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:33— lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:33-50 | lib/danmaku_gpu/lib/gpu_top_danmaku_renderer.dart:32-49 — before extracting anything, compare `lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart` and `lib/danmaku_gpu/lib/gpu_top_danmaku_renderer.dart` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:33` 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/danmaku_next/nipaplay_next_engine.dart:1117— lib/danmaku_next/nipaplay_next_engine.dart:1117-1134 | lib/danmaku_next/nipaplay_next_old_engine.dart:951-968 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 × 2) lib/danmaku_next/nipaplay_next_old_overlay.dart:140— lib/danmaku_next/nipaplay_next_old_overlay.dart:140-157 | lib/danmaku_next/nipaplay_next_overlay.dart:166-183 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_old_overlay.dart` and `lib/danmaku_next/nipaplay_next_overlay.dart` as WHOLE FILES: this scan already matched 4 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. 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/danmaku_next/nipaplay_next_old_overlay.dart:140` it does not close everything it opens, so those exact lines 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/media_library/adaptive_media_library_primitives.dart:320— lib/media_library/adaptive_media_library_primitives.dart:320-337 | lib/media_library/adaptive_media_library_primitives.dart:424-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/media_library/adaptive_media_library_primitives.dart:320` it does not close everything it opens, so those exact lines 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/pages/torrent_download_page.dart:2059— lib/pages/torrent_download_page.dart:2059-2076 | lib/pages/torrent_download_page.dart:2264-2281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/torrent_download_page.dart:2059` it begins part-way through the construct above it, so those exact lines 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/services/dandanplay_service_io.dart:225— lib/services/dandanplay_service_io.dart:225-242 | lib/services/dandanplay_service_stub.dart:1295-1312 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:225` it does not close everything it opens, so those exact lines 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/services/dandanplay_service_io.dart:1140— lib/services/dandanplay_service_io.dart:1140-1157 | lib/services/dandanplay_service_stub.dart:1163-1180 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1140` it begins part-way through the construct above it, so those 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/services/dandanplay_service_io.dart:1159` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:1182` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) lib/settings/pages/general_settings_content.dart:612— lib/settings/pages/general_settings_content.dart:612-629 | lib/settings/pages/general_settings_content.dart:631-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.
Duplicated block (18 lines × 2) lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:133— lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:133-150 | lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:222-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:136— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:136-153 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:182-199 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart` and `lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 127 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:136` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:192— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:192-209 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:413-430 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) lib/themes/nipaplay/pages/account/material_account_page.dart:632— lib/themes/nipaplay/pages/account/material_account_page.dart:632-649 | lib/themes/nipaplay/pages/account/material_account_page.dart:653-670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/account/material_account_page.dart:632` 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 (18 lines × 2) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1131— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1131-1148 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1425-1442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1131` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:822— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:822-839 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1411-1428 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:191— lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:191-208 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:219-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:191` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/danmaku_offset_menu.dart:318— lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:318-335 | lib/themes/nipaplay/widgets/seek_step_menu.dart:510-527 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:5590— lib/themes/nipaplay/widgets/library_management_tab.dart:5590-5607 | lib/themes/nipaplay/widgets/library_management_tab.dart:5796-5813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:5590` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/media_library_sort_dialog.dart:287— lib/themes/nipaplay/widgets/media_library_sort_dialog.dart:287-304 | lib/themes/nipaplay/widgets/media_library_sort_dialog.dart:374-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/media_library_sort_dialog.dart:287` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/network_media_library_view.dart:724— lib/themes/nipaplay/widgets/network_media_library_view.dart:724-741 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:574-591 — before extracting anything, compare `lib/themes/nipaplay/widgets/network_media_library_view.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 92 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/themes/nipaplay/widgets/network_media_library_view.dart:724` 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/themes/nipaplay/widgets/playback_rate_menu.dart:118— lib/themes/nipaplay/widgets/playback_rate_menu.dart:118-135 | lib/themes/nipaplay/widgets/seek_step_menu.dart:133-150 — before extracting anything, compare `lib/themes/nipaplay/widgets/playback_rate_menu.dart` and `lib/themes/nipaplay/widgets/seek_step_menu.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 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/themes/nipaplay/widgets/playback_rate_menu.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.
Duplicated block (18 lines × 2) lib/themes/nipaplay/widgets/seek_step_menu.dart:158— lib/themes/nipaplay/widgets/seek_step_menu.dart:158-175 | lib/themes/nipaplay/widgets/seek_step_menu.dart:360-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/seek_step_menu.dart:158` 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/themes/nipaplay/widgets/smb_connection_dialog.dart:181— lib/themes/nipaplay/widgets/smb_connection_dialog.dart:181-198 | lib/themes/nipaplay/widgets/smb_connection_dialog.dart:214-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/smb_connection_dialog.dart:181` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) lib/pages/new_series_page.dart:559— lib/pages/new_series_page.dart:559-577 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:790-808 — before extracting anything, compare `lib/pages/new_series_page.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/pages/new_series_page.dart:559` it begins part-way through the construct above it, so those exact lines 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/player_abstraction/video_player_adapter.dart:336— lib/player_abstraction/video_player_adapter.dart:336-354 | lib/player_abstraction/video_player_adapter.dart:493-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/video_player_adapter.dart:336` it does not close everything it opens, so those exact lines 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/providers/shared_remote_library_provider.dart:1150— lib/providers/shared_remote_library_provider.dart:1150-1168 | lib/providers/shared_remote_library_provider.dart:1286-1304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1150` 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/providers/shared_remote_library_provider.dart:1171— lib/providers/shared_remote_library_provider.dart:1171-1189 | lib/providers/shared_remote_library_provider.dart:1450-1468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1171` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) lib/services/dandanplay_service_io.dart:1467— lib/services/dandanplay_service_io.dart:1467-1485 | lib/services/dandanplay_service_stub.dart:2403-2421 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (19 lines × 2) lib/services/dandanplay_service_stub.dart:931— lib/services/dandanplay_service_stub.dart:931-949 | lib/services/dandanplay_service_stub.dart:961-979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:931` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) lib/services/dandanplay_service_stub.dart:1380— lib/services/dandanplay_service_stub.dart:1380-1398 | lib/services/dandanplay_service_stub.dart:1764-1782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:1380` it begins part-way through the construct above it, so those exact lines 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/services/database/database_debug.dart:49— lib/services/database/database_debug.dart:49-67 | lib/services/database/database_debug.dart:78-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/database/database_debug.dart:49` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) lib/services/emby_dandanplay_matcher.dart:729— lib/services/emby_dandanplay_matcher.dart:729-747 | lib/services/jellyfin_dandanplay_matcher.dart:768-786 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:729` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/jellyfin_dandanplay_matcher.dart:765` calls `debugPrint` and `lib/services/emby_dandanplay_matcher.dart:727` 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 (19 lines × 2) lib/services/emby_service.dart:1227— lib/services/emby_service.dart:1227-1245 | lib/services/jellyfin_service.dart:1083-1101 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:1227` it does not close everything it opens, so those exact lines 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/services/file_picker_service.dart:125— lib/services/file_picker_service.dart:125-143 | lib/services/file_picker_service.dart:155-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/file_picker_service.dart:125` it begins part-way through the construct above it, so those exact lines 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/services/file_picker_service.dart:481— lib/services/file_picker_service.dart:481-499 | lib/services/file_picker_service.dart:825-843 — both copies are in the same file, so extract the block into 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/services/local_media_share_service.dart:573— lib/services/local_media_share_service.dart:573-591 | lib/services/local_media_share_service.dart:866-884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/local_media_share_service.dart:573` 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 (19 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:429— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:429-447 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:464-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.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.
Duplicated block (19 lines × 2) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:144— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:144-162 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:109-127 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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 (19 lines × 2) lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:271— lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:271-289 | lib/themes/nipaplay/widgets/network_media_library_view.dart:917-935 — before extracting anything, compare `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` and `lib/themes/nipaplay/widgets/network_media_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 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/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:271` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/network_media_library_view.dart:937` calls `trim` and `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:290` 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 (19 lines × 2) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:88— lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:88-106 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:120-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/jellyfin_quality_menu.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. 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/themes/nipaplay/widgets/seek_step_menu.dart:472— lib/themes/nipaplay/widgets/seek_step_menu.dart:472-490 | lib/themes/nipaplay/widgets/seek_step_menu.dart:563-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/seek_step_menu.dart:472` it begins part-way through the construct above it, so those exact lines 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/utils/screen_orientation_manager.dart:95— lib/utils/screen_orientation_manager.dart:95-113 | lib/utils/screen_orientation_manager.dart:117-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. 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 (19 lines × 2) lib/services/remote_subtitle_service.dart:996— lib/services/remote_subtitle_service.dart:996-1014 | lib/services/remote_subtitle_service.dart:1111-1129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/remote_subtitle_service.dart:996` it does not close everything it opens, so those exact lines 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) rust/src/next2_engine/engine/renderer_draw.rs:212— rust/src/next2_engine/engine/renderer_draw.rs:212-230 | rust/src/next2_engine/engine/renderer_draw.rs: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 `rust/src/next2_engine/engine/renderer_draw.rs:212` 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.
Weak hash algorithm lib/player_abstraction/video_player_adapter.dart:703— 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.
Weak hash algorithm lib/services/dandanplay_service_io.dart:756— 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.
Weak hash algorithm lib/services/dandanplay_service_io.dart:1052— 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.
Weak hash algorithm lib/services/dandanplay_service_io.dart:1605— 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.
Weak hash algorithm lib/services/dandanplay_service_stub.dart:672— 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.
Weak hash algorithm lib/services/file_picker_service.dart:364— 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.
Weak hash algorithm lib/services/local_media_share_service.dart:189— 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.
Weak hash algorithm lib/services/remote_subtitle_service.dart:387— 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.
Weak hash algorithm lib/services/remote_subtitle_service.dart:396— 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.
Weak hash algorithm lib/services/remote_subtitle_service.dart:502— 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.
Weak hash algorithm lib/services/remote_subtitle_service.dart:729— 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.
Weak hash algorithm lib/services/remote_subtitle_service.dart:784— 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.
Weak hash algorithm lib/services/subtitle_service.dart:31— 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.
Weak hash algorithm lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:145— 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.
Weak hash algorithm lib/utils/file_hash.dart:81— 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.
Weak hash algorithm lib/utils/file_hash.dart:132— 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.
Weak hash algorithm lib/utils/remote_media_fetcher.dart:191— 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.
Weak hash algorithm lib/utils/remote_media_fetcher.dart:193— 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.
Weak hash algorithm lib/utils/subtitle_manager.dart:458— 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.
Weak hash algorithm lib/utils/subtitle_manager.dart:1347— 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.
Weak hash algorithm lib/utils/webdav_http_auth.dart:90— 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.
Duplicated block (5 lines × 2) lib/services/dandanplay_service_io.dart:103— lib/services/dandanplay_service_io.dart:103-107 | lib/services/dandanplay_service_stub.dart:99-103 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (5 lines × 2) lib/services/episode_navigation_service.dart:1103— lib/services/episode_navigation_service.dart:1103-1108 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:194-198 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/episode_navigation_service.dart:1103` it does not close everything it opens, so those 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 × 2) lib/themes/nipaplay/widgets/library_management_layout.dart:33— lib/themes/nipaplay/widgets/library_management_layout.dart:33-37 | lib/themes/nipaplay/widgets/menu_button.dart:110-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:892— lib/danmaku_next/nipaplay_next_engine.dart:892-896 | lib/danmaku_next/nipaplay_next_old_engine.dart:735-739 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (5 lines × 2) lib/pages/desktop_player_window.dart:113— lib/pages/desktop_player_window.dart:113-117 | lib/pages/external_player_console_window.dart:99-103 — before extracting anything, compare `lib/pages/desktop_player_window.dart` and `lib/pages/external_player_console_window.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (5 lines × 2) lib/pages/desktop_player_window.dart:124— lib/pages/desktop_player_window.dart:124-128 | lib/pages/external_player_console_window.dart:110-114 — before extracting anything, compare `lib/pages/desktop_player_window.dart` and `lib/pages/external_player_console_window.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (5 lines × 2) lib/providers/emby_provider.dart:103— lib/providers/emby_provider.dart:103-107 | lib/providers/jellyfin_provider.dart:140-144 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) lib/services/dandanplay_service_io.dart:70— lib/services/dandanplay_service_io.dart:70-74 | lib/services/dandanplay_service_stub.dart:60-64 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (5 lines × 2) lib/services/emby_dandanplay_matcher.dart:947— lib/services/emby_dandanplay_matcher.dart:947-951 | lib/services/jellyfin_dandanplay_matcher.dart:1024-1028 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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 (5 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:894— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:894-898 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:448-452 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (5 lines × 2) lib/plugins/models/plugin_danmaku_renderer.dart:99— lib/plugins/models/plugin_danmaku_renderer.dart:99-103 | lib/plugins/models/plugin_manifest.dart:31-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) lib/services/backup_service.dart:54— lib/services/backup_service.dart:54-58 | lib/services/full_backup_service.dart:99-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) lib/services/dandanplay_service_io.dart:97— lib/services/dandanplay_service_io.dart:97-101 | lib/services/dandanplay_service_stub.dart:93-97 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/dandanplay_service_stub.dart:89` calls `ValueNotifier`, `handleTokenRefused` and `lib/services/dandanplay_service_io.dart:95` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) lib/themes/nipaplay/widgets/arrow_menu_container.dart:253— lib/themes/nipaplay/widgets/arrow_menu_container.dart:253-257 | lib/themes/nipaplay/widgets/arrow_menu_container.dart:265-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/themes/nipaplay/widgets/arrow_menu_container.dart:270` calls `lineTo` and `lib/themes/nipaplay/widgets/arrow_menu_container.dart:258` 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) tool/generate_tvos_icons.py:26— tool/generate_tvos_icons.py:26-30 | tool/generate_tvos_icons.py:38-42 — both copies are in the same file, so extract the block into 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) REDACTED:16— REDACTED:16-20 | docs/nipaplay.php:17-21 — 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) macos/Runner/MainFlutterWindow.swift:61— macos/Runner/MainFlutterWindow.swift:61-65 | macos/Runner/SystemSharePlugin.swift:5-12 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) rust/src/api/file_scan.rs:266— rust/src/api/file_scan.rs:266-270 | rust/src/api/incremental_sync.rs:491-497 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/src/api/file_scan.rs:266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) rust/src/next2_engine/engine/rendering.rs:267— rust/src/next2_engine/engine/rendering.rs:267-271 | rust/src/next2_engine/engine/rendering.rs:847-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/src/next2_engine/engine/rendering.rs:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Sync-over-async blocking lib/models/external_player_session/mpv_session.dart:94— `launch` 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/models/external_player_session/mpv_session.dart:240— `refreshDanmaku` is async and calls renameSync, 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/models/watch_history_database.dart:78— `_initDB` 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/player_abstraction/video_player_adapter.dart:556— `snapshot` 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/services/desktop_exit_handler.dart:490— `_prepareTrayIconPath` 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/services/playback_source_service.dart:754— `_loadLocalEpisodes` 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/services/server_history_sync_service.dart:497— `_ensureThumbnailDirectory` 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 rust_builder/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 rust_builder/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 rust_builder/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 rust_builder/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 rust_builder/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 rust_builder/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/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:217— `_loadFileSystemEpisodes` 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/themes/nipaplay/widgets/custom_media_info_dialog.dart:1520— `scanVideoFiles` 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/themes/nipaplay/widgets/playlist_menu.dart:74— `_loadFileSystemData` 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/player_kernel_manager.dart:29— `_prepareHotSwapTraceFile` 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/subtitle_manager.dart:1434— `autoDetectAndLoadSubtitle` 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/subtitle_manager.dart:1895— `_registerRemainingSubtitlesAfterRestore` 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.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×18
Edited copy of a member (10 corresponding lines) lib/pages/anime_detail_page.dart:2684— lib/pages/anime_detail_page.dart:2684-2693 | lib/themes/cupertino/widgets/player_menu/cupertino_playback_info_pane.dart:83-94 — 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/themes/nipaplay/widgets/playback_info_menu.dart:972— lib/themes/nipaplay/widgets/playback_info_menu.dart:972-982 | lib/utils/media_info_helper.dart:51-60 — 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/providers/shared_remote_library_provider.dart:801— lib/providers/shared_remote_library_provider.dart:801-810 | lib/providers/shared_remote_library_provider.dart:812-824 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) lib/services/remote_subtitle_service.dart:276— lib/services/remote_subtitle_service.dart:276-285 | lib/services/remote_subtitle_service.dart:287-297 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) lib/services/incremental_sync_repository.dart:48— lib/services/incremental_sync_repository.dart:48-57 | lib/services/incremental_sync_repository.dart:170-179 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) lib/services/torrent_download_service.dart:144— lib/services/torrent_download_service.dart:144-156 | lib/services/torrent_download_service.dart:158-167 — 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/providers/shared_remote_library_provider.dart:647— lib/providers/shared_remote_library_provider.dart:647-656 | lib/utils/remote_media_fetcher.dart:472-481 — 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/models/emby_model.dart:217— lib/models/emby_model.dart:217-226 | lib/models/jellyfin_model.dart:243-252 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) lib/services/torrent_download_service.dart:189— lib/services/torrent_download_service.dart:189-198 | packages/media_kit/lib/src/player/native/core/native_library.dart:137-148 — 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/themes/nipaplay/widgets/modern_video_controls.dart:503— lib/themes/nipaplay/widgets/modern_video_controls.dart:503-512 | lib/themes/nipaplay/widgets/video_player_ui.dart:677-690 — 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/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:656— lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:656-665 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:540-551 — 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/settings/pages/network_settings_content.dart:516— lib/settings/pages/network_settings_content.dart:516-527 | lib/settings/pages/network_settings_content.dart:529-538 — 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/providers/emby_provider.dart:409— lib/providers/emby_provider.dart:409-418 | lib/providers/jellyfin_provider.dart:437-447 — 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/themes/cupertino/widgets/emby_media_selection_sheet.dart:67— lib/themes/cupertino/widgets/emby_media_selection_sheet.dart:67-79 | lib/themes/nipaplay/widgets/emby_media_selection_dialog.dart:98-107 — 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/themes/nipaplay/widgets/library_management_tab.dart:3014— lib/themes/nipaplay/widgets/library_management_tab.dart:3014-3023 | lib/themes/nipaplay/widgets/library_management_tab.dart:3025-3038 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) lib/services/smb_service.dart:447— lib/services/smb_service.dart:447-456 | lib/services/webdav_service.dart:851-860 — 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:261— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:261-270 | lib/themes/nipaplay/widgets/subtitle_settings_menu.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/pages/media_server_detail_page.dart:844— lib/pages/media_server_detail_page.dart:844-853 | lib/themes/nipaplay/pages/settings/watch_history_page.dart:729-738 — 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.
Repeated repair: lib/player_abstraction/mdk_player_adapter_io.dart lib/player_abstraction/mdk_player_adapter_io.dart:317— lib/player_abstraction/mdk_player_adapter_io.dart changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is MdkPlayerAdapter._configureSubtitleFonts at line 317), 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(player): make MDK resume seeks take effect when MDK cancels them”; “fix(player): stop calling into an MDK player while fvp deletes it (#1033)”; “fix(ohos): align MDK disposal and buffering interfaces”; “fix: 新番回顾+新媒体信息页优化 (#971)”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/player_abstraction/mdk_player_adapter_io.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/widgets/danmaku_overlay.dart lib/widgets/danmaku_overlay.dart:44— lib/widgets/danmaku_overlay.dart changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is _DanmakuOverlayState.build at line 44), 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(performance): 综合性能优化 (#1004)”; “revert: withdraw unverified fixes from PRs 991, 993 and 994 (#1003)”; “fix(danmaku): invalidate Next frames when episode data changes (#993)”; “fix:dfm buffering sync (#973)”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/widgets/danmaku_overlay.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/src/next2_engine/engine/motion.rs rust/src/next2_engine/engine/motion.rs:46— rust/src/next2_engine/engine/motion.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is MotionClock::anchor at line 46), 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:dfm buffering sync (#973)”; “fix(ios): pace DFM frames with the native display clock”; “fix(dfm): pace continuous motion by logical vsync slots”; “fix(dfm): skip expired fallback after a slow vsync submission”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- rust/src/next2_engine/engine/motion.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/themes/nipaplay/widgets/subtitle_settings_menu.dart lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:148— lib/themes/nipaplay/widgets/subtitle_settings_menu.dart changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is _SubtitleSettingsMenuState._pickFontDirectory at line 148), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): keep every dialog in the current Flutter view”; “fix(subtitle): 字幕颜色输入改 hex 对话框 + HSV 调色盘,输入键盘不再遮挡”; “Revert #920 pending Erika API alignment and separate validation”; “fix(subtitle/libmpv): 外挂字幕多字幕交互全套+libmpv内核修复(EOF误判/ASS特效/生命周期/字幕轨)”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/subtitle_settings_menu.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/src/next2_engine/ffi.rs rust/src/next2_engine/ffi.rs:316— rust/src/next2_engine/ffi.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is rust_lib_nipaplay::next2_engine::ffi::next2_engine_set_frame at line 316), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ios): pace DFM frames with the native display clock”; “fix(dfm): gate playback on glyph prewarm”; “fix(dfm): synchronize native motion pacing and use precise interruptible deadlines”; “fix: stabilize DFM+ frame pacing”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- rust/src/next2_engine/ffi.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/danmaku_next/next2_texture_bridge.dart lib/danmaku_next/next2_texture_bridge.dart:157— lib/danmaku_next/next2_texture_bridge.dart changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is Next2TextureBridge.getDfmPrewarmState at line 157), 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(dfm): gate playback on glyph prewarm”; “fix(dfm): synchronize native motion pacing and use precise interruptible deadlines”; “fix: animate DFM continuously on native media clock”; “fix: stabilize DFM+ frame pacing”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/danmaku_next/next2_texture_bridge.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/themes/nipaplay/pages/account/material_account_page.dart lib/themes/nipaplay/pages/account/material_account_page.dart:492— lib/themes/nipaplay/pages/account/material_account_page.dart changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is _UnifiedAccountPageState._showCupertinoRegisterDialog at line 492), 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(account): include token link in browser launch fallback”; “fix(account): restore Bangumi access-token page link and rename help button (#1007)”; “fix(performance): 综合性能优化 (#1004)”; “fix: retry shared libraries and initialize Fluent icon fonts”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/pages/account/material_account_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/src/next2_engine/engine/renderer_core.rs rust/src/next2_engine/engine/renderer_core.rs:448— rust/src/next2_engine/engine/renderer_core.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is Next2Renderer::update_frame at line 448), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ios): pace DFM frames with the native display clock”; “fix(dfm): gate playback on glyph prewarm”; “fix: animate DFM continuously on native media clock”; “fix: stabilize DFM+ frame pacing”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- rust/src/next2_engine/engine/renderer_core.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:357— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is _CupertinoSubtitleSettingsPaneState._buildFullSubtitleSections at line 357), 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(subtitle/player): 修复上游架构测试失败——player_menu 禁用裸 Cupertino 组件改为 Adaptive,player_factory 移除 logPlayerEvent 调用(测试环境无 binding 致 UA 加载失败)”; “fix(subtitle): 字幕颜色输入改 hex 对话框 + HSV 调色盘,输入键盘不再遮挡”; “Revert #920 pending Erika API alignment and separate validation”; “fix(subtitle/libmpv): 外挂字幕多字幕交互全套+libmpv内核修复(EOF误判/ASS特效/生命周期/字幕轨)”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.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/themes/nipaplay/widgets/dandanplay_remote_library_view.dart lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:70— lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is _DandanplayRemoteLibraryViewState.build at line 70), 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: 修复媒体库来源与连接回退,并支持短评标记已看 (#1106)”; “fix: preserve media library search input interactions on iPad (#978)”; “fix(tv): replace library header scaling with global 0.5x UI scale”; “fix(tv): cap media library controls at one third of page height”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/dandanplay_remote_library_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/media_library/adaptive_media_library_controls.dart lib/media_library/adaptive_media_library_controls.dart:926— lib/media_library/adaptive_media_library_controls.dart changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is _MediaLibrarySectionOrderEditorState.build at line 926), 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: align media library ordering with NipaPlay controls”; “fix(tv): replace library header scaling with global 0.5x UI scale”; “fix(tv): cap media library controls at one third of page height”; “fix(tv): 修复空媒体库、遥控器按键及二维码输入布局 (#905)”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/media_library/adaptive_media_library_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.
Repeated repair: lib/services/danmaku_matching_service.dart lib/services/danmaku_matching_service.dart:51— lib/services/danmaku_matching_service.dart changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is DanmakuMatchingService.getAnimeEpisodes at line 51), 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(webdav): 字幕/媒体下载补齐挑战式认证,媒体走本地认证代理”; “fix: wait for remote danmaku recognition”; “fix: resolve remote media for danmaku matching”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/services/danmaku_matching_service.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/themes/nipaplay/widgets/large_screen_page_scaffold.dart lib/themes/nipaplay/widgets/large_screen_page_scaffold.dart:56— lib/themes/nipaplay/widgets/large_screen_page_scaffold.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 10 (its worst body is NipaplayLargeScreenPageScaffold.build at line 56), 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(android-tv): restore media detail focus in large-screen mode”; “fix(tv): replace library header scaling with global 0.5x UI scale”; “fix(tv): cap media library controls at one third of page height”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/large_screen_page_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.
Repeated repair: rust/src/next2_engine/engine/rendering.rs rust/src/next2_engine/engine/rendering.rs:623— rust/src/next2_engine/engine/rendering.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Next2GlyphAtlas::evict_oldest at line 623), 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(dfm): gate playback on glyph prewarm”; “fix: animate DFM continuously on native media clock”; “fix: stabilize DFM+ frame pacing”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- rust/src/next2_engine/engine/rendering.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: lib/themes/nipaplay/widgets/apple_native_media_control.dart lib/themes/nipaplay/widgets/apple_native_media_control.dart:113— lib/themes/nipaplay/widgets/apple_native_media_control.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is _AppleNativeMediaControlState._sendInteraction at line 113), 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: promote immersive media details and simplify action buttons”; “fix: complete native media detail glass interaction on Apple platforms”; “fix: restore macOS media glass control input and neutral tint”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/apple_native_media_control.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/settings/about_settings_data.dart lib/settings/about_settings_data.dart:12— lib/settings/about_settings_data.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is AboutSettingsData.showSponsorship at line 12), 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(release): restore CI notes and scope donation hiding to App Store (#1074)”; “fix(release): restore CI notes and scope donation hiding to App Store”; “fix(release): prepare Classic 1.11.11 and remove Apple desktop donations”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/settings/about_settings_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.
Repeated repair: lib/themes/nipaplay/widgets/menu_button.dart lib/themes/nipaplay/widgets/menu_button.dart:107— lib/themes/nipaplay/widgets/menu_button.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is _WindowControlIconButtonState.build at line 107), 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(windows): exclude caption buttons from keyboard focus traversal (#981)”; “revert: withdraw unverified fixes from PRs 991, 993 and 994 (#1003)”; “fix(windows): keep player keys away from caption controls (#991)”. 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 12:37:03 +08:00' --until='2026-11-17 12:37:03 +08:00' --full-history --no-merges -- lib/themes/nipaplay/widgets/menu_button.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 (12 corresponding lines) · ×17
Edited copy of a member (12 corresponding lines) lib/plugins/plugin_service.dart:1452— lib/plugins/plugin_service.dart:1452-1463 | lib/themes/nipaplay/widgets/plugin_market_dialog.dart:216-231 — 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/themes/nipaplay/widgets/large_screen_editable_slider.dart:56— lib/themes/nipaplay/widgets/large_screen_editable_slider.dart:56-74 | lib/themes/nipaplay/widgets/settings_item.dart:898-909 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) lib/services/local_media_management_api.dart:144— lib/services/local_media_management_api.dart:144-155 | lib/services/local_media_management_api.dart:327-338 — 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/themes/nipaplay/widgets/library_management_tab.dart:6166— lib/themes/nipaplay/widgets/library_management_tab.dart:6166-6178 | lib/themes/nipaplay/widgets/library_management_tab.dart:6391-6402 — 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/settings/pages/about_settings_content.dart:683— lib/settings/pages/about_settings_content.dart:683-694 | lib/themes/cupertino/widgets/cupertino_dependency_versions_sheet.dart:37-55 — 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/themes/nipaplay/widgets/network_media_library_view.dart:317— lib/themes/nipaplay/widgets/network_media_library_view.dart:317-329 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:59-70 — 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/danmaku_next/danmaku_atlas_painter.dart:1705— lib/danmaku_next/danmaku_atlas_painter.dart:1705-1719 | lib/danmaku_next/nipaplay_next_old_canvas_painter.dart:528-539 — 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/chinese_converter.dart:14— lib/utils/chinese_converter.dart:14-25 | lib/utils/chinese_converter.dart:27-39 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) lib/services/database/database_anime_episode_repository.dart:150— lib/services/database/database_anime_episode_repository.dart:150-161 | lib/services/database/database_anime_episode_repository.dart:205-216 — 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/themes/nipaplay/widgets/subtitle_settings_menu.dart:418— lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:418-429 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:709-720 — 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/settings/pages/danmaku_settings_content.dart:300— lib/settings/pages/danmaku_settings_content.dart:300-311 | lib/settings/pages/danmaku_settings_content.dart:313-324 — 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/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:107— lib/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:107-118 | lib/themes/nipaplay/pages/settings/debug_log_viewer_page.dart:106-118 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) lib/models/external_player_session/mpv_session.dart:302— lib/models/external_player_session/mpv_session.dart:302-316 | lib/models/external_player_session/vlc_session.dart:159-170 — 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/themes/nipaplay/widgets/seek_step_menu.dart:30— lib/themes/nipaplay/widgets/seek_step_menu.dart:30-41 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:46-62 — 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/storage_service.dart:21— lib/utils/storage_service.dart:21-32 | lib/utils/storage_service.dart:55-66 — 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/pages/torrent_download_page.dart:82— lib/pages/torrent_download_page.dart:82-93 | lib/themes/nipaplay/pages/account/material_account_page.dart:63-75 — 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/themes/cupertino/widgets/cupertino_dependency_versions_sheet.dart:72— lib/themes/cupertino/widgets/cupertino_dependency_versions_sheet.dart:72-83 | lib/themes/nipaplay/pages/settings/dependency_versions_window.dart:57-68 — 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.
Duplicated block (22 lines × 2) lib/models/jellyfin_model.dart:180— lib/models/jellyfin_model.dart:180-201 | lib/models/jellyfin_model.dart:395-416 — both copies are in the same file, so extract the block into 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/pages/torrent_download_page.dart:2006— lib/pages/torrent_download_page.dart:2006-2027 | lib/pages/torrent_download_page.dart:2198-2219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/torrent_download_page.dart:2006` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) lib/providers/emby_provider.dart:219— lib/providers/emby_provider.dart:219-240 | lib/providers/jellyfin_provider.dart:252-273 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/providers/emby_provider.dart:219` 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 (22 lines × 2) lib/services/dandanplay_service_io.dart:2501— lib/services/dandanplay_service_io.dart:2501-2522 | lib/services/dandanplay_service_io.dart:2553-2574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_io.dart:2501` it begins part-way through the construct above it, so those 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/dandanplay_service_io.dart:2500` calls `encode` and `lib/services/dandanplay_service_io.dart:2552` 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 (22 lines × 2) lib/services/danmaku_spoiler_filter_service.dart:66— lib/services/danmaku_spoiler_filter_service.dart:66-87 | lib/services/danmaku_spoiler_filter_service.dart:126-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/danmaku_spoiler_filter_service.dart:66` it begins part-way through the construct above it, so those 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 (22 lines × 2) lib/services/emby_service.dart:1417— lib/services/emby_service.dart:1417-1438 | lib/services/jellyfin_service.dart:1292-1313 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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 (22 lines × 2) lib/services/smb2_native_service_ffi.dart:170— lib/services/smb2_native_service_ffi.dart:170-191 | lib/services/smb2_native_service_ffi.dart:199-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/smb2_native_service_ffi.dart:170` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) lib/services/smb_proxy_service.dart:184— lib/services/smb_proxy_service.dart:184-205 | lib/services/smb_proxy_service.dart:280-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/services/smb_proxy_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.
Duplicated block (22 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:327— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:327-348 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:500-521 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:327` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:164— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:164-185 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:129-150 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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 (22 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:1864— lib/themes/nipaplay/widgets/library_management_tab.dart:1864-1885 | lib/themes/nipaplay/widgets/library_management_tab.dart:2035-2056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:1864` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) lib/themes/nipaplay/widgets/network_media_library_view.dart:2062— lib/themes/nipaplay/widgets/network_media_library_view.dart:2062-2083 | lib/themes/nipaplay/widgets/network_media_library_view.dart:2120-2141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/network_media_library_view.dart:2062` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) lib/themes/nipaplay/widgets/playback_rate_menu.dart:160— lib/themes/nipaplay/widgets/playback_rate_menu.dart:160-181 | lib/themes/nipaplay/widgets/seek_step_menu.dart:173-194 — before extracting anything, compare `lib/themes/nipaplay/widgets/playback_rate_menu.dart` and `lib/themes/nipaplay/widgets/seek_step_menu.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 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/themes/nipaplay/widgets/playback_rate_menu.dart:160` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/seek_step_menu.dart:282— lib/themes/nipaplay/widgets/seek_step_menu.dart:282-303 | lib/themes/nipaplay/widgets/seek_step_menu.dart:388-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/seek_step_menu.dart:282` it does not close everything it opens, so those exact lines 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/utils/subtitle_parser.dart:557— lib/utils/subtitle_parser.dart:557-578 | lib/utils/subtitle_parser.dart:582-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/subtitle_parser.dart:557` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (22 lines × 2) lib/widgets/context_menu/src/context_menu_styles.dart:61— lib/widgets/context_menu/src/context_menu_styles.dart:61-82 | lib/widgets/context_menu/src/context_menu_styles.dart:146-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/context_menu/src/context_menu_styles.dart:61` it does not close everything it opens, so those 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 (22 lines × 2) ios/Runner/AppDelegate.swift:151— ios/Runner/AppDelegate.swift:151-172 | macos/Runner/SystemSharePlugin.swift:15-36 — 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 `ios/Runner/AppDelegate.swift: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.
Duplicated block (17 lines × 2) lib/media_library/adaptive_media_library_primitives.dart:766— lib/media_library/adaptive_media_library_primitives.dart:766-782 | lib/media_library/adaptive_media_library_primitives.dart:836-852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) lib/pages/media_server_detail_page.dart:643— lib/pages/media_server_detail_page.dart:643-659 | lib/pages/media_server_detail_page.dart:665-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/pages/media_server_detail_page.dart:643` it begins part-way through the construct above it, so those exact lines 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/pages/torrent_download_page.dart:1988— lib/pages/torrent_download_page.dart:1988-2004 | lib/pages/torrent_download_page.dart:2180-2196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/torrent_download_page.dart:1988` it does not close everything it opens, so those exact lines 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/playback/adaptive_playback_entry_view.dart:246— lib/playback/adaptive_playback_entry_view.dart:246-262 | lib/playback/adaptive_playback_entry_view.dart:324-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/playback/adaptive_playback_entry_view.dart:246` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) lib/providers/emby_provider.dart:250— lib/providers/emby_provider.dart:250-266 | lib/providers/jellyfin_provider.dart:283-299 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/providers/emby_provider.dart:250` 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/providers/shared_remote_library_provider.dart:1244— lib/providers/shared_remote_library_provider.dart:1244-1260 | lib/providers/shared_remote_library_provider.dart:1522-1538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1244` it begins part-way through the construct above it, so those 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/services/dandanplay_service_io.dart:951— lib/services/dandanplay_service_io.dart:951-967 | lib/services/dandanplay_service_stub.dart:1017-1033 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:951` 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/services/emby_service.dart:598— lib/services/emby_service.dart:598-614 | lib/services/jellyfin_service.dart:472-488 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:598` 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 (17 lines × 2) lib/services/jellyfin_service.dart:516— lib/services/jellyfin_service.dart:516-532 | lib/services/jellyfin_service.dart:561-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/jellyfin_service.dart:559` calls `_makeAuthenticatedRequest` and `lib/services/jellyfin_service.dart:515` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:160— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:160-176 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:203-219 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart` and `lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 127 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:160` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/danmaku_settings_menu.dart:837— lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:837-853 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:851-867 — before extracting anything, compare `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 96 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/themes/nipaplay/widgets/danmaku_settings_menu.dart:837` 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/themes/nipaplay/widgets/library_management_tab.dart:5482— lib/themes/nipaplay/widgets/library_management_tab.dart:5482-5498 | lib/themes/nipaplay/widgets/library_management_tab.dart:5693-5709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:5482` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/media_library_sort_dialog.dart:259— lib/themes/nipaplay/widgets/media_library_sort_dialog.dart:259-275 | lib/themes/nipaplay/widgets/media_library_sort_dialog.dart:351-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/media_library_sort_dialog.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 (17 lines × 2) lib/themes/nipaplay/widgets/playback_info_menu.dart:380— lib/themes/nipaplay/widgets/playback_info_menu.dart:380-396 | lib/themes/nipaplay/widgets/playback_info_menu.dart:658-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/playback_info_menu.dart:380` it does not close everything it opens, so those 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 (17 lines × 2) lib/themes/nipaplay/widgets/tag_search_widget.dart:914— lib/themes/nipaplay/widgets/tag_search_widget.dart:914-930 | lib/themes/nipaplay/widgets/tag_search_widget.dart:961-977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/tag_search_widget.dart:914` it does not close everything it opens, so those 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) rust/src/api/next2.rs:168— rust/src/api/next2.rs:168-184 | rust/src/api/next2.rs:185-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) rust/src/next2_engine/engine/renderer_draw.rs:545— rust/src/next2_engine/engine/renderer_draw.rs:545-561 | rust/src/next2_engine/engine/renderer_draw.rs:611-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/src/next2_engine/engine/renderer_draw.rs:545` it begins part-way through the construct above it, so those exact lines 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/models/search_model.dart:60— lib/models/search_model.dart:60-65 | lib/models/search_model.dart:68-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (6 lines × 2) lib/models/watch_history_model.dart:972— lib/models/watch_history_model.dart:972-977 | lib/models/watch_history_model.dart:1096-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.
Duplicated block (6 lines × 2) lib/providers/shared_remote_library_provider.dart:1270— lib/providers/shared_remote_library_provider.dart:1270-1275 | lib/providers/shared_remote_library_provider.dart:1541-1546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1270` it does not close everything it opens, so those 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/utils/network_address_utils.dart:84— lib/utils/network_address_utils.dart:84-92 | lib/utils/remote_access_address_utils.dart:74-79 — 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 (6 lines × 2) lib/pages/new_series_page.dart:356— lib/pages/new_series_page.dart:356-361 | lib/pages/new_series_page.dart:677-682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/new_series_page.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. 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/player_abstraction/mdk_player_adapter_io.dart:579— lib/player_abstraction/mdk_player_adapter_io.dart:579-584 | lib/player_abstraction/media_kit_player_adapter.dart:2635-2640 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) lib/services/dandanplay_service_io.dart:505— lib/services/dandanplay_service_io.dart:505-510 | lib/services/dandanplay_service_stub.dart:398-403 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (6 lines × 2) lib/services/dandanplay_service_io.dart:1373— lib/services/dandanplay_service_io.dart:1373-1378 | lib/services/dandanplay_service_stub.dart:2310-2315 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (6 lines × 2) lib/services/dandanplay_service_io.dart:1695— lib/services/dandanplay_service_io.dart:1695-1700 | lib/services/dandanplay_service_stub.dart:2525-2530 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (6 lines × 2) lib/services/dandanplay_service_io.dart:2839— lib/services/dandanplay_service_io.dart:2839-2844 | lib/services/dandanplay_service_stub.dart:2639-2644 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (6 lines × 2) lib/services/emby_playback_sync_service.dart:290— lib/services/emby_playback_sync_service.dart:290-295 | lib/services/jellyfin_playback_sync_service.dart:286-291 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) lib/services/episode_navigation_service.dart:1096— lib/services/episode_navigation_service.dart:1096-1101 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:187-192 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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/services/local_media_management_api.dart:469— lib/services/local_media_management_api.dart:469-474 | lib/themes/nipaplay/widgets/library_management_tab.dart:5872-5877 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/themes/nipaplay/widgets/library_management_tab.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (6 lines × 2) lib/services/local_media_management_api.dart:1063— lib/services/local_media_management_api.dart:1063-1068 | lib/services/network_media_settings_api.dart:171-176 — 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 (6 lines × 2) lib/services/playback_source_service.dart:991— lib/services/playback_source_service.dart:991-996 | lib/utils/media_source_utils.dart:141-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/themes/nipaplay/widgets/video_player_ui.dart:183— lib/themes/nipaplay/widgets/video_player_ui.dart:183-188 | lib/utils/hotkey_service.dart:365-370 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/models/watch_history_database.dart:1274— lib/models/watch_history_database.dart:1274-1279 | lib/models/watch_history_model.dart:80-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×16
Members sharing a duplicated core (4 members, 50+ identical tokens) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:485— lib/danmaku_dfm/dfm_plus_layout_bridge.dart:485-520 | lib/danmaku_next/next2_layout_bridge.dart:161-205 | lib/danmaku_next/nipaplay_next_engine.dart:1028-1073 | lib/danmaku_next/nipaplay_next_old_engine.dart:871-907 — 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/emby_model.dart:100— lib/models/emby_model.dart:100-112 | lib/models/emby_model.dart:414-427 | lib/models/jellyfin_model.dart:123-135 | lib/models/jellyfin_model.dart:439-452 — 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/pages/media_server_detail_page.dart:1311— lib/pages/media_server_detail_page.dart:1311-1436 | lib/pages/new_series_page.dart:495-598 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:208-308 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:723-829 — 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/pages/new_series_page.dart:495— lib/pages/new_series_page.dart:495-598 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:208-308 | lib/themes/nipaplay/widgets/network_media_library_view.dart:834-957 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:723-829 — 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/pages/new_series_page.dart:613— lib/pages/new_series_page.dart:613-643 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:386-407 | lib/themes/nipaplay/widgets/network_media_library_view.dart:985-1006 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1094-1115 — 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/player_abstraction/media_kit_player_adapter.dart:2580— lib/player_abstraction/media_kit_player_adapter.dart:2580-2601 | lib/providers/shared_remote_library_provider.dart:658-678 | lib/services/shared_remote_playback_sync_service.dart:240-260 | lib/utils/remote_media_fetcher.dart:400-421 — 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/providers/shared_remote_library_provider.dart:699— lib/providers/shared_remote_library_provider.dart:699-736 | lib/services/certificate_trust_service.dart:131-163 | lib/services/webdav_service.dart:1798-1834 | lib/utils/remote_media_fetcher.dart:433-470 — 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/services/emby_service.dart:712— lib/services/emby_service.dart:712-819 | lib/services/jellyfin_service.dart:491-545 | lib/services/jellyfin_service.dart:548-594 | lib/services/jellyfin_service.dart:596-680 — 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/services/emby_service.dart:712— lib/services/emby_service.dart:712-819 | lib/services/emby_service.dart:822-866 | lib/services/jellyfin_service.dart:596-680 | lib/services/jellyfin_service.dart:683-727 — 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/services/local_media_management_api.dart:237— lib/services/local_media_management_api.dart:237-297 | lib/services/local_media_management_api.dart:404-467 | lib/services/local_media_management_api.dart:605-655 | lib/services/local_media_management_api.dart:1009-1041 — 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/services/local_media_management_api.dart:682— lib/services/local_media_management_api.dart:682-736 | lib/services/local_media_management_api.dart:746-829 | lib/services/local_media_management_api.dart:831-933 | lib/services/local_media_management_api.dart:943-990 — 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/settings/pages/developer_options_settings_content.dart:583— lib/settings/pages/developer_options_settings_content.dart:583-625 | lib/settings/pages/developer_options_settings_content.dart:627-717 | lib/settings/pages/developer_options_settings_content.dart:719-772 | lib/settings/pages/developer_options_settings_content.dart:774-876 — 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/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:387— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:387-406 | lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:408-427 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:361-380 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:382-401 — 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:82— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:82-110 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:112-158 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:118-146 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:148-194 — 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:477— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:477-610 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1287-1353 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:327-378 | lib/themes/nipaplay/widgets/smb_connection_dialog.dart:313-367 — 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/themes/nipaplay/widgets/playlist_menu.dart:321— lib/themes/nipaplay/widgets/playlist_menu.dart:321-388 | lib/themes/nipaplay/widgets/playlist_menu.dart:390-457 | lib/themes/nipaplay/widgets/playlist_menu.dart:459-507 | lib/themes/nipaplay/widgets/playlist_menu.dart:509-559 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (16 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:902— lib/danmaku_next/nipaplay_next_engine.dart:902-917 | lib/danmaku_next/nipaplay_next_old_engine.dart:745-760 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (16 lines × 2) lib/services/dandanplay_service_io.dart:2465— lib/services/dandanplay_service_io.dart:2465-2480 | lib/services/dandanplay_service_stub.dart:1866-1881 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2465` it does not close everything it opens, so those exact lines 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/dandanplay_service_io.dart:2540— lib/services/dandanplay_service_io.dart:2540-2555 | lib/services/dandanplay_service_io.dart:2751-2766 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_io.dart:2540` it begins part-way through the construct above it, so those 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/services/dandanplay_service_io.dart:2767` calls `debugPrint` and `lib/services/dandanplay_service_io.dart:2557` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) lib/services/dandanplay_service_stub.dart:1849— lib/services/dandanplay_service_stub.dart:1849-1864 | lib/services/dandanplay_service_stub.dart:1926-1941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/dandanplay_service_stub.dart:1849` it begins part-way through the construct above it, so those exact lines 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/emby_dandanplay_matcher.dart:1301— lib/services/emby_dandanplay_matcher.dart:1301-1316 | lib/services/jellyfin_dandanplay_matcher.dart:1349-1364 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1301` it begins part-way through the construct above it, so those exact lines 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/local_media_share_api.dart:375— lib/services/local_media_share_api.dart:375-390 | lib/services/web_api_service.dart:878-893 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/local_media_share_api.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 (16 lines × 2) lib/services/shared_remote_playback_sync_service.dart:38— lib/services/shared_remote_playback_sync_service.dart:38-53 | lib/services/web_remote_history_sync_service.dart:37-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/shared_remote_playback_sync_service.dart:38` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/cupertino_library_management_overview.dart:87— lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:87-102 | lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:184-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/cupertino_library_management_overview.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.
Duplicated block (16 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:305— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:305-320 | lib/themes/nipaplay/widgets/playlist_menu.dart:394-409 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:305` it does not close everything it opens, so those exact lines 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/themes/nipaplay/pages/settings/watch_history_page.dart:542— lib/themes/nipaplay/pages/settings/watch_history_page.dart:542-557 | lib/themes/nipaplay/pages/settings/watch_history_page.dart:563-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/watch_history_page.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.
Duplicated block (16 lines × 2) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:537— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:537-552 | lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:616-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:537` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/emby_library_card.dart:200— lib/themes/nipaplay/widgets/emby_library_card.dart:200-215 | lib/themes/nipaplay/widgets/jellyfin_library_card.dart:198-213 — before extracting anything, compare `lib/themes/nipaplay/widgets/emby_library_card.dart` and `lib/themes/nipaplay/widgets/jellyfin_library_card.dart` as WHOLE FILES: this scan already matched 4 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. 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/themes/nipaplay/widgets/hover_scale_text_button.dart:139— lib/themes/nipaplay/widgets/hover_scale_text_button.dart:139-154 | lib/themes/nipaplay/widgets/hover_scale_text_button.dart:161-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/themes/nipaplay/widgets/hover_scale_text_button.dart:139` 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/danmaku_overlay.dart:207— lib/widgets/danmaku_overlay.dart:207-222 | lib/widgets/danmaku_overlay.dart:229-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) lib/cpp_native/types/native_result_io.dart:16— lib/cpp_native/types/native_result_io.dart:16-31 | lib/cpp_native/types/native_result_web.dart:22-37 — before extracting anything, compare `lib/cpp_native/types/native_result_io.dart` and `lib/cpp_native/types/native_result_web.dart` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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/cpp_native/types/native_result_io.dart:16` 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) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:166— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:166-181 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:180-195 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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· Edited copy of a member (8 corresponding lines) · ×15
Edited copy of a member (8 corresponding lines) lib/services/backup_service.dart:53— lib/services/backup_service.dart:53-60 | lib/services/full_backup_service.dart:95-106 — 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/desktop_player_window_service.dart:392— lib/services/desktop_player_window_service.dart:392-399 | lib/services/desktop_player_window_service.dart:401-408 — 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/local_media_share_service.dart:80— lib/services/local_media_share_service.dart:80-87 | lib/services/web_api_service.dart:1153-1161 — 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/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:583— lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:583-591 | lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:593-600 — 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/external_player_session/vlc_session.dart:129— lib/models/external_player_session/vlc_session.dart:129-136 | lib/models/external_player_session/potplayer_session.dart:149-156 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) lib/services/danmaku_cache_manager.dart:119— lib/services/danmaku_cache_manager.dart:119-128 | lib/utils/storage_service.dart:316-323 — 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/themes/nipaplay/widgets/network_media_library_view.dart:332— lib/themes/nipaplay/widgets/network_media_library_view.dart:332-339 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:73-80 — 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/player_abstraction/video_player_adapter.dart:538— lib/player_abstraction/video_player_adapter.dart:538-547 | lib/player_abstraction/media_kit_player_adapter.dart:2624-2631 — 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/player_abstraction/erika_player_adapter.dart:259— lib/player_abstraction/erika_player_adapter.dart:259-267 | lib/widgets/macos_native_video_view.dart:259-266 — 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/themes/cupertino/widgets/cupertino_media_source_sheet.dart:114— lib/themes/cupertino/widgets/cupertino_media_source_sheet.dart:114-121 | lib/themes/nipaplay/widgets/media_server_selection_sheet.dart:179-186 — 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/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:598— lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:598-606 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:509-516 — 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:49— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:49-56 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:54-63 — 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/media_library/adaptive_media_library_primitives.dart:955— lib/media_library/adaptive_media_library_primitives.dart:955-962 | lib/themes/nipaplay/widgets/loading_overlay.dart:64-73 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) lib/providers/emby_provider.dart:69— lib/providers/emby_provider.dart:69-76 | lib/providers/jellyfin_provider.dart:69-78 — 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/plugins/models/plugin_permission.dart:25— lib/plugins/models/plugin_permission.dart:25-32 | lib/settings/pages/general_settings_content.dart:551-558 — 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.
rust_lib_nipaplay::next2_engine::engine::runtime::run_engine_loop (cognitive 84) rust/src/next2_engine/engine/runtime.rs:707— rust_lib_nipaplay::next2_engine::engine::runtime::run_engine_loop has cognitive complexity 84 (threshold 15). Drivers by points: if/else 25 (60 pts), match/switch 5 (15 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::dfm_plus::dfm_plus_prepare_layout (cognitive 57) rust/src/api/dfm_plus.rs:155— rust_lib_nipaplay::api::dfm_plus::dfm_plus_prepare_layout has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 10 (16 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::webdav_multistatus::parse_webdav_multistatus (cognitive 34) rust/src/api/webdav_multistatus.rs:17— rust_lib_nipaplay::api::webdav_multistatus::parse_webdav_multistatus has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::next2::prepare_merged_items (cognitive 32) rust/src/api/next2.rs:420— rust_lib_nipaplay::api::next2::prepare_merged_items has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::next2_engine::engine::frame::normalize_tokens (cognitive 31) rust/src/next2_engine/engine/frame.rs:117— rust_lib_nipaplay::next2_engine::engine::frame::normalize_tokens has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::dfm_core::retainer::select_scroll_track (cognitive 28) rust/src/dfm_core/retainer.rs:250— rust_lib_nipaplay::dfm_core::retainer::select_scroll_track has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::next2::next2_prepare_layout (cognitive 27) rust/src/api/next2.rs:88— rust_lib_nipaplay::api::next2::next2_prepare_layout has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 4, match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::media_metadata::subtitle_compute_match_score (cognitive 26) rust/src/api/media_metadata.rs:170— rust_lib_nipaplay::api::media_metadata::subtitle_compute_match_score has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, loops 1 (2 pts), match/switch 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, 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.
rust_lib_nipaplay::next2_engine::engine::runtime::render_linux_gl_texture (cognitive 21) rust/src/next2_engine/engine/runtime.rs:402— rust_lib_nipaplay::next2_engine::engine::runtime::render_linux_gl_texture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rust_lib_nipaplay::api::dfm_plus::build_dfm_plus_frame (cognitive 18) rust/src/api/dfm_plus.rs:416— rust_lib_nipaplay::api::dfm_plus::build_dfm_plus_frame has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::ass_converter::convert_prepared_danmaku_to_ass (cognitive 17) rust/src/api/ass_converter.rs:213— rust_lib_nipaplay::api::ass_converter::convert_prepared_danmaku_to_ass has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::startup_commands::parse_startup_command (cognitive 17) rust/src/api/startup_commands.rs:8— rust_lib_nipaplay::api::startup_commands::parse_startup_command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_lib_nipaplay::api::media_probe::probe_remote_media (cognitive 16) rust/src/api/media_probe.rs:26— rust_lib_nipaplay::api::media_probe::probe_remote_media has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
rust_lib_nipaplay::api::torrent::handle_stream_request (cognitive 16) rust/src/api/torrent.rs:512— rust_lib_nipaplay::api::torrent::handle_stream_request 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.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×14
Edited copy of a member (7 corresponding lines) lib/models/search_model.dart:59— lib/models/search_model.dart:59-65 | lib/models/search_model.dart:67-73 — 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/danmaku_next/next2_emoji_pipeline.dart:390— lib/danmaku_next/next2_emoji_pipeline.dart:390-400 | lib/utils/subtitle_parser.dart:708-714 — 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/themes/nipaplay/widgets/plugin_market_dialog.dart:89— lib/themes/nipaplay/widgets/plugin_market_dialog.dart:89-96 | lib/plugins/plugin_service.dart:390-396 — 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/models/jellyfin_transcode_settings.dart:179— lib/models/jellyfin_transcode_settings.dart:179-186 | lib/models/jellyfin_transcode_settings.dart:226-232 — 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/danmaku_next/nipaplay_next_old_canvas_painter.dart:386— lib/danmaku_next/nipaplay_next_old_canvas_painter.dart:386-392 | lib/models/media_identity.dart:101-109 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) lib/services/remote_control_api_service.dart:134— lib/services/remote_control_api_service.dart:134-140 | lib/services/remote_text_input_service.dart:577-586 — 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/pages/play_video_page.dart:122— lib/pages/play_video_page.dart:122-128 | lib/themes/nipaplay/widgets/video_player_ui.dart:304-311 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) lib/services/local_media_share_service.dart:336— lib/services/local_media_share_service.dart:336-342 | lib/services/playback_source_service.dart:925-931 — 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/themes/cupertino/widgets/player_menu/cupertino_seek_step_pane.dart:65— lib/themes/cupertino/widgets/player_menu/cupertino_seek_step_pane.dart:65-71 | lib/themes/nipaplay/widgets/seek_step_menu.dart:60-66 — 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/themes/nipaplay/widgets/blur_dropdown.dart:479— lib/themes/nipaplay/widgets/blur_dropdown.dart:479-485 | lib/themes/nipaplay/widgets/tooltip_bubble.dart:51-57 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) lib/services/dandanplay_service_io.dart:253— lib/services/dandanplay_service_io.dart:253-259 | lib/services/dandanplay_service_stub.dart:279-285 — 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/themes/cupertino/widgets/player_menu/cupertino_seek_step_pane.dart:47— lib/themes/cupertino/widgets/player_menu/cupertino_seek_step_pane.dart:47-54 | lib/themes/nipaplay/widgets/seek_step_menu.dart:43-49 — 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/cpp_native/bindings/example_calculator_io.dart:67— lib/cpp_native/bindings/example_calculator_io.dart:67-73 | lib/cpp_native/bindings/similarity_engine_io.dart:221-227 — 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/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:122— lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:122-128 | packages/adaptive_platform_ui/example/lib/pages/demos/native_search_tab_demo_page.dart:21-28 — 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· Edited copy of a member (16 corresponding lines) · ×13
Edited copy of a member (16 corresponding lines) lib/services/local_media_management_api.dart:127— lib/services/local_media_management_api.dart:127-142 | lib/services/local_media_management_api.dart:301-325 — 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/danmaku_next/danmaku_atlas_painter.dart:1670— lib/danmaku_next/danmaku_atlas_painter.dart:1670-1685 | lib/danmaku_next/nipaplay_next_old_canvas_painter.dart:292-316 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) lib/services/remote_control_auth_manager.dart:24— lib/services/remote_control_auth_manager.dart:24-39 | lib/services/remote_control_auth_manager.dart:48-63 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) lib/services/emby_media_preference_store.dart:455— lib/services/emby_media_preference_store.dart:455-470 | lib/services/emby_media_preference_store.dart:507-522 — 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/watch_history_model.dart:843— lib/models/watch_history_model.dart:843-858 | lib/models/watch_history_model.dart:860-875 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) lib/providers/emby_provider.dart:324— lib/providers/emby_provider.dart:324-339 | lib/providers/jellyfin_provider.dart:357-372 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:141— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:141-158 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:175-190 — 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/utils/hotkey_service.dart:878— lib/utils/hotkey_service.dart:878-895 | lib/utils/hotkey_service.dart:897-912 — 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/utils/app_theme.dart:102— lib/utils/app_theme.dart:102-117 | lib/utils/app_theme.dart:119-134 — 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/external_player_session/other_session.dart:192— lib/models/external_player_session/other_session.dart:192-207 | lib/models/external_player_session/vlc_session.dart:186-201 — 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/player_abstraction/media_kit_player_adapter.dart:1953— lib/player_abstraction/media_kit_player_adapter.dart:1953-1968 | lib/player_abstraction/video_player_adapter.dart:100-115 — 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/watch_history_database.dart:1164— lib/models/watch_history_database.dart:1164-1183 | lib/models/watch_history_database.dart:1240-1255 — 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:767— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:767-783 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1355-1370 — 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.
Duplicated block (20 lines × 2) lib/services/dandanplay_service_io.dart:453— lib/services/dandanplay_service_io.dart:453-472 | lib/services/dandanplay_service_stub.dart:346-365 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (20 lines × 2) lib/services/emby_dandanplay_matcher.dart:1119— lib/services/emby_dandanplay_matcher.dart:1119-1138 | lib/services/jellyfin_dandanplay_matcher.dart:1193-1212 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1119` 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/services/emby_service.dart:135— lib/services/emby_service.dart:135-154 | lib/services/jellyfin_service.dart:118-137 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:135` 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/services/shared_remote_playback_sync_service.dart:54— lib/services/shared_remote_playback_sync_service.dart:54-73 | lib/services/shared_remote_playback_sync_service.dart:134-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/shared_remote_playback_sync_service.dart:54` 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/settings/pages/network_settings_content.dart:576— lib/settings/pages/network_settings_content.dart:576-595 | lib/settings/pages/network_settings_content.dart:714-733 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/network_settings_content.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.
Duplicated block (20 lines × 2) lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:91— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:91-110 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:45-64 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart` and `lib/themes/cupertino/widgets/cupertino_rating_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:91` it does not close everything it opens, so those 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/themes/cupertino/widgets/cupertino_build_info_sheet.dart:51— lib/themes/cupertino/widgets/cupertino_build_info_sheet.dart:51-70 | lib/themes/cupertino/widgets/cupertino_dependency_versions_sheet.dart:105-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/cupertino_build_info_sheet.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 (20 lines × 2) lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:303— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:303-322 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:329-348 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart` and `lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 127 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:303` it begins part-way through the construct above it, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:343— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:343-362 | lib/themes/nipaplay/widgets/playlist_menu.dart:461-480 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/nipaplay/widgets/emby_library_card.dart:23— lib/themes/nipaplay/widgets/emby_library_card.dart:23-42 | lib/themes/nipaplay/widgets/jellyfin_library_card.dart:21-40 — before extracting anything, compare `lib/themes/nipaplay/widgets/emby_library_card.dart` and `lib/themes/nipaplay/widgets/jellyfin_library_card.dart` as WHOLE FILES: this scan already matched 4 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. 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/themes/nipaplay/widgets/emby_library_card.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.
Duplicated block (20 lines × 2) lib/themes/nipaplay/widgets/horizontal_anime_skeleton.dart:120— lib/themes/nipaplay/widgets/horizontal_anime_skeleton.dart:120-139 | lib/themes/nipaplay/widgets/horizontal_anime_skeleton.dart:150-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.
Duplicated block (20 lines × 2) lib/themes/nipaplay/widgets/network_media_library_view.dart:1830— lib/themes/nipaplay/widgets/network_media_library_view.dart:1830-1849 | lib/themes/nipaplay/widgets/network_media_library_view.dart:1896-1915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/network_media_library_view.dart:1830` 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/themes/nipaplay/widgets/seek_step_menu.dart:337— lib/themes/nipaplay/widgets/seek_step_menu.dart:337-356 | lib/themes/nipaplay/widgets/seek_step_menu.dart:426-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/seek_step_menu.dart:337` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D30 · Dependency Vulnerabilities· Medium CVE · ×12
Change coupling: cupertino_playlist_pane.dart ↔ playlist_menu.dart lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:1— `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` change together 91% of the time (10 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 10 shared commits counted here, the most recent 3 are `eb86e486` feat:内网和公网地址; `ca30f92e` fix: retain standalone media in Jellyfin and Emby playlists (#992); `d8a84fe2` 失败重试 — run `git show` on any of them.
Change coupling: cupertino_subtitle_settings_pane.dart ↔ subtitle_settings_menu.dart lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:1— `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `7a3636f9` fix(subtitle): 字幕颜色输入改 hex 对话框 + HSV 调色盘,输入键盘不再遮挡; `66e376ad` Update Erika integration for streaming and subtitles (#673); `f2dc1ef7` review solve2 — run `git show` on any of them.
Change coupling: emby_service.dart ↔ jellyfin_service.dart lib/services/emby_service.dart:1— `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` change together 72% of the time (31 of the 43 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 31 shared commits counted here, the most recent 3 are `9b1fd7e7` fix: add EnableUserData/enableUserData flag to episode query APIs; `899cfdef` feat: add watched indicator for episodes from remote media library (c…; `09f26c30` fix: address PR #457 review feedback — run `git show` on any of them.
Change coupling: dandanplay_remote_library_view.dart ↔ shared_remote_library_view.dart lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:1— `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `ddce370b` fix(tv): replace library header scaling with global 0.5x UI scale; `2e99063d` fix(tv): cap media library controls at one third of page height; `cfc8d5d5` fix(tvos): stabilize media cards and title account page — run `git show` on any of them.
Change coupling: dandanplay_remote_library_view.dart ↔ network_media_library_view.dart lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:1— `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` and `lib/themes/nipaplay/widgets/network_media_library_view.dart` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `ddce370b` fix(tv): replace library header scaling with global 0.5x UI scale; `2e99063d` fix(tv): cap media library controls at one third of page height; `cfc8d5d5` fix(tvos): stabilize media cards and title account page — run `git show` on any of them.
Change coupling: emby_provider.dart ↔ jellyfin_provider.dart lib/providers/emby_provider.dart:1— `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.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 `e137e7d3` fix: Jellyfin 支持剧集添加日期排序并兼容旧排序存档(#795) (#979); `22331504` feat: Enhance Jellyfin service and UI for mixed library navigation; `e13afbbf` feat: Add Cupertino network media library pages and components — run `git show` on any of them.
Change coupling: main.dart ↔ background_with_blur.dart lib/main.dart:1— `lib/main.dart` and `lib/themes/nipaplay/widgets/background_with_blur.dart` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `8a8a32ce` feat(macos): add HDR native video pipeline prototype; `fb39e261` feat(theme): add circular background reveal for light/dark toggle; `908e3f54` 1 — run `git show` on any of them.
Change coupling: subtitle_list_menu.dart ↔ subtitle_tracks_menu.dart lib/themes/nipaplay/widgets/subtitle_list_menu.dart:1— `lib/themes/nipaplay/widgets/subtitle_list_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_tracks_menu.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 `113e6faa` feat(subtitles): stack candidates in the track menu without stealing …; `c96ada4f` fix: external subtitle selection; `69edd517` 修复了通过右侧栏进入播放菜单时,还未交互就直接隐藏的bug (at that commit the files were still `lib/widgets/nipaplay_theme/subtitle_list_menu.dart` and `lib/widgets/nipaplay_theme/subtitle_tracks_menu.dart`) — run `git show` on any of them.
Change coupling: subtitle_manager.dart ↔ video_player_state_subtitles.dart lib/utils/subtitle_manager.dart:1— `lib/utils/subtitle_manager.dart` and `lib/utils/video_player_state/video_player_state_subtitles.dart` change together 54% of the time (7 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 — 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 `c47d0e64` fix(subtitles): keep app-rendered sidecars out of the native renderer; `db1129da` fix(subtitle): the overlay applies the SRT delay setting to the line …; `6d3f6d7e` fix(subtitles): show only one subtitle at a time when external text s… — run `git show` on any of them.
Change coupling: main.dart ↔ desktop_user_activity.dart lib/main.dart:1— `lib/main.dart` and `lib/widgets/user_activity/desktop_user_activity.dart` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `2501c555` 1 (at that commit the file was still `lib/widgets/user_activity/material_user_activity.dart`); `aa9033a0` 1 (at that commit the file was still `lib/widgets/user_activity/material_user_activity.dart`); `61e313b1` 1 (at that commit the file was still `lib/widgets/user_activity/material_user_activity.dart`) — run `git show` on any of them.
Change coupling: mdk_player_adapter_io.dart ↔ media_kit_player_adapter.dart lib/player_abstraction/mdk_player_adapter_io.dart:1— `lib/player_abstraction/mdk_player_adapter_io.dart` and `lib/player_abstraction/media_kit_player_adapter.dart` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `761f06aa` fix(player): await native teardown and release callback ownership safely; `0f3895ba` fix(player): serialize kernel teardown to fix mdk/libmpv hot-swap hang; `c4fd060d` fix(network): avoid duplicate player UA handling — run `git show` on any of them.
Change coupling: large_screen_anime_detail_page.dart ↔ large_screen_scaffold_layout.dart lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1— `lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart` and `lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `6bc5b182` fix(tvos): 修复登录恢复、系统键盘与遥控导航 (#1093); `beabc896` 若干优化和修复; `07195f43` 大屏幕模式手柄支持 — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×12
Edited copy of a member (9 corresponding lines) lib/widgets/emby_media_source_selector.dart:560— lib/widgets/emby_media_source_selector.dart:560-568 | lib/widgets/emby_media_source_selector.dart:570-579 — 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/services/smb_service.dart:397— lib/services/smb_service.dart:397-405 | lib/services/webdav_service.dart:828-841 — 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/services/remote_control_auth_manager.dart:147— lib/services/remote_control_auth_manager.dart:147-155 | lib/services/remote_control_auth_manager.dart:183-191 — 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/plugins/plugin_service.dart:182— lib/plugins/plugin_service.dart:182-190 | lib/plugins/plugin_service.dart:196-204 — 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/themes/nipaplay/widgets/subtitle_tracks_menu.dart:136— lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:136-146 | lib/utils/subtitle_manager.dart:451-459 — 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/danmaku_dfm/dfm_plus_layout_bridge.dart:438— lib/danmaku_dfm/dfm_plus_layout_bridge.dart:438-446 | lib/danmaku_next/next2_layout_bridge.dart:131-139 — 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) rust/src/next2_engine/engine/runtime.rs:193— rust/src/next2_engine/engine/runtime.rs:193-201 | rust/src/next2_engine/engine/runtime.rs:693-705 — 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/models/emby_model.dart:19— lib/models/emby_model.dart:19-27 | lib/models/jellyfin_model.dart:19-27 — 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/main.dart:1347— lib/main.dart:1347-1355 | lib/themes/cupertino/pages/cupertino_main_page.dart:241-249 — 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/models/external_player_session/mpv_session.dart:364— lib/models/external_player_session/mpv_session.dart:364-375 | lib/models/external_player_session/vlc_session.dart:347-355 — 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/providers/shared_remote_library_provider.dart:689— lib/providers/shared_remote_library_provider.dart:689-697 | lib/utils/remote_media_fetcher.dart:423-431 — 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/providers/emby_provider.dart:313— lib/providers/emby_provider.dart:313-321 | lib/providers/jellyfin_provider.dart:346-354 — 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 (4 corresponding lines) · ×11
Edited copy of a member (4 corresponding lines) lib/danmaku_next/nipaplay_next_engine.dart:72— lib/danmaku_next/nipaplay_next_engine.dart:72-75 | lib/danmaku_next/nipaplay_next_old_engine.dart:63-66 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/services/danmaku_spoiler_filter_service.dart:209— lib/services/danmaku_spoiler_filter_service.dart:209-213 | lib/services/torrent_download_service.dart:610-613 — 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/themes/nipaplay/widgets/danmaku_list_menu.dart:342— lib/themes/nipaplay/widgets/danmaku_list_menu.dart:342-345 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:558-561 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/services/dandanplay_service_io.dart:64— lib/services/dandanplay_service_io.dart:64-67 | lib/services/dandanplay_service_stub.dart:54-57 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/services/desktop_picture_in_picture_preferences.dart:41— lib/services/desktop_picture_in_picture_preferences.dart:41-46 | lib/services/desktop_startup_window_preferences.dart:108-111 — 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/themes/nipaplay/widgets/large_screen_mode_preferences.dart:8— lib/themes/nipaplay/widgets/large_screen_mode_preferences.dart:8-11 | lib/utils/settings_storage.dart:9-12 — 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/danmaku_next/danmaku_atlas_painter.dart:1700— lib/danmaku_next/danmaku_atlas_painter.dart:1700-1703 | lib/danmaku_next/nipaplay_next_old_canvas_painter.dart:362-365 — 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/plugins/plugin_service.dart:1734— lib/plugins/plugin_service.dart:1734-1737 | lib/utils/settings_storage.dart:25-28 — 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:192— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:192-195 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:228-231 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/services/desktop_picture_in_picture_preferences.dart:36— lib/services/desktop_picture_in_picture_preferences.dart:36-39 | lib/services/desktop_startup_window_preferences.dart:103-106 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) lib/services/playback_source_service.dart:894— lib/services/playback_source_service.dart:894-897 | lib/services/webdav_service.dart:1943-1946 — 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.
Duplicated block (21 lines × 2) lib/danmaku_next/nipaplay_next_old_overlay.dart:116— lib/danmaku_next/nipaplay_next_old_overlay.dart:116-136 | lib/danmaku_next/nipaplay_next_overlay.dart:134-154 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_old_overlay.dart` and `lib/danmaku_next/nipaplay_next_overlay.dart` as WHOLE FILES: this scan already matched 4 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. 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/danmaku_next/nipaplay_next_old_overlay.dart:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/providers/emby_provider.dart:517— lib/providers/emby_provider.dart:517-537 | lib/providers/jellyfin_provider.dart:93-113 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/services/dandanplay_service_io.dart:2582— lib/services/dandanplay_service_io.dart:2582-2602 | lib/services/dandanplay_service_stub.dart:1989-2009 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2582` 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/services/local_media_share_service.dart:379— lib/services/local_media_share_service.dart:379-399 | lib/utils/subtitle_parser.dart:988-1008 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/local_media_share_service.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. 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 lines × 2) lib/services/playback_source_service.dart:524— lib/services/playback_source_service.dart:524-544 | lib/services/playback_source_service.dart:569-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/playback_source_service.dart:524` it begins part-way through the construct above it, so those exact lines 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:254— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:254-274 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:370-390 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_list_menu.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. 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/themes/nipaplay/widgets/playback_rate_menu.dart:184— lib/themes/nipaplay/widgets/playback_rate_menu.dart:184-204 | lib/themes/nipaplay/widgets/seek_step_menu.dart:197-217 — before extracting anything, compare `lib/themes/nipaplay/widgets/playback_rate_menu.dart` and `lib/themes/nipaplay/widgets/seek_step_menu.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 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/themes/nipaplay/widgets/playback_rate_menu.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 (21 lines × 2) lib/themes/nipaplay/widgets/playlist_menu.dart:594— lib/themes/nipaplay/widgets/playlist_menu.dart:594-614 | lib/themes/nipaplay/widgets/playlist_menu.dart:658-678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/playlist_menu.dart:594` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/tag_search_widget.dart:1001— lib/themes/nipaplay/widgets/tag_search_widget.dart:1001-1021 | lib/themes/nipaplay/widgets/tag_search_widget.dart:1510-1530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/tag_search_widget.dart:1510` it begins part-way through the construct above it, so those 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/utils/video_player_state.dart:2162— lib/utils/video_player_state.dart:2162-2182 | lib/utils/video_player_state.dart:2186-2206 — both copies are in the same file, so extract the 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 (21 lines × 2) ios/Runner/AppDelegate.swift:183— ios/Runner/AppDelegate.swift:183-203 | macos/Runner/SystemSharePlugin.swift:37-57 — 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 `ios/Runner/AppDelegate.swift:183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×10
Edited copy of a member (18 corresponding lines) lib/models/emby_model.dart:263— lib/models/emby_model.dart:263-280 | lib/models/jellyfin_model.dart:289-306 — 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/themes/nipaplay/widgets/smb_connection_dialog.dart:9— lib/themes/nipaplay/widgets/smb_connection_dialog.dart:9-26 | lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:9-28 — 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/pages/media_server_detail_page.dart:1118— lib/pages/media_server_detail_page.dart:1118-1144 | lib/themes/nipaplay/widgets/media_capture_dialog.dart:1117-1134 — 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/models/watch_history_model.dart:920— lib/models/watch_history_model.dart:920-937 | lib/models/watch_history_model.dart:985-1002 — 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/player_abstraction/player_abstraction.dart:308— lib/player_abstraction/player_abstraction.dart:308-325 | lib/player_abstraction/player_abstraction.dart:327-344 — 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:9— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:9-26 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:9-28 — 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/app/unified_app_view_presenter.dart:109— lib/app/unified_app_view_presenter.dart:109-126 | lib/app/unified_app_view_presenter.dart:128-146 — 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/player_abstraction/player_abstraction.dart:394— lib/player_abstraction/player_abstraction.dart:394-417 | lib/player_abstraction/player_abstraction.dart:419-436 — 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/themes/nipaplay/widgets/danmaku_list_menu.dart:54— lib/themes/nipaplay/widgets/danmaku_list_menu.dart:54-72 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:63-80 — 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) macos/Runner/MainFlutterWindow.swift:249— macos/Runner/MainFlutterWindow.swift:249-267 | macos/Runner/MainFlutterWindow.swift:994-1011 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×10
Edited copy of a member (17 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:156— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:156-172 | lib/themes/nipaplay/widgets/playlist_menu.dart:235-259 — 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/themes/nipaplay/pages/settings/watch_history_page.dart:806— lib/themes/nipaplay/pages/settings/watch_history_page.dart:806-823 | lib/themes/nipaplay/widgets/history_all_modal.dart:225-241 — 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:66— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:66-82 | lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:187-203 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) lib/services/playback_source_service.dart:178— lib/services/playback_source_service.dart:178-194 | lib/services/playback_source_service.dart:790-809 — 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/models/emby_model.dart:283— lib/models/emby_model.dart:283-300 | lib/models/jellyfin_model.dart:309-325 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) lib/services/web_api_service.dart:393— lib/services/web_api_service.dart:393-409 | lib/services/web_api_service.dart:498-514 — 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/themes/nipaplay/widgets/large_screen_top_status_overlay.dart:52— lib/themes/nipaplay/widgets/large_screen_top_status_overlay.dart:52-68 | lib/themes/nipaplay/widgets/mobile_playback_status.dart:54-71 — 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) macos/Runner/MainFlutterWindow.swift:1080— macos/Runner/MainFlutterWindow.swift:1080-1096 | macos/Runner/MainFlutterWindow.swift:1342-1360 — 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/pages/anime_detail_page.dart:335— lib/pages/anime_detail_page.dart:335-352 | lib/pages/dashboard_home_page.dart:131-147 — 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/player_abstraction/video_player_adapter.dart:1114— lib/player_abstraction/video_player_adapter.dart:1114-1130 | lib/player_abstraction/video_player_adapter.dart:1132-1148 — 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.
X2 · Cancellation propagation· Function without a CancelToken · ×9
Function without a CancelToken: requestAllRequiredPermissions lib/utils/android_storage_helper.dart:92— `requestAllRequiredPermissions` calls `audio.request(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
Function without a CancelToken: webDavAuthenticatedGet lib/utils/webdav_http_auth.dart:145— `webDavAuthenticatedGet` calls `dio.getUri(…)` 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: _listManagedLibraryCandidates lib/services/remote_subtitle_service.dart:927— `_listManagedLibraryCandidates` 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: _listSharedRemoteCandidates lib/services/remote_subtitle_service.dart:1049— `_listSharedRemoteCandidates` 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: _listSharedRemoteAudioCandidates lib/services/remote_subtitle_service.dart:1153— `_listSharedRemoteAudioCandidates` 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: _listSharedRemoteFontCandidates lib/services/remote_subtitle_service.dart:1271— `_listSharedRemoteFontCandidates` 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: _downloadSharedRemoteAudio lib/services/remote_subtitle_service.dart:1392— `_downloadSharedRemoteAudio` 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: _downloadSharedRemoteFont lib/services/remote_subtitle_service.dart:1455— `_downloadSharedRemoteFont` 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: _downloadSharedRemoteSubtitle lib/services/remote_subtitle_service.dart:1928— `_downloadSharedRemoteSubtitle` 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`.
rust_lib_nipaplay::next2_engine::engine::runtime::run_engine_loop (cyclomatic 40) rust/src/next2_engine/engine/runtime.rs:707— rust_lib_nipaplay::next2_engine::engine::runtime::run_engine_loop 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.
rust_lib_nipaplay::api::dfm_plus::dfm_plus_prepare_layout (cyclomatic 32) rust/src/api/dfm_plus.rs:155— rust_lib_nipaplay::api::dfm_plus::dfm_plus_prepare_layout has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rust_lib_nipaplay::api::media_metadata::subtitle_compute_match_score (cyclomatic 29) rust/src/api/media_metadata.rs:170— rust_lib_nipaplay::api::media_metadata::subtitle_compute_match_score has cyclomatic complexity 29 (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.
rust_lib_nipaplay::api::webdav_multistatus::parse_webdav_multistatus (cyclomatic 21) rust/src/api/webdav_multistatus.rs:17— rust_lib_nipaplay::api::webdav_multistatus::parse_webdav_multistatus 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.
rust_lib_nipaplay::api::next2::next2_prepare_layout (cyclomatic 20) rust/src/api/next2.rs:88— rust_lib_nipaplay::api::next2::next2_prepare_layout 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.
rust_lib_nipaplay::next2_engine::engine::runtime::render_linux_gl_texture (cyclomatic 18) rust/src/next2_engine/engine/runtime.rs:402— rust_lib_nipaplay::next2_engine::engine::runtime::render_linux_gl_texture 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.
rust_lib_nipaplay::api::next2::prepare_merged_items (cyclomatic 16) rust/src/api/next2.rs:420— rust_lib_nipaplay::api::next2::prepare_merged_items 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.
rust_lib_nipaplay::dfm_core::retainer::select_scroll_track (cyclomatic 16) rust/src/dfm_core/retainer.rs:250— rust_lib_nipaplay::dfm_core::retainer::select_scroll_track has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (5 members, 50+ identical tokens) lib/models/watch_history_database.dart:196— lib/models/watch_history_database.dart:196-289 | lib/models/watch_history_database.dart:430-488 | lib/models/watch_history_database.dart:751-764 | lib/services/full_backup_service.dart:353-382 | lib/services/web_api_service.dart:718-749 — 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/providers/shared_remote_library_provider.dart:891— lib/providers/shared_remote_library_provider.dart:891-997 | lib/providers/shared_remote_library_provider.dart:999-1059 | lib/providers/shared_remote_library_provider.dart:1731-1815 | lib/providers/shared_remote_library_provider.dart:1817-1889 | lib/providers/shared_remote_library_provider.dart:1891-1944 — 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/dandanplay_service_stub.dart:630— lib/services/dandanplay_service_stub.dart:630-735 | lib/services/dandanplay_service_stub.dart:1035-1125 | lib/services/dandanplay_service_stub.dart:1450-1542 | lib/services/dandanplay_service_stub.dart:1831-1918 | lib/services/dandanplay_service_stub.dart:2040-2136 — 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/emby_dandanplay_matcher.dart:1357— lib/services/emby_dandanplay_matcher.dart:1357-1790 | lib/services/jellyfin_dandanplay_matcher.dart:1405-1838 | lib/themes/nipaplay/widgets/custom_slider.dart:60-118 | lib/themes/nipaplay/widgets/history_all_modal.dart:258-371 | lib/themes/nipaplay/widgets/translation_button.dart:111-202 — 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/emby_service.dart:1032— lib/services/emby_service.dart:1032-1063 | lib/services/jellyfin_service.dart:824-855 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:419-451 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:453-486 | lib/themes/nipaplay/widgets/playlist_menu.dart:616-678 — 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/local_media_share_api.dart:86— lib/services/local_media_share_api.dart:86-102 | lib/services/local_media_share_api.dart:104-124 | lib/services/local_media_share_api.dart:126-148 | lib/services/local_media_share_api.dart:192-214 | lib/services/local_media_share_api.dart:257-279 — 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/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:23— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:23-127 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_offset_pane.dart:61-186 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:304-713 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_tracks_pane.dart:72-166 | lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:262-385 — 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/themes/nipaplay/widgets/library_management_tab.dart:1093— lib/themes/nipaplay/widgets/library_management_tab.dart:1093-1260 | lib/themes/nipaplay/widgets/library_management_tab.dart:4920-5033 | lib/themes/nipaplay/widgets/library_management_tab.dart:5412-5615 | lib/themes/nipaplay/widgets/library_management_tab.dart:5617-5821 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1397-1494 — 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) · ×8
Edited copy of a member (24 corresponding lines) lib/themes/nipaplay/widgets/brightness_gesture_area.dart:60— lib/themes/nipaplay/widgets/brightness_gesture_area.dart:60-83 | lib/themes/nipaplay/widgets/volume_gesture_area.dart:60-83 — 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/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:567— lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:567-590 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:421-445 — 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/services/emby_service.dart:131— lib/services/emby_service.dart:131-154 | lib/services/jellyfin_service.dart:114-137 — 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/settings/pages/plugin_settings_content.dart:302— lib/settings/pages/plugin_settings_content.dart:302-325 | lib/settings/pages/remote_media_library_settings_content.dart:1432-1455 — 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/models/watch_history_database.dart:1186— lib/models/watch_history_database.dart:1186-1209 | lib/models/watch_history_database.dart:1212-1237 — 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/settings/pages/remote_access_receiver_settings_section.dart:757— lib/settings/pages/remote_access_receiver_settings_section.dart:757-780 | lib/settings/pages/remote_media_library_settings_content.dart:440-469 — 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/pages/account/account_page_view_model.dart:59— lib/pages/account/account_page_view_model.dart:59-88 | lib/pages/account/account_page_view_model.dart:229-252 — 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/services/smb_proxy_service.dart:388— lib/services/smb_proxy_service.dart:388-411 | lib/utils/subtitle_parser.dart:986-1014 — 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 (20 corresponding lines) · ×8
Edited copy of a member (20 corresponding lines) lib/models/external_player_session/mpv_session.dart:545— lib/models/external_player_session/mpv_session.dart:545-565 | lib/models/external_player_session/vlc_session.dart:203-222 — 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/danmaku_next/msdf_font_atlas.dart:46— lib/danmaku_next/msdf_font_atlas.dart:46-65 | lib/danmaku_next/msdf_font_atlas.dart:67-89 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) lib/services/dandanplay_service_stub.dart:2721— lib/services/dandanplay_service_stub.dart:2721-2740 | lib/services/dandanplay_service_stub.dart:2742-2763 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) lib/services/smb_service.dart:485— lib/services/smb_service.dart:485-506 | lib/services/webdav_service.dart:610-629 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:160— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:160-179 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:436-457 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) lib/services/dandanplay_service_io.dart:175— lib/services/dandanplay_service_io.dart:175-194 | lib/services/dandanplay_service_stub.dart:180-199 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) lib/services/dandanplay_service_io.dart:2577— lib/services/dandanplay_service_io.dart:2577-2602 | lib/services/dandanplay_service_io.dart:2605-2624 — 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) rust/src/api/next2.rs:604— rust/src/api/next2.rs:604-626 | rust/src/api/next2.rs:732-751 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×8
Edited copy of a member (11 corresponding lines) lib/models/external_player_session/potplayer_session.dart:366— lib/models/external_player_session/potplayer_session.dart:366-378 | lib/utils/subtitle_parser.dart:74-84 — 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/themes/nipaplay/pages/settings/backup_restore_page.dart:810— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:810-820 | lib/utils/auto_sync_settings.dart:200-211 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:123— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:123-133 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:135-145 — 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/themes/nipaplay/widgets/smb_connection_dialog.dart:120— lib/themes/nipaplay/widgets/smb_connection_dialog.dart:120-131 | lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:71-81 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) lib/services/smb_service.dart:337— lib/services/smb_service.dart:337-347 | lib/utils/video_player_state.dart:1106-1118 — 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:278— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:278-288 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:319-330 — 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/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:231— lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:231-241 | lib/themes/nipaplay/widgets/playback_rate_menu.dart:341-351 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) lib/services/smb_service.dart:67— lib/services/smb_service.dart:67-80 | lib/services/webdav_service.dart:43-53 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×8
Edited copy of a member (13 corresponding lines) lib/danmaku_next/next2_texture_bridge.dart:187— lib/danmaku_next/next2_texture_bridge.dart:187-202 | lib/danmaku_next/next2_texture_bridge.dart:204-216 — 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/pages/media_server_detail_page.dart:192— lib/pages/media_server_detail_page.dart:192-204 | lib/pages/media_server_detail_page.dart:206-221 — 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/search/tag_search_controller.dart:276— lib/search/tag_search_controller.dart:276-288 | lib/search/tag_search_controller.dart:290-302 — 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/themes/nipaplay/widgets/large_screen_top_status_overlay.dart:117— lib/themes/nipaplay/widgets/large_screen_top_status_overlay.dart:117-129 | lib/themes/nipaplay/widgets/mobile_playback_status.dart:103-119 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) lib/services/network_media_settings_api.dart:27— lib/services/network_media_settings_api.dart:27-47 | lib/services/network_media_settings_api.dart:81-93 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) lib/providers/appearance_settings_provider.dart:271— lib/providers/appearance_settings_provider.dart:271-283 | lib/providers/appearance_settings_provider.dart:363-375 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) lib/services/local_media_share_service.dart:1049— lib/services/local_media_share_service.dart:1049-1061 | lib/utils/shared_remote_history_helper.dart:18-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.
Edited copy of a member (13 corresponding lines) lib/services/dandanplay_service_io.dart:2913— lib/services/dandanplay_service_io.dart:2913-2928 | lib/services/dandanplay_service_stub.dart:2765-2777 — 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.
Duplicated block (26 lines × 2) lib/services/local_media_management_api.dart:551— lib/services/local_media_management_api.dart:551-576 | lib/themes/nipaplay/widgets/library_management_tab.dart:5925-5950 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/themes/nipaplay/widgets/library_management_tab.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/local_media_management_api.dart:551` it does not close everything it opens, so those exact lines 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/services/local_media_share_api.dart:335— lib/services/local_media_share_api.dart:335-360 | lib/services/web_api_service.dart:765-790 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/local_media_share_api.dart:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) lib/themes/cupertino/widgets/cupertino_network_server_connection_dialog.dart:30— lib/themes/cupertino/widgets/cupertino_network_server_connection_dialog.dart:30-55 | lib/themes/cupertino/widgets/cupertino_network_server_connection_dialog.dart:59-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/cupertino_network_server_connection_dialog.dart:30` it begins part-way through the construct above it, so those 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/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:300— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:300-325 | lib/themes/nipaplay/widgets/audio_tracks_menu.dart:67-92 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart` and `lib/themes/nipaplay/widgets/audio_tracks_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (26 lines × 2) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:456— lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:456-481 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:576-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/themes/nipaplay/widgets/jellyfin_quality_menu.dart:456` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/library_management_tab.dart:5235— lib/themes/nipaplay/widgets/library_management_tab.dart:5235-5260 | lib/themes/nipaplay/widgets/library_management_tab.dart:5329-5354 — both copies are in the same file, so extract the 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 `connection` to `WebDAVConnection` in one and `SMBConnection` 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 (26 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:6039— lib/themes/nipaplay/widgets/library_management_tab.dart:6039-6064 | lib/themes/nipaplay/widgets/library_management_tab.dart:6274-6299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:6039` it begins part-way through the construct above it, so those exact lines 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) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:55— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:55-80 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:49-74 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (24 lines × 2) lib/services/dandanplay_service_io.dart:1311— lib/services/dandanplay_service_io.dart:1311-1334 | lib/services/dandanplay_service_stub.dart:2216-2239 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1311` it begins part-way through the construct above it, so those 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/services/dandanplay_service_io.dart:1336` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:2241` 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 (24 lines × 2) lib/services/dandanplay_service_io.dart:2801— lib/services/dandanplay_service_io.dart:2801-2824 | lib/services/dandanplay_service_stub.dart:2596-2619 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (24 lines × 2) lib/services/webdav_service.dart:1579— lib/services/webdav_service.dart:1579-1602 | lib/services/webdav_service.dart:1603-1626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:169— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:169-192 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:258-281 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart` and `lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:381— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:381-404 | lib/themes/nipaplay/widgets/playlist_menu.dart:511-534 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (24 lines × 2) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:212— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:212-235 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:173-196 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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/themes/nipaplay/widgets/bangumi_collection_dialog.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.
Duplicated block (24 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:1924— lib/themes/nipaplay/widgets/library_management_tab.dart:1924-1947 | lib/themes/nipaplay/widgets/library_management_tab.dart:1957-1980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:1924` it does not close everything it opens, so those exact lines 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) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:183— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:183-206 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:197-220 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–21 lines × 2) lib/pages/desktop_player_window.dart:36— lib/pages/desktop_player_window.dart:36-55 | lib/pages/external_player_console_window.dart:37-57 — before extracting anything, compare `lib/pages/desktop_player_window.dart` and `lib/pages/external_player_console_window.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/pages/external_player_console_window.dart:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–21 lines × 2) lib/services/local_media_management_api.dart:278— lib/services/local_media_management_api.dart:278-297 | lib/services/local_media_management_api.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/services/local_media_management_api.dart:278` it begins part-way through the construct above it, so those 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/local_media_management_api.dart:277` calls `getFileUrl` and `lib/services/local_media_management_api.dart:447` 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 (20–21 lines × 2) lib/services/local_media_management_api.dart:531— lib/services/local_media_management_api.dart:531-550 | lib/themes/nipaplay/widgets/library_management_tab.dart:5892-5912 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/themes/nipaplay/widgets/library_management_tab.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/local_media_management_api.dart:531` it begins part-way through the construct above it, so those exact lines 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–21 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:60— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:60-80 | lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:97-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/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:60` it does not close everything it opens, so those exact lines 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–21 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:3423— lib/themes/nipaplay/widgets/library_management_tab.dart:3423-3443 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:412-431 — before extracting anything, compare `lib/themes/nipaplay/widgets/library_management_tab.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 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/themes/nipaplay/widgets/library_management_tab.dart:3423` it does not close everything it opens, so those exact lines 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–21 lines × 2) lib/themes/nipaplay/widgets/video_upload_ui.dart:385— lib/themes/nipaplay/widgets/video_upload_ui.dart:385-404 | lib/themes/nipaplay/widgets/video_upload_ui.dart:434-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/video_upload_ui.dart:434` it begins part-way through the construct above it, so those exact lines 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–21 lines × 2) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:569— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:569-589 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:577-596 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:590` calls `next2_engine_display_tick`, `CACurrentMediaTime` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:597` 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 (20–21 lines × 2) rust/src/api/file_scan.rs:281— rust/src/api/file_scan.rs:281-301 | rust/src/api/incremental_sync.rs:500-519 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17–18 lines × 2) lib/pages/webdav_browser_page.dart:1746— lib/pages/webdav_browser_page.dart:1746-1763 | lib/pages/webdav_browser_page.dart:1828-1844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/webdav_browser_page.dart:1746` it begins part-way through the construct above it, so those exact lines 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/dandanplay_service_io.dart:2119— lib/services/dandanplay_service_io.dart:2119-2136 | lib/services/dandanplay_service_stub.dart:1638-1654 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2119` it does not close everything it opens, so those exact lines 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/dandanplay_service_stub.dart:580— lib/services/dandanplay_service_stub.dart:580-596 | lib/services/dandanplay_service_stub.dart:1156-1173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.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 (17–18 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:260— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:260-277 | lib/themes/nipaplay/widgets/playlist_menu.dart:323-339 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (17–18 lines × 2) lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:574— lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:574-590 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:428-445 — before extracting anything, compare `lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart` and `lib/themes/nipaplay/widgets/large_screen_settings_panel.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. 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/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:574` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/playback_info_menu.dart:1001— lib/themes/nipaplay/widgets/playback_info_menu.dart:1001-1017 | lib/themes/nipaplay/widgets/playback_info_menu.dart:1042-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/playback_info_menu.dart:1001` it begins part-way through the construct above it, so those exact lines 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/widgets/danmaku_container.dart:675— lib/widgets/danmaku_container.dart:675-691 | lib/widgets/danmaku_container.dart:790-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/widgets/danmaku_container.dart:675` it begins part-way through the construct above it, so those 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/widgets/user_activity/desktop_user_activity.dart:246— lib/widgets/user_activity/desktop_user_activity.dart:246-263 | lib/widgets/user_activity/desktop_user_activity.dart:287-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/widgets/user_activity/desktop_user_activity.dart:246` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 4) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:491— lib/danmaku_dfm/dfm_plus_layout_bridge.dart:491-499 | lib/danmaku_next/next2_layout_bridge.dart:167-175 | lib/danmaku_next/nipaplay_next_engine.dart:1035-1043 | lib/danmaku_next/nipaplay_next_old_engine.dart:878-886 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_layout_bridge.dart` and `lib/danmaku_next/next2_layout_bridge.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/danmaku_dfm/dfm_plus_layout_bridge.dart:491` it does not close everything it opens, so those exact lines 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/models/emby_model.dart:184— lib/models/emby_model.dart:184-192 | lib/models/emby_model.dart:400-408 | lib/models/jellyfin_model.dart:210-218 | lib/models/jellyfin_model.dart:425-433 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) lib/models/watch_history_database.dart:238— lib/models/watch_history_database.dart:238-246 | lib/models/watch_history_database.dart:449-457 | lib/models/watch_history_database.dart:470-478 | lib/models/watch_history_database.dart:755-763 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) lib/models/watch_history_database.dart:237— lib/models/watch_history_database.dart:237-245 | lib/models/watch_history_database.dart:448-456 | lib/models/watch_history_database.dart:754-762 | lib/services/web_api_service.dart:728-736 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) lib/services/dandanplay_service_io.dart:1127— lib/services/dandanplay_service_io.dart:1127-1136 | lib/services/dandanplay_service_io.dart:1916-1924 | lib/services/dandanplay_service_io.dart:2397-2405 | lib/services/dandanplay_service_io.dart:2465-2473 — 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/services/dandanplay_service_io.dart:1127` it begins part-way through the construct above it, so those exact lines 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/services/local_media_management_api.dart:238— lib/services/local_media_management_api.dart:238-246 | lib/services/local_media_management_api.dart:405-413 | lib/services/local_media_management_api.dart:606-614 | lib/services/local_media_management_api.dart:1010-1018 — 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. 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 × 4) lib/services/local_media_management_api.dart:683— lib/services/local_media_management_api.dart:683-691 | lib/services/local_media_management_api.dart:750-758 | lib/services/local_media_management_api.dart:832-840 | lib/services/local_media_management_api.dart:952-960 — 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. 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 × 4) rust/src/next2_engine/ffi.rs:71— rust/src/next2_engine/ffi.rs:71-79 | rust/src/next2_engine/ffi.rs:112-120 | rust/src/next2_engine/ffi.rs:372-380 | rust/src/next2_engine/ffi.rs:405-413 — 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 `rust/src/next2_engine/ffi.rs:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×7
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×7
Edited copy of a member (33 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:6404— lib/themes/nipaplay/widgets/library_management_tab.dart:6404-6436 | lib/themes/nipaplay/widgets/library_management_tab.dart:6552-6585 — 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/models/watch_history_model.dart:387— lib/models/watch_history_model.dart:387-429 | lib/models/watch_history_model.dart:432-464 — 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/themes/nipaplay/widgets/plugin_market_dialog.dart:44— lib/themes/nipaplay/widgets/plugin_market_dialog.dart:44-76 | lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:30-63 — 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/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:59— lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:59-91 | lib/themes/cupertino/widgets/player_menu/cupertino_seek_step_pane.dart:73-105 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:190— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:190-222 | lib/themes/nipaplay/widgets/danmaku_list_menu.dart:285-339 — 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/themes/nipaplay/widgets/library_management_tab.dart:3666— lib/themes/nipaplay/widgets/library_management_tab.dart:3666-3703 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:627-659 — 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/themes/nipaplay/widgets/library_management_tab.dart:3630— lib/themes/nipaplay/widgets/library_management_tab.dart:3630-3664 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:593-625 — 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 (30 corresponding lines) · ×7
Edited copy of a member (30 corresponding lines) lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:21— lib/danmaku_gpu/lib/gpu_bottom_danmaku_renderer.dart:21-50 | lib/danmaku_gpu/lib/gpu_top_danmaku_renderer.dart:20-49 — 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/themes/nipaplay/pages/settings/watch_history_page.dart:343— lib/themes/nipaplay/pages/settings/watch_history_page.dart:343-384 | lib/themes/nipaplay/widgets/history_all_modal.dart:373-402 — 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/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:380— lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:380-414 | lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:747-776 — 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/settings/pages/storage_settings_content.dart:283— lib/settings/pages/storage_settings_content.dart:283-312 | lib/settings/pages/storage_settings_content.dart:340-369 — 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/themes/nipaplay/widgets/danmaku_settings_menu.dart:752— lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:752-783 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:961-990 — 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/main.dart:1243— lib/main.dart:1243-1272 | lib/utils/launch_file_handler.dart:8-39 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) lib/settings/pages/network_settings_content.dart:410— lib/settings/pages/network_settings_content.dart:410-441 | lib/settings/pages/network_settings_content.dart:443-472 — 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 (21 corresponding lines) · ×7
Edited copy of a member (21 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:276— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:276-296 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:392-412 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) lib/providers/emby_provider.dart:155— lib/providers/emby_provider.dart:155-175 | lib/providers/jellyfin_provider.dart:188-208 — 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/pages/anime_detail_page.dart:3517— lib/pages/anime_detail_page.dart:3517-3540 | lib/pages/media_server_detail_page.dart:1771-1791 — 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/themes/nipaplay/widgets/large_screen_page_scaffold.dart:507— lib/themes/nipaplay/widgets/large_screen_page_scaffold.dart:507-527 | lib/themes/nipaplay/widgets/settings_item.dart:911-932 — 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/themes/nipaplay/widgets/modern_video_controls.dart:476— lib/themes/nipaplay/widgets/modern_video_controls.dart:476-501 | lib/themes/nipaplay/widgets/video_player_ui.dart:655-675 — 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/themes/nipaplay/widgets/tag_search_widget.dart:816— lib/themes/nipaplay/widgets/tag_search_widget.dart:816-836 | lib/themes/nipaplay/widgets/tag_search_widget.dart:838-858 — 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/themes/nipaplay/widgets/anime_card.dart:206— lib/themes/nipaplay/widgets/anime_card.dart:206-226 | lib/themes/nipaplay/widgets/horizontal_anime_card.dart:112-136 — 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 (15 corresponding lines) · ×7
Edited copy of a member (15 corresponding lines) lib/plugins/plugin_service.dart:217— lib/plugins/plugin_service.dart:217-234 | lib/plugins/plugin_service.dart:236-250 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) lib/services/dandanplay_service_io.dart:481— lib/services/dandanplay_service_io.dart:481-495 | lib/services/dandanplay_service_stub.dart:374-388 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) rust/src/api/media_metadata.rs:106— rust/src/api/media_metadata.rs:106-120 | rust/src/api/media_metadata.rs:125-139 — 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:521— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:521-537 | lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:612-626 — 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/providers/shared_remote_library_provider.dart:785— lib/providers/shared_remote_library_provider.dart:785-799 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:803-820 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:715— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:715-731 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:859-873 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) rust/src/api/next2.rs:834— rust/src/api/next2.rs:834-848 | rust/src/dfm_core/model.rs:411-427 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×7
Edited copy of a member (14 corresponding lines) lib/themes/nipaplay/widgets/brightness_gesture_area.dart:27— lib/themes/nipaplay/widgets/brightness_gesture_area.dart:27-40 | lib/themes/nipaplay/widgets/volume_gesture_area.dart:27-40 — 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:56— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:56-69 | lib/themes/nipaplay/widgets/smb_connection_dialog.dart:101-118 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) lib/services/emby_playback_sync_service.dart:20— lib/services/emby_playback_sync_service.dart:20-33 | lib/services/jellyfin_playback_sync_service.dart:20-39 — 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/widgets/danmaku_container.dart:1102— lib/widgets/danmaku_container.dart:1102-1115 | lib/widgets/danmaku_container.dart:1118-1131 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:486— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:486-502 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:499-512 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) lib/services/smb_service.dart:458— lib/services/smb_service.dart:458-471 | lib/services/webdav_service.dart:583-596 — 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:458— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:458-472 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1272-1285 — 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.
Duplicated block (14–15 lines × 2) lib/player_abstraction/media_kit_player_adapter.dart:1898— lib/player_abstraction/media_kit_player_adapter.dart:1898-1912 | lib/player_abstraction/media_kit_player_adapter.dart:2050-2063 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/media_kit_player_adapter.dart:1898` it does not close everything it opens, so those 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/player_abstraction/media_kit_player_adapter.dart:2065` calls `setSubtitleTrack`, `no` and `lib/player_abstraction/media_kit_player_adapter.dart:1914` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) lib/providers/shared_remote_library_provider.dart:1062— lib/providers/shared_remote_library_provider.dart:1062-1076 | lib/providers/shared_remote_library_provider.dart:1575-1588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1062` 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 × 2) lib/services/dandanplay_service_io.dart:2706— lib/services/dandanplay_service_io.dart:2706-2719 | lib/services/dandanplay_service_stub.dart:2112-2126 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_stub.dart:2112` it begins part-way through the construct above it, so those 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/dandanplay_service_io.dart:2703` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:2111` 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–15 lines × 2) lib/services/local_media_management_api.dart:241— lib/services/local_media_management_api.dart:241-255 | lib/services/local_media_management_api.dart:408-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/local_media_management_api.dart:241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/themes/nipaplay/widgets/library_management_tab.dart:3822— lib/themes/nipaplay/widgets/library_management_tab.dart:3822-3835 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:986-1000 — before extracting anything, compare `lib/themes/nipaplay/widgets/library_management_tab.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 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/themes/nipaplay/widgets/library_management_tab.dart:3822` 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/themes/nipaplay/widgets/modern_video_controls.dart:353— lib/themes/nipaplay/widgets/modern_video_controls.dart:353-366 | lib/themes/nipaplay/widgets/modern_video_controls.dart:418-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/themes/nipaplay/widgets/modern_video_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. 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) rust/src/next2_engine/engine/rendering.rs:165— rust/src/next2_engine/engine/rendering.rs:165-179 | rust/src/next2_engine/engine/rendering.rs:525-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/src/next2_engine/engine/rendering.rs: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.
Duplicated block (11 lines × 3) lib/models/watch_history_database.dart:235— lib/models/watch_history_database.dart:235-245 | lib/models/watch_history_database.dart:446-456 | lib/models/watch_history_database.dart:752-762 — 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/pages/anime_detail_page.dart:1694— lib/pages/anime_detail_page.dart:1694-1704 | lib/pages/anime_detail_page.dart:2117-2127 | lib/pages/anime_detail_page.dart:2155-2165 — 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/pages/anime_detail_page.dart:1694` it does not close everything it opens, so those exact lines 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/providers/dandanplay_remote_provider.dart:94— lib/providers/dandanplay_remote_provider.dart:94-104 | lib/providers/emby_provider.dart:275-285 | lib/providers/jellyfin_provider.dart:308-318 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/providers/dandanplay_remote_provider.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 (11 lines × 3) lib/providers/shared_remote_library_provider.dart:1805— lib/providers/shared_remote_library_provider.dart:1805-1815 | lib/providers/shared_remote_library_provider.dart:1879-1889 | lib/providers/shared_remote_library_provider.dart:1934-1944 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1805` 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 × 3) lib/settings/pages/remote_access_receiver_settings_section.dart:490— lib/settings/pages/remote_access_receiver_settings_section.dart:490-501 | lib/settings/pages/remote_access_receiver_settings_section.dart:965-975 | lib/themes/nipaplay/pages/settings/debug_log_viewer_page.dart:658-669 — 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/settings/pages/remote_access_receiver_settings_section.dart:490` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:145— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:145-155 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:110-120 | lib/themes/nipaplay/widgets/smb_connection_dialog.dart:73-83 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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/themes/nipaplay/widgets/bangumi_collection_dialog.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. 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/settings/pages/player_settings_content.dart:1130— lib/settings/pages/player_settings_content.dart:1130-1140 | lib/settings/pages/remote_media_library_settings_content.dart:1667-1677 | lib/settings/widgets/media_server_connection_user_agent_setting.dart:191-201 — 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. 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–10 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:290— lib/danmaku_next/nipaplay_next_engine.dart:290-298 | lib/danmaku_next/nipaplay_next_engine.dart:309-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/danmaku_next/nipaplay_next_engine.dart:309` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) lib/player_abstraction/video_player_adapter.dart:561— lib/player_abstraction/video_player_adapter.dart:561-570 | lib/player_abstraction/video_player_adapter.dart:574-582 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/video_player_adapter.dart:561` it begins part-way through the construct above it, so those 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 (9–10 lines × 2) lib/player_abstraction/video_player_adapter.dart:669— lib/player_abstraction/video_player_adapter.dart:669-677 | lib/player_abstraction/video_player_adapter.dart:770-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/video_player_adapter.dart:669` it begins part-way through the construct above it, so those 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 (9–10 lines × 2) lib/services/dandanplay_service_stub.dart:1364— lib/services/dandanplay_service_stub.dart:1364-1373 | lib/services/dandanplay_service_stub.dart:1750-1758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:1364` it does not close everything it opens, so those 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–10 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:1101— lib/themes/nipaplay/widgets/library_management_tab.dart:1101-1110 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1429-1437 — before extracting anything, compare `lib/themes/nipaplay/widgets/library_management_tab.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 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/themes/nipaplay/widgets/library_management_tab.dart:1101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) lib/themes/nipaplay/widgets/smb_connection_dialog.dart:84— lib/themes/nipaplay/widgets/smb_connection_dialog.dart:84-92 | lib/themes/nipaplay/widgets/smb_connection_dialog.dart:264-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:108— lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:108-116 | lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:310-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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×6
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×6
Edited copy of a member (23 corresponding lines) lib/services/remote_subtitle_service.dart:313— lib/services/remote_subtitle_service.dart:313-337 | lib/services/remote_subtitle_service.dart:359-381 — 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) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:568— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:568-592 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:576-598 — 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/services/smb_service.dart:709— lib/services/smb_service.dart:709-731 | lib/services/webdav_service.dart:706-740 — 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/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:157— lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:157-179 | lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:192-217 — 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/themes/nipaplay/widgets/blur_dropdown.dart:74— lib/themes/nipaplay/widgets/blur_dropdown.dart:74-96 | lib/themes/nipaplay/widgets/network_check_dialog.dart:22-46 — 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:1091— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:1091-1113 | lib/widgets/external_subtitle_overlay.dart:1013-1036 — 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 (6 corresponding lines) · ×6
Edited copy of a member (6 corresponding lines) lib/themes/cupertino/widgets/cupertino_media_source_sheet.dart:123— lib/themes/cupertino/widgets/cupertino_media_source_sheet.dart:123-128 | lib/themes/nipaplay/widgets/media_server_selection_sheet.dart:188-197 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) rust/src/api/next2.rs:996— rust/src/api/next2.rs:996-1002 | rust/src/next2_engine/engine/rendering.rs:968-973 — 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/models/trending_bangumi.dart:133— lib/models/trending_bangumi.dart:133-138 | lib/services/random_recommendation_service.dart:98-105 — 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/services/smb_proxy_service.dart:381— lib/services/smb_proxy_service.dart:381-386 | lib/services/webdav_service.dart:1902-1907 — 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/services/dandanplay_service_io.dart:430— lib/services/dandanplay_service_io.dart:430-436 | lib/services/dandanplay_service_stub.dart:328-333 — 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/player_abstraction/mdk_player_adapter_io.dart:692— lib/player_abstraction/mdk_player_adapter_io.dart:692-699 | lib/player_abstraction/video_player_adapter.dart:1164-1169 — 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.
Duplicated block (28 lines × 2) lib/pages/dashboard_home_page.dart:791— lib/pages/dashboard_home_page.dart:791-818 | lib/pages/dashboard_home_page.dart:852-879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/dashboard_home_page.dart:791` it begins part-way through the construct above it, so those 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 (28 lines × 2) lib/providers/shared_remote_library_provider.dart:1979— lib/providers/shared_remote_library_provider.dart:1979-2006 | lib/providers/shared_remote_library_provider.dart:2041-2068 — both copies are in the same file, so extract the 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 (28 lines × 2) lib/providers/shared_remote_library_provider.dart:2009— lib/providers/shared_remote_library_provider.dart:2009-2036 | lib/providers/shared_remote_library_provider.dart:2071-2098 — both copies are in the same file, so extract the 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 (28 lines × 2) lib/services/dandanplay_service_io.dart:2352— lib/services/dandanplay_service_io.dart:2352-2379 | lib/services/dandanplay_service_stub.dart:1697-1724 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/dandanplay_service_io.dart:2381` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:1726` 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 (28 lines × 2) lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:341— lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:341-368 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:476-503 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_comment_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (28 lines × 2) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:1213— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:1213-1240 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:914-941 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:1213` 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 (23 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:1004— lib/danmaku_next/nipaplay_next_engine.dart:1004-1026 | lib/danmaku_next/nipaplay_next_old_engine.dart:847-869 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (23 lines × 2) lib/models/watch_history_database.dart:1105— lib/models/watch_history_database.dart:1105-1127 | lib/models/watch_history_database.dart:1139-1161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/watch_history_database.dart:1105` it begins part-way through the construct above it, so those exact lines 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/providers/emby_provider.dart:269— lib/providers/emby_provider.dart:269-291 | lib/providers/jellyfin_provider.dart:302-324 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/providers/emby_provider.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.
Duplicated block (23 lines × 2) lib/services/dandanplay_service_io.dart:1987— lib/services/dandanplay_service_io.dart:1987-2009 | lib/services/dandanplay_service_stub.dart:1483-1505 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1987` it does not close everything it opens, so those exact lines 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/services/emby_service.dart:53— lib/services/emby_service.dart:53-75 | lib/services/jellyfin_service.dart:28-50 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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 (23 lines × 2) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:512— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:512-534 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:520-542 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:512` 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–16 lines × 2) lib/pages/dashboard_home_page.dart:1136— lib/pages/dashboard_home_page.dart:1136-1150 | lib/pages/dashboard_home_page.dart:1184-1199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/dashboard_home_page.dart:1136` it begins part-way through the construct above it, so those exact lines 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/services/local_media_management_api.dart:815— lib/services/local_media_management_api.dart:815-829 | lib/services/local_media_management_api.dart:975-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/services/local_media_management_api.dart:815` it begins part-way through the construct above it, so those exact lines 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/services/playback_source_service.dart:643— lib/services/playback_source_service.dart:643-658 | lib/services/playback_source_service.dart:731-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/playback_source_service.dart:643` it begins part-way through the construct above it, so those 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–16 lines × 2) lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:299— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:299-313 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:212-227 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart` and `lib/themes/cupertino/widgets/cupertino_rating_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.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.
Duplicated block (15–16 lines × 2) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:956— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:956-970 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:587-602 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:956` it does not close everything it opens, so those 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–16 lines × 2) lib/themes/nipaplay/widgets/nipaplay_window.dart:335— lib/themes/nipaplay/widgets/nipaplay_window.dart:335-350 | lib/themes/nipaplay/widgets/nipaplay_window.dart:469-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/nipaplay_window.dart:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
FunctionTooLong: rust_lib_nipaplay::next2_engine::engine::runtime::run_engine_loop rust/src/next2_engine/engine/runtime.rs:707— FunctionTooLong — rust_lib_nipaplay::next2_engine::engine::runtime::run_engine_loop runs 188 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rust_lib_nipaplay::api::dfm_plus::dfm_plus_prepare_layout rust/src/api/dfm_plus.rs:155— FunctionTooLong — rust_lib_nipaplay::api::dfm_plus::dfm_plus_prepare_layout runs 165 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rust_lib_nipaplay::api::next2::next2_prepare_layout rust/src/api/next2.rs:88— FunctionTooLong — rust_lib_nipaplay::api::next2::next2_prepare_layout runs 150 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: nipaplay_dandanplay_gateway::proxy server/dandanplay-gateway/src/main.rs:250— FunctionTooLong — nipaplay_dandanplay_gateway::proxy runs 122 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rust_lib_nipaplay::api::ass_converter::convert_danmaku_to_ass rust/src/api/ass_converter.rs:83— FunctionTooLong — rust_lib_nipaplay::api::ass_converter::convert_danmaku_to_ass runs 102 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×5
Edited copy of a member (37 corresponding lines) lib/services/local_media_management_api.dart:1220— lib/services/local_media_management_api.dart:1220-1256 | lib/services/local_media_share_service.dart:363-407 — 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/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:342— lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:342-378 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:380-417 — 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/themes/nipaplay/widgets/custom_media_info_dialog.dart:1441— lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1441-1478 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1481-1517 — 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:155— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:155-191 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:89-133 — 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/pages/anime_detail_page.dart:409— lib/pages/anime_detail_page.dart:409-445 | lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:434-478 — 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 (29 corresponding lines) · ×5
Edited copy of a member (29 corresponding lines) lib/pages/anime_detail_page.dart:1301— lib/pages/anime_detail_page.dart:1301-1329 | lib/pages/media_server_detail_page.dart:732-761 — 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/dandanplay_service_io.dart:2847— lib/services/dandanplay_service_io.dart:2847-2879 | lib/services/dandanplay_service_io.dart:2882-2910 — 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/settings/pages/general_settings_content.dart:411— lib/settings/pages/general_settings_content.dart:411-445 | lib/settings/pages/general_settings_content.dart:471-499 — 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/danmaku_next/nipaplay_next_engine.dart:482— lib/danmaku_next/nipaplay_next_engine.dart:482-510 | lib/danmaku_next/nipaplay_next_old_engine.dart:358-387 — 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) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:504— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:504-534 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:514-542 — 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 (19 corresponding lines) · ×5
Edited copy of a member (19 corresponding lines) lib/services/web_api_service.dart:630— lib/services/web_api_service.dart:630-648 | lib/services/web_api_service.dart:695-716 — 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/plugins/plugin_service.dart:1634— lib/plugins/plugin_service.dart:1634-1652 | lib/plugins/plugin_service.dart:1682-1701 — 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/models/external_player_session/other_session.dart:153— lib/models/external_player_session/other_session.dart:153-171 | lib/models/external_player_session/vlc_session.dart:102-121 — 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/services/media_server_service_base.dart:887— lib/services/media_server_service_base.dart:887-905 | lib/services/media_server_service_base.dart:952-971 — 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/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:156— lib/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:156-174 | lib/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:176-194 — 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 (5 corresponding lines) · ×5
Edited copy of a member (5 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:134— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:134-139 | lib/themes/nipaplay/widgets/danmaku_list_menu.dart:368-372 — 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/themes/nipaplay/widgets/media_capture_dialog.dart:1023— lib/themes/nipaplay/widgets/media_capture_dialog.dart:1023-1027 | packages/adaptive_platform_ui/example/lib/pages/info/info_page.dart:102-110 — 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/models/torrent_task.dart:231— lib/models/torrent_task.dart:231-236 | lib/services/intro_skip/aniskip_service.dart:194-198 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:236— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:236-240 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:388-392 — 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/themes/nipaplay/widgets/video_player_ui.dart:190— lib/themes/nipaplay/widgets/video_player_ui.dart:190-194 | lib/utils/hotkey_service.dart:344-350 — 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.
Duplicated block (39 lines × 2) lib/services/dandanplay_service_io.dart:512— lib/services/dandanplay_service_io.dart:512-550 | lib/services/dandanplay_service_stub.dart:405-443 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:512` it does not close everything it opens, so those 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/services/dandanplay_service_io.dart:551` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:444` 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 (39 lines × 2) lib/services/dandanplay_service_io.dart:605— lib/services/dandanplay_service_io.dart:605-643 | lib/services/dandanplay_service_stub.dart:495-533 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (39 lines × 2) lib/services/dandanplay_service_stub.dart:1408— lib/services/dandanplay_service_stub.dart:1408-1446 | lib/services/dandanplay_service_stub.dart:1789-1827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:1408` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:680— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:680-718 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:436-474 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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 (39 lines × 2) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1045— lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1045-1083 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:1027-1065 — before extracting anything, compare `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 96 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 (29 lines × 2) lib/services/emby_dandanplay_matcher.dart:1327— lib/services/emby_dandanplay_matcher.dart:1327-1355 | lib/services/jellyfin_dandanplay_matcher.dart:1375-1403 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1327` it does not close everything it opens, so those 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:82— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:82-110 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:118-146 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (29 lines × 2) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:1242— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:1242-1270 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:944-972 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 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 (29 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:4564— lib/themes/nipaplay/widgets/library_management_tab.dart:4564-4592 | lib/themes/nipaplay/widgets/library_management_tab.dart:4650-4678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:4564` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/playlist_menu.dart:740— lib/themes/nipaplay/widgets/playlist_menu.dart:740-768 | lib/themes/nipaplay/widgets/playlist_menu.dart:842-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/playlist_menu.dart:740` it begins part-way through the construct above it, so those exact lines 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/danmaku_next/nipaplay_next_engine.dart:864— lib/danmaku_next/nipaplay_next_engine.dart:864-890 | lib/danmaku_next/nipaplay_next_old_engine.dart:707-733 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (27 lines × 2) lib/services/emby_service.dart:735— lib/services/emby_service.dart:735-761 | lib/services/jellyfin_service.dart:618-644 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:735` it does not close everything it opens, so those exact lines 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/services/local_media_management_api.dart:1222— lib/services/local_media_management_api.dart:1222-1248 | lib/services/local_media_share_service.dart:365-391 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_management_api.dart:1222` it does not close everything it opens, so those 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 lines × 2) lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart:1323— lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart:1323-1349 | lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart:1396-1422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart:1323` 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 (27 lines × 2) lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1006— lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1006-1032 | lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1040-1066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1006` it begins part-way through the construct above it, so those exact lines 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 × 2) lib/pages/anime_detail_page.dart:2995— lib/pages/anime_detail_page.dart:2995-3018 | lib/themes/nipaplay/widgets/immersive_episode_rail.dart:309-331 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/anime_detail_page.dart:2995` 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 (23–24 lines × 2) lib/services/network_media_settings_api.dart:54— lib/services/network_media_settings_api.dart:54-77 | lib/services/network_media_settings_api.dart:100-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/services/network_media_settings_api.dart:54` 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–24 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:744— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:744-767 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:823-845 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:744` it does not close everything it opens, so those 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:846` calls `clamp` and `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:768` 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 (23–24 lines × 2) lib/utils/watch_history_auto_match_helper.dart:265— lib/utils/watch_history_auto_match_helper.dart:265-287 | lib/utils/watch_history_auto_match_helper.dart:320-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/watch_history_auto_match_helper.dart:265` it does not close everything it opens, so those 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 (23–24 lines × 2) tool/ohos_erika_smoke.dart:175— tool/ohos_erika_smoke.dart:175-197 | tool/ohos_mdk_smoke.dart:217-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `tool/ohos_erika_smoke.dart:175` 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–13 lines × 2) lib/models/watch_history_database.dart:355— lib/models/watch_history_database.dart:355-367 | lib/models/watch_history_database.dart:381-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/watch_history_database.dart:355` it begins part-way through the construct above it, so those 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/pages/anime_detail_page.dart:2115— lib/pages/anime_detail_page.dart:2115-2127 | lib/pages/anime_detail_page.dart:2154-2165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/anime_detail_page.dart:2115` it begins part-way through the construct above it, so those exact lines 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/player_menu/player_menu_pane_controllers.dart:99— lib/player_menu/player_menu_pane_controllers.dart:99-110 | lib/settings/pages/player_settings_content.dart:248-260 — 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/settings/pages/player_settings_content.dart:248` it begins part-way through the construct above it, so those 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/settings/pages/player_settings_content.dart:261` calls `sort` and `lib/player_menu/player_menu_pane_controllers.dart:111` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) lib/services/dandanplay_remote_service.dart:162— lib/services/dandanplay_remote_service.dart:162-174 | lib/services/dandanplay_remote_service.dart:258-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/dandanplay_remote_service.dart:162` it begins part-way through the construct above it, so those exact lines 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/settings/pages/remote_access_receiver_settings_section.dart:103— lib/settings/pages/remote_access_receiver_settings_section.dart:103-115 | lib/themes/nipaplay/widgets/library_management_tab.dart:5113-5124 — 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/settings/pages/remote_access_receiver_settings_section.dart:103` 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 (6 lines × 3) lib/services/dandanplay_service_io.dart:147— lib/services/dandanplay_service_io.dart:147-152 | lib/services/dandanplay_service_stub.dart:852-857 | lib/services/dandanplay_service_stub.dart:947-952 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:147` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) lib/themes/nipaplay/widgets/blur_login_dialog.dart:173— lib/themes/nipaplay/widgets/blur_login_dialog.dart:173-178 | lib/themes/nipaplay/widgets/web_remote_access_gate.dart:176-181 | lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:88-93 — 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/themes/nipaplay/widgets/blur_login_dialog.dart:173` it does not close everything it opens, so those exact lines 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/services/remote_subtitle_service.dart:1680— lib/services/remote_subtitle_service.dart:1680-1685 | lib/services/webdav_service.dart:1765-1770 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:136-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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 × 3) lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:94— lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:94-99 | lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:628-633 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:166-171 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_comment_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) ios/Runner/AirPlayRoutePickerView.swift:68— ios/Runner/AirPlayRoutePickerView.swift:68-73 | packages/adaptive_platform_ui/ios/Classes/iOS26SegmentedControlView.swift:151-156 | packages/adaptive_platform_ui/ios/Classes/iOS26TabBarPlatformView.swift:573-578 — 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 `ios/Runner/AirPlayRoutePickerView.swift:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
Hollow method — returns a constant without doing the work packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:60— `maybeControllerOf` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:66— `isSecondaryWindow` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:67— `fromWindowId` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:80— `createPopupWindow` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:92— `createTooltipWindow` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×5
Recursive walk over a caller-supplied document has no depth cap rust/src/next2_engine/engine/command_channel.rs:35— `clone` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 35 with a piece of the document (and at line 36) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rust/src/next2_engine/engine/command_channel.rs:42— `send` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 42 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `send` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rust/src/next2_engine/engine/command_channel.rs:56— `try_recv` is public and takes a `Receiver` as its receiver from its caller, and it calls itself at line 56 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `try_recv` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rust/src/next2_engine/engine/command_channel.rs:79— `recv_timeout` is public and takes a `Receiver` as its receiver from its caller, and it calls itself at line 79 with a piece of the document (and at line 83) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `recv_timeout` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap lib/services/incremental_sync_repository.dart:399— `canonicalJson` is public, takes a document from its caller (line 392) and hands it to `_canonicalize`, which calls itself at line 399 (`_canonicalize`) with a piece of `value` (and at line 402) — and nowhere in `_canonicalize` 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 `_canonicalize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Swallowed exception (caught, then discarded) packages/media_kit/lib/src/player/web/player/real.dart:1486— `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) packages/fluent_ui-4.15.1/lib/src/controls/pickers/color_picker/color_state.dart:193— `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) packages/fluent_ui-4.15.1/lib/src/controls/form/number_box.dart:807— `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) packages/danmaku_canvas/lib/canvas_danmaku_renderer.dart:650— `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) packages/adaptive_platform_ui/lib/src/widgets/ios26/ios26_native_search_tab_bar.dart:123— `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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×4
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (6 members, 50+ identical tokens) lib/models/emby_model.dart:62— lib/models/emby_model.dart:62-83 | lib/models/emby_model.dart:155-196 | lib/models/emby_model.dart:368-411 | lib/models/jellyfin_model.dart:85-106 | lib/models/jellyfin_model.dart:178-222 | lib/models/jellyfin_model.dart:393-436 — 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/services/local_media_management_api.dart:746— lib/services/local_media_management_api.dart:746-829 | lib/services/local_media_management_api.dart:943-990 | lib/services/local_media_share_service.dart:409-468 | lib/services/local_media_share_service.dart:561-596 | lib/services/local_media_share_service.dart:781-851 | lib/services/local_media_share_service.dart:853-889 — 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/themes/nipaplay/widgets/library_management_tab.dart:3766— lib/themes/nipaplay/widgets/library_management_tab.dart:3766-3858 | lib/themes/nipaplay/widgets/library_management_tab.dart:4180-4247 | lib/themes/nipaplay/widgets/network_media_library_view.dart:705-741 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:516-552 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:554-591 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:927-1024 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) rust/src/next2_engine/ffi.rs:61— rust/src/next2_engine/ffi.rs:61-84 | rust/src/next2_engine/ffi.rs:102-125 | rust/src/next2_engine/ffi.rs:140-159 | rust/src/next2_engine/ffi.rs:232-261 | rust/src/next2_engine/ffi.rs:325-385 | rust/src/next2_engine/ffi.rs:395-418 — 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 (40 corresponding lines) · ×4
Edited copy of a member (40 corresponding lines) lib/services/local_media_management_api.dart:157— lib/services/local_media_management_api.dart:157-196 | lib/services/local_media_management_api.dart:340-379 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) lib/services/external_player_console_window_service.dart:33— lib/services/external_player_console_window_service.dart:33-73 | lib/services/external_player_console_window_service.dart:75-114 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) lib/models/watch_history_model.dart:228— lib/models/watch_history_model.dart:228-282 | lib/models/watch_history_model.dart:285-324 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) lib/services/emby_dandanplay_matcher.dart:906— lib/services/emby_dandanplay_matcher.dart:906-945 | lib/services/jellyfin_dandanplay_matcher.dart:977-1022 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×4
Edited copy of a member (39 corresponding lines) lib/themes/nipaplay/widgets/playback_info_menu.dart:1000— lib/themes/nipaplay/widgets/playback_info_menu.dart:1000-1038 | lib/themes/nipaplay/widgets/playback_info_menu.dart:1041-1086 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) lib/themes/cupertino/widgets/cupertino_player_menu.dart:58— lib/themes/cupertino/widgets/cupertino_player_menu.dart:58-99 | lib/themes/nipaplay/widgets/large_screen_player_menu_pane_host.dart:66-104 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) lib/widgets/user_activity/desktop_user_activity.dart:226— lib/widgets/user_activity/desktop_user_activity.dart:226-268 | lib/widgets/user_activity/desktop_user_activity.dart:270-308 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) lib/utils/hotkey_service.dart:302— lib/utils/hotkey_service.dart:302-342 | lib/utils/hotkey_service.dart:915-953 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (34 corresponding lines) · ×4
Edited copy of a member (34 corresponding lines) lib/themes/nipaplay/widgets/playback_rate_menu.dart:67— lib/themes/nipaplay/widgets/playback_rate_menu.dart:67-100 | lib/themes/nipaplay/widgets/seek_step_menu.dart:68-105 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1010— lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1010-1043 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:992-1025 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:3974— lib/themes/nipaplay/widgets/library_management_tab.dart:3974-4007 | lib/themes/nipaplay/widgets/library_management_tab.dart:4108-4142 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) lib/themes/cupertino/widgets/cupertino_bottom_sheet.dart:376— lib/themes/cupertino/widgets/cupertino_bottom_sheet.dart:376-410 | lib/themes/cupertino/widgets/cupertino_bottom_sheet.dart:412-445 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×4
Edited copy of a member (27 corresponding lines) lib/pages/torrent_download_page.dart:871— lib/pages/torrent_download_page.dart:871-901 | lib/pages/torrent_download_page.dart:903-929 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) lib/services/torrent_download_service.dart:304— lib/services/torrent_download_service.dart:304-332 | lib/services/torrent_download_service.dart:334-360 — 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/themes/nipaplay/widgets/network_media_library_view.dart:671— lib/themes/nipaplay/widgets/network_media_library_view.dart:671-703 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:488-514 — 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/providers/emby_provider.dart:123— lib/providers/emby_provider.dart:123-153 | lib/providers/jellyfin_provider.dart:160-186 — 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 copy of a member (26 corresponding lines) · ×4
Edited copy of a member (26 corresponding lines) lib/providers/shared_remote_library_provider.dart:758— lib/providers/shared_remote_library_provider.dart:758-783 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:822-848 — 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:224— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:224-250 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:135-160 — 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/utils/screen_orientation_manager.dart:139— lib/utils/screen_orientation_manager.dart:139-178 | lib/utils/screen_orientation_manager.dart:181-206 — 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/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:496— lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:496-522 | lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:524-549 — 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 (3 corresponding lines) · ×4
Edited copy of a member (3 corresponding lines) lib/services/dandanplay_service_io.dart:501— lib/services/dandanplay_service_io.dart:501-503 | lib/services/dandanplay_service_stub.dart:394-396 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) lib/danmaku_next/nipaplay_next_engine.dart:1081— lib/danmaku_next/nipaplay_next_engine.dart:1081-1083 | lib/danmaku_next/nipaplay_next_old_engine.dart:915-917 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) lib/services/emby_playback_sync_service.dart:50— lib/services/emby_playback_sync_service.dart:50-52 | lib/services/jellyfin_playback_sync_service.dart:56-59 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) lib/services/emby_playback_sync_service.dart:46— lib/services/emby_playback_sync_service.dart:46-48 | lib/services/jellyfin_playback_sync_service.dart:52-54 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18 lines × 3) lib/pages/new_series_page.dart:530— lib/pages/new_series_page.dart:530-547 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:244-261 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:760-777 — before extracting anything, compare `lib/pages/new_series_page.dart` and `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/pages/new_series_page.dart:530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) lib/services/local_media_share_service.dart:471— lib/services/local_media_share_service.dart:471-488 | lib/services/local_media_share_service.dart:599-616 | lib/services/local_media_share_service.dart:672-689 — 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/local_media_share_service.dart:471` 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 × 3) lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:237— lib/themes/cupertino/widgets/cupertino_comment_dialog.dart:237-254 | lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:393-410 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:365-382 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_comment_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/cupertino_comment_dialog.dart:237` 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/themes/nipaplay/widgets/lock_controls_button.dart:67— lib/themes/nipaplay/widgets/lock_controls_button.dart:67-84 | lib/themes/nipaplay/widgets/send_danmaku_button.dart:68-85 | lib/themes/nipaplay/widgets/skip_button.dart:65-82 — before extracting anything, compare `lib/themes/nipaplay/widgets/send_danmaku_button.dart` and `lib/themes/nipaplay/widgets/skip_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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/themes/nipaplay/widgets/lock_controls_button.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.
Duplicated block (16–17 lines × 3) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:375— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:375-390 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:347-362 | lib/themes/nipaplay/widgets/rating_dialog.dart:253-269 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:375` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/network_media_library_view.dart:716— lib/themes/nipaplay/widgets/network_media_library_view.dart:716-731 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:524-540 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:566-581 — before extracting anything, compare `lib/themes/nipaplay/widgets/network_media_library_view.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 92 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/themes/nipaplay/widgets/network_media_library_view.dart:716` it begins part-way through the construct above it, so those 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/widgets/danmaku_container.dart:589— lib/widgets/danmaku_container.dart:589-604 | lib/widgets/danmaku_container.dart:632-648 | lib/widgets/danmaku_container.dart:666-681 — 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/danmaku_container.dart:589` 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 × 3) lib/widgets/danmaku_container.dart:704— lib/widgets/danmaku_container.dart:704-719 | lib/widgets/danmaku_container.dart:747-763 | lib/widgets/danmaku_container.dart:781-796 — 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/danmaku_container.dart:704` 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 × 3) lib/services/dandanplay_service_io.dart:1138— lib/services/dandanplay_service_io.dart:1138-1153 | lib/services/dandanplay_service_io.dart:2013-2028 | lib/services/dandanplay_service_io.dart:2484-2499 — 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/dandanplay_service_io.dart:1138` it does not close everything it opens, so those exact lines 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/themes/nipaplay/widgets/history_all_modal.dart:110— lib/themes/nipaplay/widgets/history_all_modal.dart:110-125 | lib/themes/nipaplay/widgets/rating_dialog.dart:127-142 | lib/widgets/context_menu/src/context_menu_styles.dart:123-138 — 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 (16 lines × 3) lib/themes/nipaplay/widgets/library_management_tab.dart:1855— lib/themes/nipaplay/widgets/library_management_tab.dart:1855-1870 | lib/themes/nipaplay/widgets/library_management_tab.dart:1879-1894 | lib/themes/nipaplay/widgets/library_management_tab.dart:1993-2008 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:499— lib/themes/nipaplay/widgets/network_media_server_dialog.dart:499-514 | lib/themes/nipaplay/widgets/network_media_server_dialog.dart:560-575 | lib/themes/nipaplay/widgets/network_media_server_dialog.dart:592-607 — 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/themes/nipaplay/widgets/network_media_server_dialog.dart:499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) lib/models/watch_history_model.dart:406— lib/models/watch_history_model.dart:406-420 | lib/models/watch_history_model.dart:447-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/models/watch_history_model.dart:406` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) lib/player_abstraction/media_kit_player_adapter.dart:492— lib/player_abstraction/media_kit_player_adapter.dart:492-504 | lib/player_abstraction/media_kit_player_adapter.dart:516-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/media_kit_player_adapter.dart:492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) lib/plugins/plugin_service.dart:577— lib/plugins/plugin_service.dart:577-591 | lib/plugins/plugin_service.dart:593-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. 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–15 lines × 2) lib/providers/shared_remote_library_provider.dart:565— lib/providers/shared_remote_library_provider.dart:565-577 | lib/providers/shared_remote_library_provider.dart:623-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:565` it does not close everything it opens, so those 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 (11–14 lines × 2) lib/models/watch_history_model.dart:576— lib/models/watch_history_model.dart:576-586 | lib/models/watch_history_model.dart:620-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/models/watch_history_model.dart:636` calls `toJson`, `toList`, `encode` and `lib/models/watch_history_model.dart:587` 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–14 lines × 2) lib/services/file_picker_service.dart:865— lib/services/file_picker_service.dart:865-878 | lib/services/file_picker_service.dart:887-897 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/file_picker_service.dart:865` it begins part-way through the construct above it, so those 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–14 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:88— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:88-98 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1187-1200 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:88` it does not close everything it opens, so those 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–14 lines × 2) lib/themes/nipaplay/widgets/playback_rate_menu.dart:215— lib/themes/nipaplay/widgets/playback_rate_menu.dart:215-228 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:494-504 — 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/themes/nipaplay/widgets/playback_rate_menu.dart:215` it begins part-way through the construct above it, so those exact lines 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/media_library/adaptive_media_library_primitives.dart:767— lib/media_library/adaptive_media_library_primitives.dart:767-778 | lib/media_library/adaptive_media_library_primitives.dart:837-848 | lib/media_library/adaptive_media_library_primitives.dart:898-909 — 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/services/dandanplay_service_stub.dart:1040— lib/services/dandanplay_service_stub.dart:1040-1051 | lib/services/dandanplay_service_stub.dart:1836-1847 | lib/services/dandanplay_service_stub.dart:2046-2057 — 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/dandanplay_service_stub.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.
Duplicated block (12 lines × 3) lib/services/remote_subtitle_service.dart:1529— lib/services/remote_subtitle_service.dart:1529-1540 | lib/services/remote_subtitle_service.dart:1576-1587 | lib/services/remote_subtitle_service.dart:1803-1814 — 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/remote_subtitle_service.dart:1529` it does not close everything it opens, so those exact lines 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/pages/new_series_page.dart:600— lib/pages/new_series_page.dart:600-611 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:373-384 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1081-1092 — before extracting anything, compare `lib/pages/new_series_page.dart` and `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (10 lines × 3) lib/models/external_player_session/mpv_session.dart:443— lib/models/external_player_session/mpv_session.dart:443-452 | lib/models/external_player_session/mpv_session.dart:491-500 | lib/models/external_player_session/mpv_session.dart:640-649 — 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/external_player_session/mpv_session.dart:443` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/models/external_player_session/mpv_session.dart:439` calls `_connectToIpc` and `lib/models/external_player_session/mpv_session.dart:487` 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 × 3) lib/services/dandanplay_service_io.dart:1915— lib/services/dandanplay_service_io.dart:1915-1924 | lib/services/dandanplay_service_io.dart:2396-2405 | lib/services/dandanplay_service_io.dart:2464-2473 — 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/dandanplay_service_io.dart:1915` it begins part-way through the construct above it, so those exact lines 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/services/local_media_management_api.dart:239— lib/services/local_media_management_api.dart:239-248 | lib/services/local_media_management_api.dart:406-415 | lib/services/local_media_management_api.dart:607-616 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) lib/services/local_media_management_api.dart:684— lib/services/local_media_management_api.dart:684-693 | lib/services/local_media_management_api.dart:833-842 | lib/services/local_media_management_api.dart:953-962 — 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/local_media_management_api.dart:684` it does not close everything it opens, so those exact lines 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/services/auto_next_episode_service.dart:52— lib/services/auto_next_episode_service.dart:52-59 | lib/services/auto_next_episode_service.dart:247-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/auto_next_episode_service.dart:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/auto_next_episode_service.dart:50` calls `debugPrint` and `lib/services/auto_next_episode_service.dart:246` 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–9 lines × 2) lib/services/full_backup_service.dart:1046— lib/services/full_backup_service.dart:1046-1054 | lib/services/full_backup_service.dart:1091-1098 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/full_backup_service.dart:1046` it does not close everything it opens, so those exact lines 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/settings/pages/developer_options_settings_content.dart:363— lib/settings/pages/developer_options_settings_content.dart:363-371 | lib/settings/pages/remote_media_library_settings_content.dart:1473-1480 — 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/settings/pages/developer_options_settings_content.dart:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:111— lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:111-118 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1110-1118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/custom_media_info_dialog.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:118` calls `withOpacity` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1118` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) lib/media_library/adaptive_media_collection_view.dart:123— lib/media_library/adaptive_media_collection_view.dart:123-129 | lib/media_library/adaptive_media_collection_view.dart:139-145 | lib/media_library/adaptive_media_collection_view.dart:336-342 — 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/media_library/adaptive_media_collection_view.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.
Duplicated block (7 lines × 3) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:821— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:821-827 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1410-1416 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:427-435 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:821` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 3) lib/providers/shared_remote_library_provider.dart:2131— lib/providers/shared_remote_library_provider.dart:2131-2137 | lib/services/playback_source_service.dart:871-877 | lib/services/playback_source_service.dart:1001-1007 — 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/services/playback_source_service.dart:1001` it begins part-way through the construct above it, so those 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 × 3) lib/models/external_player_session/mpv_session.dart:685— lib/models/external_player_session/mpv_session.dart:685-691 | lib/models/external_player_session/other_session.dart:243-249 | lib/models/external_player_session/vlc_session.dart:365-371 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/models/external_player_session/vlc_session.dart:361` calls `_deleteRcSocket` and `lib/models/external_player_session/other_session.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.
Next2GlyphAtlas::upload_glyph (cognitive 22) rust/src/next2_engine/engine/rendering.rs:764— Next2GlyphAtlas::upload_glyph has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Next2GlyphAtlas::alloc_atlas_space (cognitive 16) rust/src/next2_engine/engine/rendering.rs:573— Next2GlyphAtlas::alloc_atlas_space has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Next2GlyphAtlas::evict_oldest (cognitive 16) rust/src/next2_engine/engine/rendering.rs:623— Next2GlyphAtlas::evict_oldest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×3
Edited copy of a member (63 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:3908— lib/themes/nipaplay/widgets/library_management_tab.dart:3908-3972 | lib/themes/nipaplay/widgets/library_management_tab.dart:4044-4106 — 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:633— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:633-695 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:450-516 — 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/services/file_picker_service.dart:258— lib/services/file_picker_service.dart:258-341 | lib/services/file_picker_service.dart:502-564 — 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 (44 corresponding lines) · ×3
Edited copy of a member (44 corresponding lines) lib/services/playback_source_service.dart:495— lib/services/playback_source_service.dart:495-544 | lib/services/playback_source_service.dart:546-589 — 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/themes/nipaplay/widgets/library_management_tab.dart:492— lib/themes/nipaplay/widgets/library_management_tab.dart:492-535 | lib/themes/nipaplay/widgets/library_management_tab.dart:6495-6549 — 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:134— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:134-180 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:180-223 — 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 (35 corresponding lines) · ×3
Edited copy of a member (35 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:118— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:118-152 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:157-192 — 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/services/emby_dandanplay_matcher.dart:713— lib/services/emby_dandanplay_matcher.dart:713-747 | lib/services/jellyfin_dandanplay_matcher.dart:748-786 — 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) tool/ohos_mdk_reopen_smoke.dart:146— tool/ohos_mdk_reopen_smoke.dart:146-180 | tool/ohos_mdk_smoke.dart:196-240 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×3
Edited copy of a member (43 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:4517— lib/themes/nipaplay/widgets/library_management_tab.dart:4517-4560 | lib/themes/nipaplay/widgets/library_management_tab.dart:4604-4646 — 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/services/emby_service.dart:572— lib/services/emby_service.dart:572-614 | lib/services/jellyfin_service.dart:445-488 — 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/themes/nipaplay/widgets/library_management_tab.dart:5054— lib/themes/nipaplay/widgets/library_management_tab.dart:5054-5101 | lib/themes/nipaplay/widgets/library_management_tab.dart:5103-5145 — 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 (41 corresponding lines) · ×3
Edited copy of a member (41 corresponding lines) lib/services/playback_source_service.dart:618— lib/services/playback_source_service.dart:618-665 | lib/services/playback_source_service.dart:712-752 — 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/themes/nipaplay/widgets/library_management_tab.dart:4562— lib/themes/nipaplay/widgets/library_management_tab.dart:4562-4602 | lib/themes/nipaplay/widgets/library_management_tab.dart:4648-4688 — 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:141— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:141-181 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:205-260 — 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 (45 corresponding lines) · ×3
Edited copy of a member (45 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:267— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:267-311 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:515-573 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:733— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:733-777 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:811-857 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:5824— lib/themes/nipaplay/widgets/library_management_tab.dart:5824-5870 | lib/themes/nipaplay/widgets/library_management_tab.dart:6180-6224 — 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, 35+ corresponding lines) · ×3
Edited copies of one member (3 members, 35+ corresponding lines) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:785— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:785-819 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1372-1408 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:391-425 — 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.
Edited copies of one member (3 members, 35+ corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:809— lib/themes/nipaplay/widgets/library_management_tab.dart:809-846 | lib/themes/nipaplay/widgets/library_management_tab.dart:1628-1666 | lib/themes/nipaplay/widgets/library_management_tab.dart:4301-4335 — 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.
Edited copies of one member (3 members, 35+ corresponding lines) lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:30— lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:30-67 | lib/themes/nipaplay/widgets/glass_bottom_sheet.dart:25-59 | lib/themes/nipaplay/widgets/text_input_dialog.dart:87-131 — 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 copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) lib/themes/nipaplay/widgets/large_screen_mode_actions.dart:139— lib/themes/nipaplay/widgets/large_screen_mode_actions.dart:139-173 | lib/themes/nipaplay/widgets/large_screen_mode_actions.dart:359-389 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) lib/widgets/emby_media_source_selector.dart:409— lib/widgets/emby_media_source_selector.dart:409-439 | lib/widgets/emby_media_source_selector.dart:441-479 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) lib/providers/shared_remote_library_provider.dart:1170— lib/providers/shared_remote_library_provider.dart:1170-1200 | lib/providers/shared_remote_library_provider.dart:1449-1479 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×3
Edited copy of a member (36 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:5148— lib/themes/nipaplay/widgets/library_management_tab.dart:5148-5184 | lib/themes/nipaplay/widgets/library_management_tab.dart:5186-5221 — 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/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:906— lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:906-943 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:945-980 — 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/services/emby_dandanplay_matcher.dart:1103— lib/services/emby_dandanplay_matcher.dart:1103-1138 | lib/services/jellyfin_dandanplay_matcher.dart:1177-1212 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×3
Edited copy of a member (22 corresponding lines) lib/services/local_media_management_api.dart:381— lib/services/local_media_management_api.dart:381-402 | lib/services/local_media_management_api.dart:657-680 — 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/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:651— lib/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:651-672 | lib/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:713-738 — 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:333— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:333-354 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:460-485 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×3
Edited copies of one member (3 members, 15+ corresponding lines) lib/models/watch_history_model.dart:1166— lib/models/watch_history_model.dart:1166-1180 | lib/models/watch_history_model.dart:1183-1203 | lib/models/watch_history_model.dart:1206-1226 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) lib/settings/pages/about_settings_content.dart:421— lib/settings/pages/about_settings_content.dart:421-435 | lib/settings/unified_settings_entries.dart:669-683 | lib/themes/nipaplay/widgets/splash_screen.dart:20-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) lib/player_abstraction/erika_player_adapter.dart:277— lib/player_abstraction/erika_player_adapter.dart:277-292 | lib/widgets/macos_native_video_view.dart:112-126 | lib/widgets/macos_native_video_view.dart:268-285 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×3
Edited copies of one member (3 members, 6+ corresponding lines) lib/pages/play_video_page.dart:285— lib/pages/play_video_page.dart:285-294 | lib/themes/nipaplay/widgets/modern_video_controls.dart:122-127 | lib/themes/nipaplay/widgets/seek_indicator.dart:10-18 — 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.
Edited copies of one member (3 members, 6+ corresponding lines) lib/services/remote_control_auth_manager.dart:41— lib/services/remote_control_auth_manager.dart:41-46 | lib/services/remote_control_auth_manager.dart:65-70 | lib/services/webdav_service.dart:364-373 — 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.
Edited copies of one member (3 members, 6+ corresponding lines) lib/services/playback_source_service.dart:879— lib/services/playback_source_service.dart:879-884 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:125-130 | lib/themes/nipaplay/widgets/playlist_menu.dart:194-201 — 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, 14+ corresponding lines) · ×3
Edited copies of one member (3 members, 14+ corresponding lines) rust/src/next2_engine/engine/runtime.rs:292— rust/src/next2_engine/engine/runtime.rs:292-307 | rust/src/next2_engine/engine/runtime.rs:310-323 | rust/src/next2_engine/engine/runtime.rs:326-339 — 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) rust/src/next2_engine/ffi.rs:264— rust/src/next2_engine/ffi.rs:264-277 | rust/src/next2_engine/ffi.rs:280-297 | rust/src/next2_engine/ffi.rs:300-313 — 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/themes/cupertino/pages/cupertino_main_page.dart:272— lib/themes/cupertino/pages/cupertino_main_page.dart:272-285 | lib/themes/cupertino/pages/cupertino_main_page.dart:287-300 | lib/themes/cupertino/pages/cupertino_main_page.dart:302-315 — 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.
Duplicated block (52 lines × 2) lib/pages/play_video_page.dart:330— lib/pages/play_video_page.dart:330-381 | lib/themes/nipaplay/widgets/video_player_ui.dart:889-940 — 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 (52 lines × 2) lib/player_abstraction/media_kit_player_adapter.dart:3626— lib/player_abstraction/media_kit_player_adapter.dart:3626-3677 | lib/player_abstraction/media_kit_player_adapter.dart:3775-3826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/media_kit_player_adapter.dart:3626` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (52 lines × 2) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1249— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1249-1300 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1543-1594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1249` 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 (45 lines × 2) lib/services/dandanplay_service_io.dart:1935— lib/services/dandanplay_service_io.dart:1935-1979 | lib/services/dandanplay_service_io.dart:2412-2456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_io.dart:1935` 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 (45 lines × 2) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:137— lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:137-181 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1122-1166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (45 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:6087— lib/themes/nipaplay/widgets/library_management_tab.dart:6087-6131 | lib/themes/nipaplay/widgets/library_management_tab.dart:6321-6365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:6087` 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 (44 lines × 2) lib/services/dandanplay_service_io.dart:556— lib/services/dandanplay_service_io.dart:556-599 | lib/services/dandanplay_service_stub.dart:448-491 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:556` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (44 lines × 2) lib/services/smb_proxy_service.dart:64— lib/services/smb_proxy_service.dart:64-107 | lib/services/webdav_proxy_service.dart:64-107 — before extracting anything, compare `lib/services/smb_proxy_service.dart` and `lib/services/webdav_proxy_service.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/smb_proxy_service.dart:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (44 lines × 2) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:635— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:635-678 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:391-434 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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 (37 lines × 2) lib/services/dandanplay_service_io.dart:1423— lib/services/dandanplay_service_io.dart:1423-1459 | lib/services/dandanplay_service_stub.dart:2359-2395 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (37 lines × 2) lib/services/emby_dandanplay_matcher.dart:102— lib/services/emby_dandanplay_matcher.dart:102-138 | lib/services/jellyfin_dandanplay_matcher.dart:103-139 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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 (37 lines × 2) lib/services/dandanplay_service_io.dart:1784— lib/services/dandanplay_service_io.dart:1784-1820 | lib/services/dandanplay_service_stub.dart:2532-2568 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1784` it does not close everything it opens, so those 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 (34 lines × 2) lib/services/dandanplay_service_io.dart:916— lib/services/dandanplay_service_io.dart:916-949 | lib/services/dandanplay_service_stub.dart:982-1015 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:916` it does not close everything it opens, so those exact lines 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 lines × 2) lib/themes/nipaplay/widgets/media_capture_dialog.dart:703— lib/themes/nipaplay/widgets/media_capture_dialog.dart:703-736 | lib/themes/nipaplay/widgets/media_capture_dialog.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/themes/nipaplay/widgets/media_capture_dialog.dart:703` it does not close everything it opens, so those 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 (34 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:1028— lib/danmaku_next/nipaplay_next_engine.dart:1028-1061 | lib/danmaku_next/nipaplay_next_old_engine.dart:871-904 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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/danmaku_next/nipaplay_next_engine.dart:1028` it does not close everything it opens, so those exact lines 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/services/emby_dandanplay_matcher.dart:1141— lib/services/emby_dandanplay_matcher.dart:1141-1172 | lib/services/jellyfin_dandanplay_matcher.dart:1215-1246 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.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.
Duplicated block (32 lines × 2) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1209— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1209-1240 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1504-1535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1209` it begins part-way through the construct above it, so those exact lines 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/widgets/danmaku_container.dart:642— lib/widgets/danmaku_container.dart:642-673 | lib/widgets/danmaku_container.dart:757-788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/danmaku_container.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.
Duplicated block (30 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:833— lib/danmaku_next/nipaplay_next_engine.dart:833-862 | lib/danmaku_next/nipaplay_next_old_engine.dart:676-705 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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/services/dandanplay_service_io.dart:791— lib/services/dandanplay_service_io.dart:791-820 | lib/services/dandanplay_service_stub.dart:706-735 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:791` 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 (30 lines × 2) lib/themes/nipaplay/widgets/playlist_menu.dart:770— lib/themes/nipaplay/widgets/playlist_menu.dart:770-799 | lib/themes/nipaplay/widgets/playlist_menu.dart:872-901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/playlist_menu.dart:770` it begins part-way through the construct above it, so those exact lines 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–30 lines × 2) lib/services/dandanplay_service_io.dart:760— lib/services/dandanplay_service_io.dart:760-789 | lib/services/dandanplay_service_stub.dart:676-704 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:760` it begins part-way through the construct above it, so those exact lines 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–30 lines × 2) lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:447— lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:447-475 | lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:518-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:447` 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–30 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:4531— lib/themes/nipaplay/widgets/library_management_tab.dart:4531-4560 | lib/themes/nipaplay/widgets/library_management_tab.dart:4618-4646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:4531` it begins part-way through the construct above it, so those exact lines 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/providers/shared_remote_library_provider.dart:700— lib/providers/shared_remote_library_provider.dart:700-720 | lib/services/webdav_service.dart:1800-1820 | lib/utils/remote_media_fetcher.dart:434-454 — before extracting anything, compare `lib/providers/shared_remote_library_provider.dart` and `lib/utils/remote_media_fetcher.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/providers/shared_remote_library_provider.dart:700` it does not close everything it opens, so those exact lines 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/services/dandanplay_service_io.dart:2016— lib/services/dandanplay_service_io.dart:2016-2036 | lib/services/dandanplay_service_io.dart:2487-2507 | lib/services/dandanplay_service_io.dart:2682-2702 — 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/dandanplay_service_io.dart:2016` 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 × 3) lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:387— lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:387-407 | lib/themes/nipaplay/widgets/network_media_library_view.dart:986-1006 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1095-1115 — before extracting anything, compare `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` and `lib/themes/nipaplay/widgets/network_media_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18–21 lines × 2) lib/pages/torrent_download_page.dart:2028— lib/pages/torrent_download_page.dart:2028-2045 | lib/pages/torrent_download_page.dart:2227-2247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/torrent_download_page.dart:2028` it begins part-way through the construct above it, so those 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–21 lines × 2) lib/services/remote_control_client_service.dart:238— lib/services/remote_control_client_service.dart:238-255 | lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:285-305 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/remote_control_client_service.dart:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–21 lines × 2) lib/themes/nipaplay/widgets/network_media_library_view.dart:1232— lib/themes/nipaplay/widgets/network_media_library_view.dart:1232-1249 | lib/themes/nipaplay/widgets/network_media_library_view.dart:1376-1396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) lib/providers/shared_remote_library_provider.dart:1736— lib/providers/shared_remote_library_provider.dart:1736-1754 | lib/providers/shared_remote_library_provider.dart:1818-1837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1736` it does not close everything it opens, so those 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–20 lines × 2) lib/services/local_media_management_api.dart:1258— lib/services/local_media_management_api.dart:1258-1277 | lib/services/local_media_share_service.dart:891-909 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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 (19–20 lines × 2) lib/themes/cupertino/widgets/cupertino_player_menu.dart:175— lib/themes/cupertino/widgets/cupertino_player_menu.dart:175-194 | lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:759-777 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18–20 lines × 2) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:313— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:313-332 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:489-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/backup_restore_page.dart:313` it begins part-way through the construct above it, so those exact lines 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–20 lines × 2) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:383— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:383-402 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:535-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.
Duplicated block (18–20 lines × 2) lib/themes/nipaplay/widgets/send_danmaku_button.dart:54— lib/themes/nipaplay/widgets/send_danmaku_button.dart:54-73 | lib/themes/nipaplay/widgets/skip_button.dart:53-70 — before extracting anything, compare `lib/themes/nipaplay/widgets/send_danmaku_button.dart` and `lib/themes/nipaplay/widgets/skip_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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/themes/nipaplay/widgets/send_danmaku_button.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 (19 lines × 3) lib/services/emby_service.dart:1313— lib/services/emby_service.dart:1313-1331 | lib/services/jellyfin_service.dart:1188-1206 | lib/services/media_server_playback_client.dart:16-34 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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 (19 lines × 3) lib/services/local_media_management_api.dart:1221— lib/services/local_media_management_api.dart:1221-1239 | lib/services/local_media_share_service.dart:364-382 | lib/services/smb_proxy_service.dart:389-407 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_management_api.dart:1221` it does not close everything it opens, so those 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 × 3) lib/services/local_media_share_api.dart:159— lib/services/local_media_share_api.dart:159-177 | lib/services/local_media_share_api.dart:225-243 | lib/services/local_media_share_api.dart:290-308 — 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/local_media_share_api.dart:159` 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 × 4) lib/services/dandanplay_service_io.dart:843— lib/services/dandanplay_service_io.dart:843-859 | lib/services/dandanplay_service_stub.dart:786-802 | lib/services/dandanplay_service_stub.dart:1955-1971 | lib/services/dandanplay_service_stub.dart:2692-2708 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:843` it begins part-way through the construct above it, so those 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/services/dandanplay_service_stub.dart:1973` calls `_clearBangumiDetailsCache` and `lib/services/dandanplay_service_stub.dart:2709` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 4) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:190— lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:190-206 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:218-234 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1715-1731 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1742-1758 — 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/themes/nipaplay/widgets/custom_media_info_dialog.dart:190` 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 × 4) lib/themes/nipaplay/widgets/playback_rate_menu.dart:123— lib/themes/nipaplay/widgets/playback_rate_menu.dart:123-139 | lib/themes/nipaplay/widgets/seek_step_menu.dart:138-154 | lib/themes/nipaplay/widgets/seek_step_menu.dart:340-356 | lib/themes/nipaplay/widgets/seek_step_menu.dart:429-445 — before extracting anything, compare `lib/themes/nipaplay/widgets/playback_rate_menu.dart` and `lib/themes/nipaplay/widgets/seek_step_menu.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 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/themes/nipaplay/widgets/playback_rate_menu.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.
Duplicated block (17 lines × 3) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:267— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:267-283 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:239-255 | lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:697-713 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1409— lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1409-1425 | lib/themes/nipaplay/widgets/nipaplay_window.dart:365-381 | lib/themes/nipaplay/widgets/nipaplay_window.dart:497-513 — 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/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1409` it begins part-way through the construct above it, so those exact lines 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 × 3) lib/themes/nipaplay/widgets/seek_step_menu.dart:156— lib/themes/nipaplay/widgets/seek_step_menu.dart:156-172 | lib/themes/nipaplay/widgets/seek_step_menu.dart:358-374 | lib/themes/nipaplay/widgets/seek_step_menu.dart:447-463 — 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/themes/nipaplay/widgets/seek_step_menu.dart:156` 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/services/dandanplay_service_io.dart:1917— lib/services/dandanplay_service_io.dart:1917-1933 | lib/services/dandanplay_service_stub.dart:1391-1406 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1917` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:848— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:848-863 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1121-1137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/pages/settings/backup_restore_page.dart:848` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) lib/themes/nipaplay/widgets/modern_video_controls.dart:485— lib/themes/nipaplay/widgets/modern_video_controls.dart:485-501 | lib/themes/nipaplay/widgets/video_player_ui.dart:660-675 — 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/themes/nipaplay/widgets/modern_video_controls.dart:485` 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 × 3) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:846— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:846-860 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1119-1133 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1382-1396 — 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/themes/nipaplay/pages/settings/backup_restore_page.dart:846` it does not close everything it opens, so those 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/themes/nipaplay/pages/settings/backup_restore_page.dart:844` calls `SizedBox` and `lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1118` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 3) lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:97— lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:97-111 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1056-1070 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:1038-1052 — before extracting anything, compare `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 96 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/themes/nipaplay/widgets/danmaku_offset_menu.dart:97` it does not close everything it opens, so those exact lines 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/widgets/context_menu/src/context_menu_styles.dart:61— lib/widgets/context_menu/src/context_menu_styles.dart:61-75 | lib/widgets/context_menu/src/context_menu_styles.dart:101-115 | lib/widgets/context_menu/src/context_menu_styles.dart:146-160 — 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/context_menu/src/context_menu_styles.dart:61` it does not close everything it opens, so those 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–14 lines × 2) lib/pages/anime_detail_page.dart:1423— lib/pages/anime_detail_page.dart:1423-1435 | lib/pages/media_server_detail_page.dart:1623-1636 — 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/pages/anime_detail_page.dart:1423` it does not close everything it opens, so those 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/services/web_api_service.dart:339— lib/services/web_api_service.dart:339-352 | lib/services/web_api_service.dart:426-438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/web_api_service.dart:339` 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 (13–14 lines × 2) lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:132— lib/themes/nipaplay/widgets/danmaku_offset_menu.dart:132-145 | lib/themes/nipaplay/widgets/playback_rate_menu.dart:115-127 — 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/themes/nipaplay/widgets/danmaku_offset_menu.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.
Duplicated block (11–13 lines × 2) lib/services/dandanplay_service_stub.dart:122— lib/services/dandanplay_service_stub.dart:122-134 | lib/services/web_remote_access_service.dart:116-126 — 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 (11–13 lines × 2) lib/services/emby_dandanplay_matcher.dart:935— lib/services/emby_dandanplay_matcher.dart:935-945 | lib/services/jellyfin_dandanplay_matcher.dart:1010-1022 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:935` 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–13 lines × 2) lib/settings/pages/remote_media_library_settings_content.dart:1079— lib/settings/pages/remote_media_library_settings_content.dart:1079-1091 | lib/settings/pages/remote_media_library_settings_content.dart:1110-1120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/remote_media_library_settings_content.dart:1079` it begins part-way through the construct above it, so those exact lines 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/services/dandanplay_service_stub.dart:852— lib/services/dandanplay_service_stub.dart:852-862 | lib/services/dandanplay_service_stub.dart:947-958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/dandanplay_service_stub.dart:852` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/webdav_connection_dialog.dart:385— lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:385-395 | lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:454-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:272— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:272-282 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:523-534 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:272` it does not close everything it opens, so those exact lines 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–11 lines × 2) lib/services/web_api_service.dart:638— lib/services/web_api_service.dart:638-648 | lib/services/web_api_service.dart:707-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/web_api_service.dart:638` it begins part-way through the construct above it, so those exact lines 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–11 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:252— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:252-262 | lib/themes/nipaplay/widgets/audio_tracks_menu.dart:118-127 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart` and `lib/themes/nipaplay/widgets/audio_tracks_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:252` it begins part-way through the construct above it, so those 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) rust/src/next2_engine/engine/rendering.rs:1057— rust/src/next2_engine/engine/rendering.rs:1057-1066 | rust/src/next2_engine/engine/rendering.rs:1072-1082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/src/next2_engine/engine/rendering.rs:1072` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 5) lib/services/emby_service.dart:1049— lib/services/emby_service.dart:1049-1057 | lib/services/jellyfin_service.dart:841-849 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:432-440 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:467-475 | lib/themes/nipaplay/widgets/playlist_menu.dart:643-651 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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 (9 lines × 5) lib/services/episode_navigation_service.dart:1086— lib/services/episode_navigation_service.dart:1086-1094 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:146-154 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:177-185 | lib/themes/nipaplay/widgets/playlist_menu.dart:225-233 | lib/themes/nipaplay/widgets/playlist_menu.dart:266-274 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart` and `lib/themes/nipaplay/widgets/playlist_menu.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/themes/nipaplay/widgets/playlist_menu.dart:265` calls `replaceAll` and `lib/themes/nipaplay/widgets/playlist_menu.dart:224` 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 × 5) lib/themes/nipaplay/widgets/floating_action_glass_button.dart:59— lib/themes/nipaplay/widgets/floating_action_glass_button.dart:59-67 | lib/themes/nipaplay/widgets/hover_scale_text_button.dart:78-86 | lib/themes/nipaplay/widgets/search_bar_action_button.dart:58-66 | lib/themes/nipaplay/widgets/shadow_action_button.dart:64-72 | lib/themes/nipaplay/widgets/tvos_remote_text_input_scope.dart:143-151 — before extracting anything, compare `lib/themes/nipaplay/widgets/hover_scale_text_button.dart` and `lib/themes/nipaplay/widgets/search_bar_action_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/floating_action_glass_button.dart:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) lib/services/dandanplay_service_io.dart:2660— lib/services/dandanplay_service_io.dart:2660-2668 | lib/services/dandanplay_service_stub.dart:1943-1951 | lib/services/dandanplay_service_stub.dart:2073-2081 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2660` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) lib/services/dandanplay_service_stub.dart:1390— lib/services/dandanplay_service_stub.dart:1390-1398 | lib/services/dandanplay_service_stub.dart:1774-1782 | lib/services/dandanplay_service_stub.dart:1866-1874 — 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/dandanplay_service_stub.dart:1390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) lib/themes/nipaplay/widgets/blur_dropdown.dart:389— lib/themes/nipaplay/widgets/blur_dropdown.dart:389-397 | lib/themes/nipaplay/widgets/blur_dropdown.dart:423-431 | lib/themes/nipaplay/widgets/large_screen_editable_slider.dart:77-85 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/themes/nipaplay/widgets/blur_dropdown.dart:422` calls `_handleMenuKeyEvent` and `lib/themes/nipaplay/widgets/blur_dropdown.dart:388` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) lib/providers/dandanplay_remote_provider.dart:61— lib/providers/dandanplay_remote_provider.dart:61-68 | lib/providers/emby_provider.dart:155-162 | lib/providers/jellyfin_provider.dart:188-195 — before extracting anything, compare `lib/providers/emby_provider.dart` and `lib/providers/jellyfin_provider.dart` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 171 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/providers/dandanplay_remote_provider.dart:61` it does not close everything it opens, so those 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/services/emby_service.dart:948— lib/services/emby_service.dart:948-955 | lib/services/emby_service.dart:987-994 | lib/services/emby_service.dart:1023-1030 — 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/emby_service.dart:948` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) lib/services/smb_proxy_service.dart:370— lib/services/smb_proxy_service.dart:370-377 | lib/services/smb_service.dart:697-705 | lib/themes/nipaplay/widgets/playlist_menu.dart:262-269 — 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/services/smb_proxy_service.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/themes/nipaplay/widgets/playlist_menu.dart:270` calls `endsWith`, `substring` and `lib/services/smb_proxy_service.dart:378` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 2) lib/services/remote_subtitle_service.dart:1617— lib/services/remote_subtitle_service.dart:1617-1623 | lib/services/webdav_service.dart:786-793 — 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–8 lines × 2) lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:61— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:61-68 | lib/themes/nipaplay/widgets/smb_connection_dialog.dart:107-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:48— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:48-54 | lib/themes/nipaplay/widgets/audio_tracks_menu.dart:178-185 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart` and `lib/themes/nipaplay/widgets/audio_tracks_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:48` it begins part-way through the construct above it, so those exact lines 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 × 4) lib/providers/shared_remote_library_provider.dart:713— lib/providers/shared_remote_library_provider.dart:713-718 | lib/services/certificate_trust_service.dart:145-150 | lib/services/webdav_service.dart:1813-1818 | lib/utils/remote_media_fetcher.dart:447-452 — before extracting anything, compare `lib/providers/shared_remote_library_provider.dart` and `lib/utils/remote_media_fetcher.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (6 lines × 4) lib/services/remote_subtitle_service.dart:1005— lib/services/remote_subtitle_service.dart:1005-1010 | lib/services/remote_subtitle_service.dart:1120-1125 | lib/services/remote_subtitle_service.dart:1240-1245 | lib/services/remote_subtitle_service.dart:1358-1363 — 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/services/remote_subtitle_service.dart:1005` it does not close everything it opens, so those 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/services/remote_subtitle_service.dart:1127` calls `isVobSubPairCompleteInNames` and `lib/services/remote_subtitle_service.dart:1248` 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/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:31— lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:31-36 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:185-190 | lib/themes/nipaplay/widgets/playback_rate_menu.dart:39-44 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:221-226 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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.
_AnimeMatchDialogState.build (cyclomatic 27) lib/services/emby_dandanplay_matcher.dart:1357— _AnimeMatchDialogState.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.
_AnimeMatchDialogState.build (cyclomatic 27) lib/services/jellyfin_dandanplay_matcher.dart:1405— _AnimeMatchDialogState.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.
RustLibNipaplayPlugin.getTextureInfo (cyclomatic 23) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:239— RustLibNipaplayPlugin.getTextureInfo 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.
RustLibNipaplayPlugin.getTextureInfo (cyclomatic 23) rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:253— RustLibNipaplayPlugin.getTextureInfo 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.
DandanplayService._tryMatchByFileNameFirstResult (cyclomatic 19) lib/services/dandanplay_service_io.dart:1487— DandanplayService._tryMatchByFileNameFirstResult 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.
DandanplayService._tryMatchByFileNameFirstResult (cyclomatic 19) lib/services/dandanplay_service_stub.dart:2423— DandanplayService._tryMatchByFileNameFirstResult 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.
DandanplayService._tryExtractEpisodeNumberFromFileName (cyclomatic 18) lib/services/dandanplay_service_io.dart:1380— DandanplayService._tryExtractEpisodeNumberFromFileName 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.
DandanplayService._tryExtractEpisodeNumberFromFileName (cyclomatic 18) lib/services/dandanplay_service_stub.dart:2317— DandanplayService._tryExtractEpisodeNumberFromFileName 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.
_AnimeMatchDialogState._loadAnimeEpisodes (cyclomatic 16) lib/services/emby_dandanplay_matcher.dart:1141— _AnimeMatchDialogState._loadAnimeEpisodes 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.
_AnimeMatchDialogState._loadAnimeEpisodes (cyclomatic 16) lib/services/jellyfin_dandanplay_matcher.dart:1215— _AnimeMatchDialogState._loadAnimeEpisodes 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.
Next2Renderer::build_vertices (cognitive 59) rust/src/next2_engine/engine/renderer_draw.rs:459— Next2Renderer::build_vertices has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (46 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (3 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.
Next2Renderer::update_frame (cognitive 16) rust/src/next2_engine/engine/renderer_core.rs:448— Next2Renderer::update_frame has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_AnimeMatchDialogState.build (cognitive 47) lib/services/emby_dandanplay_matcher.dart:1357— _AnimeMatchDialogState.build has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 13 (30 pts), if/else 11 (15 pts), boolean chains 2 (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.
_AnimeMatchDialogState.build (cognitive 47) lib/services/jellyfin_dandanplay_matcher.dart:1405— _AnimeMatchDialogState.build has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 13 (30 pts), if/else 11 (15 pts), boolean chains 2 (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.
_AnimeMatchDialogState._loadAnimeEpisodes (cognitive 37) lib/services/emby_dandanplay_matcher.dart:1141— _AnimeMatchDialogState._loadAnimeEpisodes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 1 (3 pts), boolean chains 2, error handling 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.
_AnimeMatchDialogState._loadAnimeEpisodes (cognitive 37) lib/services/jellyfin_dandanplay_matcher.dart:1215— _AnimeMatchDialogState._loadAnimeEpisodes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 1 (3 pts), boolean chains 2, error handling 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.
DandanplayService._ensureVideoInfoTitles (cognitive 35) lib/services/dandanplay_service_io.dart:1866— DandanplayService._ensureVideoInfoTitles has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (30 pts), boolean chains 5 (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.
DandanplayService._ensureVideoInfoTitles (cognitive 35) lib/services/dandanplay_service_stub.dart:2256— DandanplayService._ensureVideoInfoTitles has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (30 pts), boolean chains 5 (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.
DandanplayService._tryMatchByFileNameFirstResult (cognitive 33) lib/services/dandanplay_service_io.dart:1487— DandanplayService._tryMatchByFileNameFirstResult has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService._tryMatchByFileNameFirstResult (cognitive 33) lib/services/dandanplay_service_stub.dart:2423— DandanplayService._tryMatchByFileNameFirstResult has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustLibNipaplayPlugin.getTextureInfo (cognitive 24) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:239— RustLibNipaplayPlugin.getTextureInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 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.
RustLibNipaplayPlugin.getTextureInfo (cognitive 24) rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:253— RustLibNipaplayPlugin.getTextureInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 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.
DandanplayService._tryExtractEpisodeNumberFromFileName (cognitive 23) lib/services/dandanplay_service_io.dart:1380— DandanplayService._tryExtractEpisodeNumberFromFileName has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 9, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService._tryExtractEpisodeNumberFromFileName (cognitive 23) lib/services/dandanplay_service_stub.dart:2317— DandanplayService._tryExtractEpisodeNumberFromFileName has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 9, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (139 corresponding lines) · ×2
Edited copy of a member (139 corresponding lines) lib/player_abstraction/media_kit_player_adapter.dart:3545— lib/player_abstraction/media_kit_player_adapter.dart:3545-3688 | lib/player_abstraction/media_kit_player_adapter.dart:3691-3829 — These two members are one piece of code written twice and then edited apart: 139 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (139 corresponding lines) lib/themes/nipaplay/widgets/emby_library_card.dart:20— lib/themes/nipaplay/widgets/emby_library_card.dart:20-159 | lib/themes/nipaplay/widgets/jellyfin_library_card.dart:18-156 — These two members are one piece of code written twice and then edited apart: 139 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×2
Edited copy of a member (59 corresponding lines) lib/services/remote_control_client_service.dart:209— lib/services/remote_control_client_service.dart:209-267 | lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:245-330 — 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.
Edited copy of a member (59 corresponding lines) lib/services/remote_subtitle_service.dart:1392— lib/services/remote_subtitle_service.dart:1392-1453 | lib/services/remote_subtitle_service.dart:1455-1513 — 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 (62 corresponding lines) · ×2
Edited copy of a member (62 corresponding lines) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:370— lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:370-440 | lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:442-503 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (62 corresponding lines) lib/settings/pages/network_settings_content.dart:277— lib/settings/pages/network_settings_content.dart:277-338 | lib/settings/pages/network_settings_content.dart:340-408 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×2
Edited copy of a member (52 corresponding lines) lib/services/smb_proxy_service.dart:51— lib/services/smb_proxy_service.dart:51-107 | lib/services/webdav_proxy_service.dart:56-107 — 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.
Edited copy of a member (52 corresponding lines) lib/settings/pages/developer_options_settings_content.dart:341— lib/settings/pages/developer_options_settings_content.dart:341-409 | lib/settings/pages/remote_media_library_settings_content.dart:1457-1508 — 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) · ×2
Edited copy of a member (53 corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:198— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:198-250 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:312-366 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (53 corresponding lines) lib/utils/watch_history_auto_match_helper.dart:258— lib/utils/watch_history_auto_match_helper.dart:258-311 | lib/utils/watch_history_auto_match_helper.dart:313-365 — 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, 43+ corresponding lines) · ×2
Edited copies of one member (3 members, 43+ corresponding lines) lib/themes/nipaplay/widgets/lock_controls_button.dart:54— lib/themes/nipaplay/widgets/lock_controls_button.dart:54-97 | lib/themes/nipaplay/widgets/send_danmaku_button.dart:54-98 | lib/themes/nipaplay/widgets/skip_button.dart:53-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 43+ corresponding lines) lib/models/watch_history_model.dart:735— lib/models/watch_history_model.dart:735-777 | lib/models/watch_history_model.dart:940-982 | lib/models/watch_history_model.dart:1061-1111 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×2
Edited copy of a member (38 corresponding lines) lib/services/dandanplay_service_io.dart:439— lib/services/dandanplay_service_io.dart:439-478 | lib/services/dandanplay_service_stub.dart:335-372 — 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/local_media_management_api.dart:1178— lib/services/local_media_management_api.dart:1178-1218 | lib/services/local_media_share_service.dart:1096-1133 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) lib/models/external_player_session/mpv_session.dart:428— lib/models/external_player_session/mpv_session.dart:428-469 | lib/models/external_player_session/mpv_session.dart:471-513 — 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/services/file_picker_service.dart:458— lib/services/file_picker_service.dart:458-499 | lib/services/file_picker_service.dart:801-843 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) lib/providers/shared_remote_library_provider.dart:563— lib/providers/shared_remote_library_provider.dart:563-585 | lib/providers/shared_remote_library_provider.dart:587-618 | lib/providers/shared_remote_library_provider.dart:620-645 — 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/services/network_media_settings_api.dart:49— lib/services/network_media_settings_api.dart:49-77 | lib/services/network_media_settings_api.dart:95-122 | lib/services/network_media_settings_api.dart:139-161 — 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 (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:468— lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:468-501 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:483-507 — 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/pages/shortcuts_settings_page.dart:135— lib/pages/shortcuts_settings_page.dart:135-163 | lib/utils/shortcut_tooltip_manager.dart:66-90 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) lib/services/episode_navigation_service.dart:1103— lib/services/episode_navigation_service.dart:1103-1115 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:194-207 | lib/themes/nipaplay/widgets/playlist_menu.dart:285-311 — 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/themes/nipaplay/widgets/large_screen_home_page.dart:20— lib/themes/nipaplay/widgets/large_screen_home_page.dart:20-32 | lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:485-500 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:466-481 — 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, 16+ corresponding lines) · ×2
Edited copies of one member (3 members, 16+ corresponding lines) lib/services/local_media_share_api.dart:44— lib/services/local_media_share_api.dart:44-63 | lib/services/web_api_service.dart:131-146 | lib/services/web_api_service.dart:611-628 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) rust/src/api/performance.rs:83— rust/src/api/performance.rs:83-98 | rust/src/api/performance.rs:100-115 | rust/src/api/performance.rs:117-132 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×2
Edited copies of one member (3 members, 10+ corresponding lines) lib/services/dandanplay_remote_service.dart:357— lib/services/dandanplay_remote_service.dart:357-366 | lib/services/media_server_service_base.dart:201-211 | lib/utils/network_settings.dart:405-414 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) lib/services/emby_transcode_manager.dart:36— lib/services/emby_transcode_manager.dart:36-47 | lib/services/emby_transcode_manager.dart:90-99 | lib/services/emby_transcode_manager.dart:101-113 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×2
Edited copies of one member (3 members, 4+ corresponding lines) lib/services/player_remote_control_bridge.dart:1341— lib/services/player_remote_control_bridge.dart:1341-1344 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:58-61 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:65-68 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:197— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:197-200 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:233-236 | lib/widgets/external_subtitle_overlay.dart:849-852 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (41 lines × 2) lib/services/dandanplay_service_io.dart:2074— lib/services/dandanplay_service_io.dart:2074-2114 | lib/services/dandanplay_service_stub.dart:1564-1604 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/utils/anime4k_shader_manager.dart:98— lib/utils/anime4k_shader_manager.dart:98-138 | lib/utils/crt_shader_manager.dart:66-106 — 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 (31 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:1085— lib/danmaku_next/nipaplay_next_engine.dart:1085-1115 | lib/danmaku_next/nipaplay_next_old_engine.dart:919-949 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (31 lines × 2) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:268— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:268-298 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:240-270 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (25 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:138— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:138-162 | lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:204-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.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. 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 `track` to `PlayerAudioStreamInfo` in one and `_ServerAudioTrack` 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 (25 lines × 2) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1019— lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1019-1043 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:1001-1025 — before extracting anything, compare `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 96 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/themes/nipaplay/widgets/danmaku_settings_menu.dart:1019` 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 (22–23 lines × 2) lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:152— lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:152-173 | lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:240-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/cupertino_library_management_overview.dart:152` 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 (22–23 lines × 2) lib/themes/nipaplay/widgets/history_all_modal.dart:154— lib/themes/nipaplay/widgets/history_all_modal.dart:154-176 | lib/themes/nipaplay/widgets/history_all_modal.dart:182-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/history_all_modal.dart:154` 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.
Duplicated block (21–22 lines × 2) lib/settings/pages/developer_options_settings_content.dart:604— lib/settings/pages/developer_options_settings_content.dart:604-625 | lib/settings/pages/developer_options_settings_content.dart:752-772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/developer_options_settings_content.dart:604` it begins part-way through the construct above it, so those exact lines 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/themes/nipaplay/widgets/library_management_tab.dart:5427— lib/themes/nipaplay/widgets/library_management_tab.dart:5427-5448 | lib/themes/nipaplay/widgets/library_management_tab.dart:5632-5652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:5427` it begins part-way through the construct above it, so those 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 × 4) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:388— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:388-406 | lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:409-427 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:362-380 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:383-401 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart` and `lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 4) lib/themes/nipaplay/widgets/playlist_menu.dart:370— lib/themes/nipaplay/widgets/playlist_menu.dart:370-388 | lib/themes/nipaplay/widgets/playlist_menu.dart:439-457 | lib/themes/nipaplay/widgets/playlist_menu.dart:489-507 | lib/themes/nipaplay/widgets/playlist_menu.dart:541-559 — 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/themes/nipaplay/widgets/playlist_menu.dart:370` it begins part-way through the construct above it, so those exact lines 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 × 3) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:338— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:338-355 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:310-327 | lib/themes/nipaplay/widgets/rating_dialog.dart:204-222 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:338` it does not close everything it opens, so those exact lines 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 × 3) lib/themes/nipaplay/widgets/lock_controls_button.dart:29— lib/themes/nipaplay/widgets/lock_controls_button.dart:29-46 | lib/themes/nipaplay/widgets/send_danmaku_button.dart:28-46 | lib/themes/nipaplay/widgets/skip_button.dart:28-45 — before extracting anything, compare `lib/themes/nipaplay/widgets/send_danmaku_button.dart` and `lib/themes/nipaplay/widgets/skip_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 (18–19 lines × 2) lib/models/watch_history_database.dart:232— lib/models/watch_history_database.dart:232-250 | lib/models/watch_history_database.dart:443-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/watch_history_database.dart:232` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/tag_search_widget.dart:667— lib/themes/nipaplay/widgets/tag_search_widget.dart:667-685 | lib/themes/nipaplay/widgets/tag_search_widget.dart:1164-1181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/tag_search_widget.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 (17–18 lines × 3) lib/services/local_media_management_api.dart:897— lib/services/local_media_management_api.dart:897-914 | lib/services/local_media_share_service.dart:529-546 | lib/services/local_media_share_service.dart:648-664 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_management_api.dart:897` it begins part-way through the construct above it, so those exact lines 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 × 3) lib/themes/nipaplay/widgets/library_management_tab.dart:3785— lib/themes/nipaplay/widgets/library_management_tab.dart:3785-3801 | lib/themes/nipaplay/widgets/library_management_tab.dart:4196-4212 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:944-961 — before extracting anything, compare `lib/themes/nipaplay/widgets/library_management_tab.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 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/themes/nipaplay/widgets/library_management_tab.dart:3785` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 5) lib/services/dandanplay_service_io.dart:2680— lib/services/dandanplay_service_io.dart:2680-2694 | lib/services/dandanplay_service_stub.dart:1162-1176 | lib/services/dandanplay_service_stub.dart:1508-1522 | lib/services/dandanplay_service_stub.dart:1884-1898 | lib/services/dandanplay_service_stub.dart:2091-2105 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/dandanplay_service_io.dart:2698` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:1902` 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 × 5) lib/settings/pages/appearance_settings_content.dart:922— lib/settings/pages/appearance_settings_content.dart:922-936 | lib/settings/pages/developer_options_settings_content.dart:878-892 | lib/settings/pages/general_settings_content.dart:727-741 | lib/settings/pages/network_settings_content.dart:932-946 | lib/settings/pages/plugin_settings_content.dart:1276-1290 — 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 5 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 (15 lines × 4) lib/pages/media_server_detail_page.dart:1360— lib/pages/media_server_detail_page.dart:1360-1375 | lib/pages/new_series_page.dart:530-544 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:244-258 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:760-774 — before extracting anything, compare `lib/pages/new_series_page.dart` and `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/pages/media_server_detail_page.dart:1360` it begins part-way through the construct above it, so those exact lines 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 × 4) lib/themes/nipaplay/widgets/floating_action_glass_button.dart:54— lib/themes/nipaplay/widgets/floating_action_glass_button.dart:54-68 | lib/themes/nipaplay/widgets/hover_scale_text_button.dart:73-87 | lib/themes/nipaplay/widgets/search_bar_action_button.dart:53-67 | lib/themes/nipaplay/widgets/shadow_action_button.dart:59-73 — before extracting anything, compare `lib/themes/nipaplay/widgets/hover_scale_text_button.dart` and `lib/themes/nipaplay/widgets/search_bar_action_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/floating_action_glass_button.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 (14–15 lines × 3) lib/services/local_media_management_api.dart:973— lib/services/local_media_management_api.dart:973-986 | lib/services/local_media_share_service.dart:582-596 | lib/services/local_media_share_service.dart:875-889 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_share_service.dart:582` 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.
Duplicated block (14–15 lines × 3) lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:987— lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:987-1001 | lib/themes/nipaplay/widgets/library_management_tab.dart:3816-3830 | lib/themes/nipaplay/widgets/library_management_tab.dart:4229-4242 — 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/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:987` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/library_management_tab.dart:4227` calls `SizedBox`, `_buildLargeScreenConnectionBadge` and `lib/themes/nipaplay/widgets/library_management_tab.dart:3816` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) lib/services/dandanplay_service_stub.dart:1860— lib/services/dandanplay_service_stub.dart:1860-1872 | lib/services/dandanplay_service_stub.dart:1937-1949 | lib/services/dandanplay_service_stub.dart:2067-2079 — 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/dandanplay_service_stub.dart:1860` it begins part-way through the construct above it, so those exact lines 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/services/file_picker_service.dart:127— lib/services/file_picker_service.dart:127-139 | lib/services/file_picker_service.dart:157-169 | lib/services/file_picker_service.dart:178-190 — 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–12 lines × 4) lib/providers/shared_remote_library_provider.dart:1063— lib/providers/shared_remote_library_provider.dart:1063-1074 | lib/providers/shared_remote_library_provider.dart:1382-1393 | lib/providers/shared_remote_library_provider.dart:1575-1586 | lib/providers/shared_remote_library_provider.dart:1635-1645 — 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/providers/shared_remote_library_provider.dart:1063` it does not close everything it opens, so those 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 × 4) lib/services/dandanplay_service_io.dart:1916— lib/services/dandanplay_service_io.dart:1916-1927 | lib/services/dandanplay_service_io.dart:2397-2407 | lib/services/dandanplay_service_stub.dart:1390-1400 | lib/services/dandanplay_service_stub.dart:1774-1784 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1916` it does not close everything it opens, so those 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/dandanplay_service_io.dart:2394` calls `getUserFavorites` and `lib/services/dandanplay_service_stub.dart:1388` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 4) lib/services/dandanplay_service_stub.dart:1474— lib/services/dandanplay_service_stub.dart:1474-1485 | lib/services/dandanplay_service_stub.dart:1857-1868 | lib/services/dandanplay_service_stub.dart:1934-1945 | lib/services/dandanplay_service_stub.dart:2064-2075 — 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/services/dandanplay_service_stub.dart:1474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) lib/settings/pages/developer_options_settings_content.dart:604— lib/settings/pages/developer_options_settings_content.dart:604-615 | lib/settings/pages/developer_options_settings_content.dart:674-685 | lib/settings/pages/developer_options_settings_content.dart:752-763 | lib/settings/pages/developer_options_settings_content.dart:833-844 — 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/settings/pages/developer_options_settings_content.dart:604` it begins part-way through the construct above it, so those exact lines 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–12 lines × 2) lib/services/local_media_share_api.dart:88— lib/services/local_media_share_api.dart:88-97 | lib/services/local_media_share_api.dart:106-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/local_media_share_api.dart:88` it does not close everything it opens, so those 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 (10–12 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:89— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:89-98 | lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:104-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 × 5) lib/providers/shared_remote_library_provider.dart:916— lib/providers/shared_remote_library_provider.dart:916-926 | lib/providers/shared_remote_library_provider.dart:1019-1029 | lib/providers/shared_remote_library_provider.dart:1768-1778 | lib/providers/shared_remote_library_provider.dart:1844-1854 | lib/providers/shared_remote_library_provider.dart:1917-1927 — 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/providers/shared_remote_library_provider.dart:916` it begins part-way through the construct above it, so those exact lines 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 × 5) lib/services/local_media_share_api.dart:87— lib/services/local_media_share_api.dart:87-97 | lib/services/local_media_share_api.dart:105-115 | lib/services/local_media_share_api.dart:127-137 | lib/services/local_media_share_api.dart:193-203 | lib/services/local_media_share_api.dart:258-268 — 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/local_media_share_api.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.
Duplicated block (11 lines × 4) lib/services/dandanplay_service_stub.dart:1040— lib/services/dandanplay_service_stub.dart:1040-1050 | lib/services/dandanplay_service_stub.dart:1454-1464 | lib/services/dandanplay_service_stub.dart:1836-1846 | lib/services/dandanplay_service_stub.dart:2046-2056 — 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/services/dandanplay_service_stub.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.
Duplicated block (11 lines × 4) lib/services/emby_dandanplay_matcher.dart:1367— lib/services/emby_dandanplay_matcher.dart:1367-1377 | lib/services/jellyfin_dandanplay_matcher.dart:1415-1425 | lib/themes/nipaplay/widgets/custom_slider.dart:85-95 | lib/themes/nipaplay/widgets/translation_button.dart:118-128 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1367` it does not close everything it opens, so those exact lines 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 × 6) lib/themes/nipaplay/widgets/library_management_tab.dart:3787— lib/themes/nipaplay/widgets/library_management_tab.dart:3787-3796 | lib/themes/nipaplay/widgets/library_management_tab.dart:4198-4207 | lib/themes/nipaplay/widgets/network_media_library_view.dart:719-728 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:527-536 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:569-578 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:946-955 — before extracting anything, compare `lib/themes/nipaplay/widgets/library_management_tab.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 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 × 6) lib/models/emby_model.dart:69— lib/models/emby_model.dart:69-78 | lib/models/emby_model.dart:178-187 | lib/models/emby_model.dart:394-403 | lib/models/jellyfin_model.dart:92-101 | lib/models/jellyfin_model.dart:204-213 | lib/models/jellyfin_model.dart:419-428 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 3) lib/player_abstraction/media_kit_player_adapter.dart:3730— lib/player_abstraction/media_kit_player_adapter.dart:3730-3738 | lib/player_abstraction/media_kit_player_adapter.dart:3745-3754 | lib/player_abstraction/media_kit_player_adapter.dart:3762-3771 — 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/player_abstraction/media_kit_player_adapter.dart:3745` it does not close everything it opens, so those 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–10 lines × 3) lib/themes/nipaplay/widgets/playlist_menu.dart:693— lib/themes/nipaplay/widgets/playlist_menu.dart:693-701 | lib/themes/nipaplay/widgets/playlist_menu.dart:754-763 | lib/themes/nipaplay/widgets/playlist_menu.dart:856-865 — 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/themes/nipaplay/widgets/playlist_menu.dart:693` it begins part-way through the construct above it, so those 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 × 4) lib/pages/new_series_page.dart:614— lib/pages/new_series_page.dart:614-621 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:387-394 | lib/themes/nipaplay/widgets/network_media_library_view.dart:986-993 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1095-1102 — before extracting anything, compare `lib/pages/new_series_page.dart` and `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/pages/new_series_page.dart:614` it does not close everything it opens, so those 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 × 4) lib/themes/nipaplay/widgets/library_management_tab.dart:2025— lib/themes/nipaplay/widgets/library_management_tab.dart:2025-2034 | lib/themes/nipaplay/widgets/library_management_tab.dart:2056-2065 | lib/themes/nipaplay/widgets/library_management_tab.dart:2088-2097 | lib/themes/nipaplay/widgets/library_management_tab.dart:4371-4378 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–8 lines × 3) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:369— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:369-376 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1564-1570 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1679-1685 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:369` 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–8 lines × 3) lib/services/remote_subtitle_service.dart:1615— lib/services/remote_subtitle_service.dart:1615-1621 | lib/services/webdav_service.dart:784-791 | lib/utils/media_source_utils.dart:120-126 — 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/services/remote_subtitle_service.dart:1615` it does not close everything it opens, so those 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.
IC1 · Incompleteness & stubs· Empty method body · ×2
Empty method body — does nothing with its inputs packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:195— `setMinimumSize` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:233— `setPictureInPictureMode` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
X25 · Inert configuration knob· Setting lookup falls back to a different setting than its key · ×2
Setting lookup falls back to a different setting than its key lib/services/jellyfin_dandanplay_matcher.dart:477— `JellyfinDandanplayMatcher` looks up `"episodeTitle"` and falls back to `name` when the caller supplies none — but line 202 of this same type looks up `"episodeTitle"` and falls back to `episodeTitle`, which is the member that key names. The two cannot both be right: every caller who configures `episodeTitle` and passes no `"episodeTitle"` override silently gets `name` instead, and nothing reports that the value was ignored. Fall back to `episodeTitle` here as line 202 does — or, if `name` genuinely is the intended source, look it up under its own key so the two sites stop disagreeing.
Setting lookup falls back to a different setting than its key lib/services/jellyfin_dandanplay_matcher.dart:483— `JellyfinDandanplayMatcher` looks up `"episodeTitle"` and falls back to `name` when the caller supplies none — but line 202 of this same type looks up `"episodeTitle"` and falls back to `episodeTitle`, which is the member that key names. The two cannot both be right: every caller who configures `episodeTitle` and passes no `"episodeTitle"` override silently gets `name` instead, and nothing reports that the value was ignored. Fall back to `episodeTitle` here as line 202 does — or, if `name` genuinely is the intended source, look it up under its own key so the two sites stop disagreeing.
Configuration option is read nowhere rust/src/api/incremental_sync.rs:65— `SyncPatch.created_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere rust/src/api/incremental_sync.rs:67— `SyncPatch.device_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
DanmakuAtlasPainter.paint (cyclomatic 147) lib/danmaku_next/danmaku_atlas_painter.dart:392— DanmakuAtlasPainter.paint has cyclomatic complexity 147 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HotkeyService._getKeyCodeFromString (cyclomatic 120) lib/utils/hotkey_service.dart:461— HotkeyService._getKeyCodeFromString has cyclomatic complexity 120 (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.
_ShortcutsSettingsPageState._keyToText (cyclomatic 90) lib/pages/shortcuts_settings_page.dart:166— _ShortcutsSettingsPageState._keyToText has cyclomatic complexity 90 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PluginService._handlePluginBridgeCall (cyclomatic 85) lib/plugins/plugin_service.dart:460— PluginService._handlePluginBridgeCall has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_PlayerSettingsContentState.build (cyclomatic 84) lib/settings/pages/player_settings_content.dart:291— _PlayerSettingsContentState.build has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_AnimeDetailPageState._buildEpisodesListView (cyclomatic 81) lib/pages/anime_detail_page.dart:1942— _AnimeDetailPageState._buildEpisodesListView has cyclomatic complexity 81 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_NipaplayLargeScreenScaffoldLayoutState._dispatchInputCommand (cyclomatic 81) lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:866— _NipaplayLargeScreenScaffoldLayoutState._dispatchInputCommand has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_PlayVideoPageState._buildMaterialControls (cyclomatic 72) lib/pages/play_video_page.dart:995— _PlayVideoPageState._buildMaterialControls has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_NipaplayLargeScreenScaffoldLayoutState._handleInputKeyEvent (cyclomatic 70) lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:1072— _NipaplayLargeScreenScaffoldLayoutState._handleInputKeyEvent has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JellyfinDandanplayMatcher._matchWithDandanPlay (cyclomatic 68) lib/services/jellyfin_dandanplay_matcher.dart:285— JellyfinDandanplayMatcher._matchWithDandanPlay has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SubtitleManager.autoDetectAndLoadSubtitle (cyclomatic 62) lib/utils/subtitle_manager.dart:1434— SubtitleManager.autoDetectAndLoadSubtitle 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.
WebDAVService._parseWebDAVResponseDart (cyclomatic 61) lib/services/webdav_service.dart:1494— WebDAVService._parseWebDAVResponseDart has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EmbyDandanplayMatcher._matchWithDandanPlay (cyclomatic 60) lib/services/emby_dandanplay_matcher.dart:297— EmbyDandanplayMatcher._matchWithDandanPlay has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_PlaylistMenuState._playEpisode (cyclomatic 55) lib/themes/nipaplay/widgets/playlist_menu.dart:680— _PlaylistMenuState._playEpisode has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayerRemoteControlBridge._setParameter (cyclomatic 54) lib/services/player_remote_control_bridge.dart:859— PlayerRemoteControlBridge._setParameter has cyclomatic complexity 54 (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.
AudioTracksMenu.build (cyclomatic 54) lib/themes/nipaplay/widgets/audio_tracks_menu.dart:156— AudioTracksMenu.build has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_DfmPlusOverlayState._tryUpdateTexture (cyclomatic 52) lib/danmaku_dfm/dfm_plus_overlay.dart:667— _DfmPlusOverlayState._tryUpdateTexture 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.
_DanmakuSettingsContentState.build (cyclomatic 52) lib/settings/pages/danmaku_settings_content.dart:773— _DanmakuSettingsContentState.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.
SettingsItem.build (cyclomatic 51) lib/themes/nipaplay/widgets/settings_item.dart:587— SettingsItem.build has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ErikaPlayerAdapter._handleEvent (cyclomatic 49) lib/player_abstraction/erika_player_adapter.dart:1702— ErikaPlayerAdapter._handleEvent 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.
AutoSyncService._applyOperationsLocally (cyclomatic 49) lib/services/auto_sync_service.dart:851— AutoSyncService._applyOperationsLocally 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.
EpisodeFileSelectionService.resolve (cyclomatic 49) lib/services/episode_file_selection_service.dart:76— EpisodeFileSelectionService.resolve 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.
_SharedRemoteLanScanDialogContentState.build (cyclomatic 49) lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:401— _SharedRemoteLanScanDialogContentState.build has cyclomatic complexity 49 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_PlaybackInfoMenuState._getAudioInfo (cyclomatic 47) lib/themes/nipaplay/widgets/playback_info_menu.dart:655— _PlaybackInfoMenuState._getAudioInfo has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_VideoPlayerUIState.build (cyclomatic 46) lib/themes/nipaplay/widgets/video_player_ui.dart:1151— _VideoPlayerUIState.build has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_MediaServerDetailPageState._buildEpisodesListForSelectedSeason (cyclomatic 44) lib/pages/media_server_detail_page.dart:2111— _MediaServerDetailPageState._buildEpisodesListForSelectedSeason has cyclomatic complexity 44 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_ModernVideoControlsState.build (cyclomatic 43) lib/themes/nipaplay/widgets/modern_video_controls.dart:660— _ModernVideoControlsState.build has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_DanmakuListMenuState.build (cyclomatic 42) lib/themes/nipaplay/widgets/danmaku_list_menu.dart:374— _DanmakuListMenuState.build 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.
GpuDanmakuTextRenderer.renderItem (cyclomatic 40) lib/danmaku_gpu/lib/gpu_danmaku_text_renderer.dart:111— GpuDanmakuTextRenderer.renderItem 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.
MediaKitPlayerAdapter._ensureDefaultTracksSelected (cyclomatic 40) lib/player_abstraction/media_kit_player_adapter.dart:1803— MediaKitPlayerAdapter._ensureDefaultTracksSelected 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.
VideoPlayerAdapter.snapshot (cyclomatic 39) lib/player_abstraction/video_player_adapter.dart:556— VideoPlayerAdapter.snapshot has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BangumiSyncService._syncAnimeToBangumi (cyclomatic 39) lib/services/bangumi_sync_service.dart:217— BangumiSyncService._syncAnimeToBangumi has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_DfmPlusOverlayState.didUpdateWidget (cyclomatic 38) lib/danmaku_dfm/dfm_plus_overlay.dart:247— _DfmPlusOverlayState.didUpdateWidget has cyclomatic complexity 38 (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.
ExternalPlayerService.play (cyclomatic 37) lib/services/external_player_service.dart:31— ExternalPlayerService.play has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_AdaptiveMediaDetailActionButtonState.build (cyclomatic 37) lib/themes/nipaplay/widgets/adaptive_media_detail_action.dart:54— _AdaptiveMediaDetailActionButtonState.build has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_BangumiCommentsWidgetState._loadComments (cyclomatic 37) lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:87— _BangumiCommentsWidgetState._loadComments has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_SubtitleTracksMenuState.build (cyclomatic 37) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:687— _SubtitleTracksMenuState.build has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScanService.startDirectoryScan (cyclomatic 36) lib/services/scan_service.dart:816— ScanService.startDirectoryScan 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.
_BangumiCommentsWidgetState.build (cyclomatic 36) lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:287— _BangumiCommentsWidgetState.build has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseSettingsMenu.build (cyclomatic 36) lib/themes/nipaplay/widgets/base_settings_menu.dart:87— BaseSettingsMenu.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.
_JellyfinQualityMenuState._applySelection (cyclomatic 36) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:194— _JellyfinQualityMenuState._applySelection 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.
_SubtitleListMenuState.build (cyclomatic 36) lib/themes/nipaplay/widgets/subtitle_list_menu.dart:580— _SubtitleListMenuState.build has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MsdfFontAtlas._buildSegments (cyclomatic 35) lib/danmaku_next/msdf_font_atlas.dart:383— MsdfFontAtlas._buildSegments 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.
_WebDAVBrowserPageState._playVideo (cyclomatic 35) lib/pages/webdav_browser_page.dart:240— _WebDAVBrowserPageState._playVideo 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.
_NipaplayWindowScaffoldState.build (cyclomatic 35) lib/themes/nipaplay/widgets/nipaplay_window.dart:248— _NipaplayWindowScaffoldState.build 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.
_SharedRemoteLibraryViewState.build (cyclomatic 35) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:148— _SharedRemoteLibraryViewState.build has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_VideoPlayerUIState._handleKeyEvent (cyclomatic 35) lib/themes/nipaplay/widgets/video_player_ui.dart:196— _VideoPlayerUIState._handleKeyEvent 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.
SubtitleManager.updateEmbeddedSubtitleTrack (cyclomatic 35) lib/utils/subtitle_manager.dart:2070— SubtitleManager.updateEmbeddedSubtitleTrack 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.
_DanmakuContainerState._getYPosition (cyclomatic 35) lib/widgets/danmaku_container.dart:430— _DanmakuContainerState._getYPosition 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.
BangumiAnime.fromDandanplayDetail (cyclomatic 34) lib/models/bangumi_model.dart:149— BangumiAnime.fromDandanplayDetail 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.
PlayerRemoteControlBridge._buildParameters (cyclomatic 34) lib/services/player_remote_control_bridge.dart:213— PlayerRemoteControlBridge._buildParameters 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.
RemoteSubtitleService._downloadPair (cyclomatic 34) lib/services/remote_subtitle_service.dart:383— RemoteSubtitleService._downloadPair 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.
_LibraryManagementTabState.build (cyclomatic 34) lib/themes/nipaplay/widgets/library_management_tab.dart:2129— _LibraryManagementTabState.build has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppDelegate.didInitializeImplicitFlutterEngine (cyclomatic 34) ios/Runner/AppDelegate.swift:31— AppDelegate.didInitializeImplicitFlutterEngine 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.
WebApiService.handleUpdateHistoryProgressRequest (cyclomatic 33) lib/services/web_api_service.dart:751— WebApiService.handleUpdateHistoryProgressRequest 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.
_PlaybackInfoMenuState._getVideoInfo (cyclomatic 33) lib/themes/nipaplay/widgets/playback_info_menu.dart:377— _PlaybackInfoMenuState._getVideoInfo 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.
_SubtitleTracksMenuState._loadRemoteSubtitle (cyclomatic 33) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:283— _SubtitleTracksMenuState._loadRemoteSubtitle 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.
SubtitleParser._normalizeEncodingName (cyclomatic 33) lib/utils/subtitle_parser.dart:943— SubtitleParser._normalizeEncodingName 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.
_AnimeDetailPageState._buildSummaryView (cyclomatic 32) lib/pages/anime_detail_page.dart:1331— _AnimeDetailPageState._buildSummaryView 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.
MediaKitPlayerAdapter.attachPlatformVideoSurface (cyclomatic 32) lib/player_abstraction/media_kit_player_adapter.dart:3072— MediaKitPlayerAdapter.attachPlatformVideoSurface 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.
FullBackupService._restoreMediaLibraries (cyclomatic 32) lib/services/full_backup_service.dart:709— FullBackupService._restoreMediaLibraries 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.
_NipaplayLargeScreenScaffoldLayoutState.build (cyclomatic 32) lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:1254— _NipaplayLargeScreenScaffoldLayoutState.build has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_VideoUploadUIState._handleUploadVideo (cyclomatic 32) lib/themes/nipaplay/widgets/video_upload_ui.dart:229— _VideoUploadUIState._handleUploadVideo 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.
_AnimeDetailPageState._buildDetailContent (cyclomatic 31) lib/pages/anime_detail_page.dart:1585— _AnimeDetailPageState._buildDetailContent 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.
_AnimeDetailPageState._buildImmersiveSubtitle (cyclomatic 31) lib/pages/anime_detail_page.dart:3288— _AnimeDetailPageState._buildImmersiveSubtitle 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.
_Step2DialogState.scanVideoFiles (cyclomatic 31) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1520— _Step2DialogState.scanVideoFiles 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.
_LibraryManagementTabState._pickAndScanDirectory (cyclomatic 31) lib/themes/nipaplay/widgets/library_management_tab.dart:609— _LibraryManagementTabState._pickAndScanDirectory 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.
_VideoProgressBarState.build (cyclomatic 31) lib/themes/nipaplay/widgets/video_progress_bar.dart:230— _VideoProgressBarState.build has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SubtitleManager._prefetchRemoteFontsForSubtitle (cyclomatic 31) lib/utils/subtitle_manager.dart:2258— SubtitleManager._prefetchRemoteFontsForSubtitle 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.
UserActivityController.loadUserActivity (cyclomatic 30) lib/controllers/user_activity_controller.dart:31— UserActivityController.loadUserActivity 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.
DandanplayService._getVideoInfoWithMetadata (cyclomatic 30) lib/services/dandanplay_service_stub.dart:2138— DandanplayService._getVideoInfoWithMetadata 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.
DanmakuSpoilerFilterService._extractTextFromResponseBody (cyclomatic 30) lib/services/danmaku_spoiler_filter_service.dart:215— DanmakuSpoilerFilterService._extractTextFromResponseBody 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.
EpisodeNavigationService._getNextEpisodeFromJellyfin (cyclomatic 30) lib/services/episode_navigation_service.dart:1476— EpisodeNavigationService._getNextEpisodeFromJellyfin 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. This shape REPEATS in the file: 2 other methods here (EpisodeNavigationService._getPreviousEpisodeFromEmby, EpisodeNavigationService._getNextEpisodeFromEmby) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EpisodeNavigationService._getPreviousEpisodeFromEmby (cyclomatic 30) lib/services/episode_navigation_service.dart:1753— EpisodeNavigationService._getPreviousEpisodeFromEmby 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. This shape REPEATS in the file: 2 other methods here (EpisodeNavigationService._getNextEpisodeFromJellyfin, EpisodeNavigationService._getNextEpisodeFromEmby) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EpisodeNavigationService._getNextEpisodeFromEmby (cyclomatic 30) lib/services/episode_navigation_service.dart:1920— EpisodeNavigationService._getNextEpisodeFromEmby 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. This shape REPEATS in the file: 2 other methods here (EpisodeNavigationService._getNextEpisodeFromJellyfin, EpisodeNavigationService._getPreviousEpisodeFromEmby) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
_BlurButtonState._buildButtonBody (cyclomatic 30) lib/themes/nipaplay/widgets/blur_button.dart:107— _BlurButtonState._buildButtonBody has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_CachedNetworkImageWidgetState.build (cyclomatic 30) lib/themes/nipaplay/widgets/cached_network_image_widget.dart:403— _CachedNetworkImageWidgetState.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.
_SystemResourceDisplayState.build (cyclomatic 30) lib/themes/nipaplay/widgets/system_resource_display.dart:196— _SystemResourceDisplayState.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.
SubtitleParser.decodeSubtitleFile (cyclomatic 30) lib/utils/subtitle_parser.dart:135— SubtitleParser.decodeSubtitleFile 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.
_ExternalSubtitleOverlayState._buildPathBlock (cyclomatic 30) lib/widgets/external_subtitle_overlay.dart:163— _ExternalSubtitleOverlayState._buildPathBlock 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.
NipaPlayNextEngine.layout (cyclomatic 28) lib/danmaku_next/nipaplay_next_engine.dart:219— NipaPlayNextEngine.layout 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.
_AnimeDetailPageState._loadBangumiUserData (cyclomatic 28) lib/pages/anime_detail_page.dart:834— _AnimeDetailPageState._loadBangumiUserData 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.
WebDAVService._searchBreadthFirst (cyclomatic 28) lib/services/webdav_service.dart:2082— WebDAVService._searchBreadthFirst 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.
_LibraryManagementTabState._buildManagementItems (cyclomatic 28) lib/themes/nipaplay/widgets/library_management_tab.dart:2639— _LibraryManagementTabState._buildManagementItems 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.
MediaKitPlayerAdapter._addEventListeners (cyclomatic 27) lib/player_abstraction/media_kit_player_adapter.dart:1002— MediaKitPlayerAdapter._addEventListeners 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.
_PluginProcess.launch (cyclomatic 27) lib/plugins/plugin_process_manager.dart:99— _PluginProcess.launch 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.
SharedRemoteLibraryProvider.browseRemoteDirectory (cyclomatic 27) lib/providers/shared_remote_library_provider.dart:1061— SharedRemoteLibraryProvider.browseRemoteDirectory 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.
WatchHistoryProvider._validateFilePathBatch (cyclomatic 27) lib/providers/watch_history_provider.dart:335— WatchHistoryProvider._validateFilePathBatch 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.
WebDAVProxyService._handleStreamInternal (cyclomatic 27) lib/services/webdav_proxy_service.dart:160— WebDAVProxyService._handleStreamInternal 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.
WebDAVService._legacyAttemptConnection (cyclomatic 27) lib/services/webdav_service.dart:1187— WebDAVService._legacyAttemptConnection 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.
_CustomScaffoldState.build (cyclomatic 27) lib/themes/nipaplay/widgets/custom_scaffold.dart:136— _CustomScaffoldState.build has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_LibraryManagementTabState._buildControlBarActionsLocal (cyclomatic 27) lib/themes/nipaplay/widgets/library_management_tab.dart:1846— _LibraryManagementTabState._buildControlBarActionsLocal 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.
BangumiAnime.fromJson (cyclomatic 26) lib/models/bangumi_model.dart:306— BangumiAnime.fromJson has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WatchHistoryProvider._syncRemoteHistory (cyclomatic 26) lib/providers/watch_history_provider.dart:45— WatchHistoryProvider._syncRemoteHistory 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.
DandanplayService._getVideoInfoWithMetadata (cyclomatic 26) lib/services/dandanplay_service_io.dart:1235— DandanplayService._getVideoInfoWithMetadata 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.
_CupertinoJellyfinQualityPaneState._applySelection (cyclomatic 26) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:154— _CupertinoJellyfinQualityPaneState._applySelection 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.
_CupertinoSubtitleTracksPaneState.build (cyclomatic 26) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:337— _CupertinoSubtitleTracksPaneState.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.
_MacOSWindowNativeVideoOverlaySurfaceState._sendOverlayFrame (cyclomatic 26) lib/widgets/macos_native_video_view.dart:397— _MacOSWindowNativeVideoOverlaySurfaceState._sendOverlayFrame 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.
DfmPlusLayoutBridge.configure (cyclomatic 25) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:57— DfmPlusLayoutBridge.configure 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.
NipaPlayNextEngine._rebuildLayout (cyclomatic 25) lib/danmaku_next/nipaplay_next_engine.dart:678— NipaPlayNextEngine._rebuildLayout 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.
NipaPlayNextOldEngine._rebuildLayout (cyclomatic 25) lib/danmaku_next/nipaplay_next_old_engine.dart:521— NipaPlayNextOldEngine._rebuildLayout 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.
SharedRemoteLibraryProvider._fetchRemoteWebDAVDirectory (cyclomatic 25) lib/providers/shared_remote_library_provider.dart:1202— SharedRemoteLibraryProvider._fetchRemoteWebDAVDirectory 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.
FullBackupService._collectPreferences (cyclomatic 25) lib/services/full_backup_service.dart:150— FullBackupService._collectPreferences has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_WatchHistoryPageState._onWatchHistoryItemTap (cyclomatic 25) lib/themes/nipaplay/pages/settings/watch_history_page.dart:512— _WatchHistoryPageState._onWatchHistoryItemTap 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.
NipaplayAnimeDetailLayout.build (cyclomatic 25) lib/themes/nipaplay/widgets/anime_detail_shell.dart:40— NipaplayAnimeDetailLayout.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.
_JellyfinQualityMenuState._loadCurrentQuality (cyclomatic 25) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:49— _JellyfinQualityMenuState._loadCurrentQuality 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.
_LibraryManagementTabState._buildWebDAVFileNodes (cyclomatic 25) lib/themes/nipaplay/widgets/library_management_tab.dart:5412— _LibraryManagementTabState._buildWebDAVFileNodes 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 (_LibraryManagementTabState._buildSMBFileNodes) 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.
_LibraryManagementTabState._buildSMBFileNodes (cyclomatic 25) lib/themes/nipaplay/widgets/library_management_tab.dart:5617— _LibraryManagementTabState._buildSMBFileNodes 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 (_LibraryManagementTabState._buildWebDAVFileNodes) 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.
_MediaCaptureDialogContentState._buildImageTab (cyclomatic 25) lib/themes/nipaplay/widgets/media_capture_dialog.dart:559— _MediaCaptureDialogContentState._buildImageTab 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.
_WebDAVFormState.build (cyclomatic 25) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:82— _WebDAVFormState.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.
SubtitleManager._writeExternalSubtitleSelection (cyclomatic 25) lib/utils/subtitle_manager.dart:483— SubtitleManager._writeExternalSubtitleSelection 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.
SubtitleManager._registerRemainingSubtitlesAfterRestore (cyclomatic 25) lib/utils/subtitle_manager.dart:1895— SubtitleManager._registerRemainingSubtitlesAfterRestore 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.
_ErikaOhosSmokeAppState._run (cyclomatic 24) tool/ohos_erika_smoke.dart:65— _ErikaOhosSmokeAppState._run 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.
MediaLibraryScope.containsPath (cyclomatic 24) lib/models/media_library_scope.dart:26— MediaLibraryScope.containsPath 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.
WatchHistoryDatabase._ensureWebStoreLoaded (cyclomatic 24) lib/models/watch_history_database.dart:334— WatchHistoryDatabase._ensureWebStoreLoaded 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.
_AnimeDetailPageState._syncBangumiCollection (cyclomatic 24) lib/pages/anime_detail_page.dart:1058— _AnimeDetailPageState._syncBangumiCollection 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.
MediaKitPlayerAdapter._updateMediaInfo (cyclomatic 24) lib/player_abstraction/media_kit_player_adapter.dart:1273— MediaKitPlayerAdapter._updateMediaInfo 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.
AutoSyncService._synchronizeRepository (cyclomatic 24) lib/services/auto_sync_service.dart:251— AutoSyncService._synchronizeRepository 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.
EmbyService.getSubtitleTracks (cyclomatic 24) lib/services/emby_service.dart:1914— EmbyService.getSubtitleTracks 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.
EpisodeNavigationService._getPreviousEpisodeFromDatabase (cyclomatic 24) lib/services/episode_navigation_service.dart:647— EpisodeNavigationService._getPreviousEpisodeFromDatabase has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EpisodeNavigationService._getNextEpisodeFromDatabase) 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.
EpisodeNavigationService._getNextEpisodeFromDatabase (cyclomatic 24) lib/services/episode_navigation_service.dart:772— EpisodeNavigationService._getNextEpisodeFromDatabase has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EpisodeNavigationService._getPreviousEpisodeFromDatabase) 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.
EpisodeNavigationService._getPreviousEpisodeFromJellyfin (cyclomatic 24) lib/services/episode_navigation_service.dart:1322— EpisodeNavigationService._getPreviousEpisodeFromJellyfin 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.
FilePickerService._copyToDocumentsIfNeeded (cyclomatic 24) lib/services/file_picker_service.dart:88— FilePickerService._copyToDocumentsIfNeeded 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.
_BlurDropdownState._openDropdown (cyclomatic 24) lib/themes/nipaplay/widgets/blur_dropdown.dart:487— _BlurDropdownState._openDropdown 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.
_LibraryManagementTabState._buildAdaptiveManagementView (cyclomatic 24) lib/themes/nipaplay/widgets/library_management_tab.dart:2413— _LibraryManagementTabState._buildAdaptiveManagementView 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.
_LoadingOverlayState.build (cyclomatic 24) lib/themes/nipaplay/widgets/loading_overlay.dart:110— _LoadingOverlayState.build has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SharedRemoteHostSelectionSheet.build (cyclomatic 24) lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:65— SharedRemoteHostSelectionSheet.build has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_AdaptiveMediaTextFieldState.build (cyclomatic 23) lib/media_library/adaptive_media_library_primitives.dart:756— _AdaptiveMediaTextFieldState.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.
_WebDAVBrowserPageState._startSearch (cyclomatic 23) lib/pages/webdav_browser_page.dart:1949— _WebDAVBrowserPageState._startSearch 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.
SharedRemoteLibraryProvider.refreshManagement (cyclomatic 23) lib/providers/shared_remote_library_provider.dart:891— SharedRemoteLibraryProvider.refreshManagement 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.
SharedRemoteLibraryProvider._fetchRemoteSMBDirectory (cyclomatic 23) lib/providers/shared_remote_library_provider.dart:1481— SharedRemoteLibraryProvider._fetchRemoteSMBDirectory 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.
EmbyService.loadAvailableLibraries (cyclomatic 23) lib/services/emby_service.dart:476— EmbyService.loadAvailableLibraries 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.
_BackupRestorePageState._showFullRestoreDialog (cyclomatic 23) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:336— _BackupRestorePageState._showFullRestoreDialog 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.
_LibraryManagementTabState._buildLargeScreenManagementStatus (cyclomatic 23) lib/themes/nipaplay/widgets/library_management_tab.dart:3546— _LibraryManagementTabState._buildLargeScreenManagementStatus 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.
_PlaybackInfoMenuState._getServerMetaInfo (cyclomatic 23) lib/themes/nipaplay/widgets/playback_info_menu.dart:219— _PlaybackInfoMenuState._getServerMetaInfo 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.
RemoteMediaFetcher._fetchHeadWithDart (cyclomatic 23) lib/utils/remote_media_fetcher.dart:68— RemoteMediaFetcher._fetchHeadWithDart 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.
SubtitleManager.setExternalSubtitle (cyclomatic 23) lib/utils/subtitle_manager.dart:677— SubtitleManager.setExternalSubtitle 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.
_DfmPlusOverlayState._runUpdateLoop (cyclomatic 22) lib/danmaku_dfm/dfm_plus_overlay.dart:494— _DfmPlusOverlayState._runUpdateLoop 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.
_MediaServerDetailPageState._playEpisode (cyclomatic 22) lib/pages/media_server_detail_page.dart:1870— _MediaServerDetailPageState._playEpisode 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.
_ShortcutsSettingsPageState._handleKeyPress (cyclomatic 22) lib/pages/shortcuts_settings_page.dart:314— _ShortcutsSettingsPageState._handleKeyPress 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.
_WebDAVBrowserPageState._loadDirectory (cyclomatic 22) lib/pages/webdav_browser_page.dart:122— _WebDAVBrowserPageState._loadDirectory 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.
_WebDAVBrowserPageState._buildFileItem (cyclomatic 22) lib/pages/webdav_browser_page.dart:1385— _WebDAVBrowserPageState._buildFileItem 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.
CertificateTrustService._isLanHost (cyclomatic 22) lib/services/certificate_trust_service.dart:131— CertificateTrustService._isLanHost 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.
EpisodeNavigationService._locateRemoteEpisode (cyclomatic 22) lib/services/episode_navigation_service.dart:519— EpisodeNavigationService._locateRemoteEpisode 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.
JellyfinService.createPlaybackSession (cyclomatic 22) lib/services/jellyfin_service.dart:1083— JellyfinService.createPlaybackSession 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.
PluginPlaybackService.prepare (cyclomatic 22) lib/services/plugin_playback_service.dart:15— PluginPlaybackService.prepare 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.
RemoteSubtitleService._listSharedRemoteFontCandidates (cyclomatic 22) lib/services/remote_subtitle_service.dart:1271— RemoteSubtitleService._listSharedRemoteFontCandidates 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.
SMBProxyService._handleStreamInternal (cyclomatic 22) lib/services/smb_proxy_service.dart:149— SMBProxyService._handleStreamInternal 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.
WebServerService._accessUrlSortWeight (cyclomatic 22) lib/services/web_server_service.dart:471— WebServerService._accessUrlSortWeight 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.
_CupertinoMainPageState.build (cyclomatic 22) lib/themes/cupertino/pages/cupertino_main_page.dart:331— _CupertinoMainPageState.build has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_BlurDropdownState.build (cyclomatic 22) lib/themes/nipaplay/widgets/blur_dropdown.dart:213— _BlurDropdownState.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.
_LibraryManagementTabState._loadMountedDirectory (cyclomatic 22) lib/themes/nipaplay/widgets/library_management_tab.dart:3052— _LibraryManagementTabState._loadMountedDirectory 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.
_LibraryManagementTabState._scrapeRemoteFiles (cyclomatic 22) lib/themes/nipaplay/widgets/library_management_tab.dart:5879— _LibraryManagementTabState._scrapeRemoteFiles 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.
_SMBConnectionFormState.build (cyclomatic 22) lib/themes/nipaplay/widgets/smb_connection_dialog.dart:133— _SMBConnectionFormState.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.
SubtitleManager._loadExternalSubtitleWithEncodingFix (cyclomatic 22) lib/utils/subtitle_manager.dart:1270— SubtitleManager._loadExternalSubtitleWithEncodingFix 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.
DanmakuGroupWidget.build (cyclomatic 22) lib/widgets/danmaku_group_widget.dart:27— DanmakuGroupWidget.build has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
nipaplay_dandanplay_gateway::proxy (cyclomatic 22) server/dandanplay-gateway/src/main.rs:250— nipaplay_dandanplay_gateway::proxy 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.
MainPageState.build (cyclomatic 21) lib/main.dart:1947— MainPageState.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.
_MdkOhosSmokeAppState._run (cyclomatic 21) tool/ohos_mdk_smoke.dart:42— _MdkOhosSmokeAppState._run 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.
_PlayVideoPageState._shareCurrentMedia (cyclomatic 21) lib/pages/play_video_page.dart:330— _PlayVideoPageState._shareCurrentMedia 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.
_LargeScreenTorrentTaskCard.build (cyclomatic 21) lib/pages/torrent_download_page.dart:2429— _LargeScreenTorrentTaskCard.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.
_WebDAVBrowserPageState.build (cyclomatic 21) lib/pages/webdav_browser_page.dart:483— _WebDAVBrowserPageState.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.
MediaKitPlayerAdapter.setMedia (cyclomatic 21) lib/player_abstraction/media_kit_player_adapter.dart:2272— MediaKitPlayerAdapter.setMedia 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.
DandanplayService.getBangumiOAuthLoginUrl (cyclomatic 21) lib/services/dandanplay_service_stub.dart:737— DandanplayService.getBangumiOAuthLoginUrl 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.
EmbyService.getLatestMediaItems (cyclomatic 21) lib/services/emby_service.dart:712— EmbyService.getLatestMediaItems 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.
EmbyService._addTranscodeParameters (cyclomatic 21) lib/services/emby_service.dart:1563— EmbyService._addTranscodeParameters 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.
EpisodeNumberExtractor.extract (cyclomatic 21) lib/services/intro_skip/episode_number_extractor.dart:31— EpisodeNumberExtractor.extract 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.
JellyfinService._addTranscodeParameters (cyclomatic 21) lib/services/jellyfin_service.dart:1426— JellyfinService._addTranscodeParameters 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.
MultiAddressServerService.identifyServer (cyclomatic 21) lib/services/multi_address_server_service.dart:371— MultiAddressServerService.identifyServer 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.
QuarterlyReviewCache.reserveCollectionProbe (cyclomatic 21) lib/services/quarterly_review_cache.dart:482— QuarterlyReviewCache.reserveCollectionProbe 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.
RemoteSubtitleService._listSharedRemoteAudioCandidates (cyclomatic 21) lib/services/remote_subtitle_service.dart:1153— RemoteSubtitleService._listSharedRemoteAudioCandidates 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.
_CupertinoDanmakuSettingsPaneState.build (cyclomatic 21) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:304— _CupertinoDanmakuSettingsPaneState.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.
_CupertinoSubtitleTracksPaneState._loadRemoteSubtitleFile (cyclomatic 21) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:129— _CupertinoSubtitleTracksPaneState._loadRemoteSubtitleFile 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.
_BackupRestorePageState._showFullBackupDialog (cyclomatic 21) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:207— _BackupRestorePageState._showFullBackupDialog 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.
BlurSnackBar.show (cyclomatic 21) lib/themes/nipaplay/widgets/blur_snackbar.dart:30— BlurSnackBar.show 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.
_LibraryManagementTabState._buildControlBarActionsRemote (cyclomatic 21) lib/themes/nipaplay/widgets/library_management_tab.dart:2013— _LibraryManagementTabState._buildControlBarActionsRemote 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.
_LibraryManagementTabState._buildAdaptiveManagementStatus (cyclomatic 21) lib/themes/nipaplay/widgets/library_management_tab.dart:2540— _LibraryManagementTabState._buildAdaptiveManagementStatus 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.
_SharedRemoteLanScanDialogContentState._startScan (cyclomatic 21) lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:149— _SharedRemoteLanScanDialogContentState._startScan 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.
_SubtitleTracksMenuState._loadExternalSubtitle (cyclomatic 21) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:189— _SubtitleTracksMenuState._loadExternalSubtitle 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.
_VideoPlayerUIState._shareCurrentMedia (cyclomatic 21) lib/themes/nipaplay/widgets/video_player_ui.dart:889— _VideoPlayerUIState._shareCurrentMedia 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.
_DanmakuContainerState.build (cyclomatic 21) lib/widgets/danmaku_container.dart:812— _DanmakuContainerState.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.
Next2Renderer::build_vertices (cyclomatic 21) rust/src/next2_engine/engine/renderer_draw.rs:459— Next2Renderer::build_vertices 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.
AdaptiveMediaActionButton.build (cyclomatic 20) lib/media_library/adaptive_media_library_primitives.dart:48— AdaptiveMediaActionButton.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.
_AnimeDetailPageState._buildContent (cyclomatic 20) lib/pages/anime_detail_page.dart:2474— _AnimeDetailPageState._buildContent 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.
_MediaServerDetailPageState._buildInfoView (cyclomatic 20) lib/pages/media_server_detail_page.dart:1544— _MediaServerDetailPageState._buildInfoView 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.
_ErikaDanmakuConfigPatch.differenceFrom (cyclomatic 20) lib/player_abstraction/erika_player_adapter.dart:106— _ErikaDanmakuConfigPatch.differenceFrom 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.
VideoPlayerAdapter._actuallyCreateController (cyclomatic 20) lib/player_abstraction/video_player_adapter.dart:868— VideoPlayerAdapter._actuallyCreateController 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.
BangumiService._getAnimeDetails (cyclomatic 20) lib/services/bangumi_service.dart:393— BangumiService._getAnimeDetails 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.
JellyfinService.getMediaInfo (cyclomatic 20) lib/services/jellyfin_service.dart:879— JellyfinService.getMediaInfo 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.
MediaServerWatchHistorySync.refresh (cyclomatic 20) lib/services/media_server_watch_history_sync.dart:169— MediaServerWatchHistorySync.refresh has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_MediaProxyServer._serve (cyclomatic 20) lib/services/plugin_media_proxy.dart:144— _MediaProxyServer._serve 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.
RemoteSubtitleService._ensureSingleSubtitleCached (cyclomatic 20) lib/services/remote_subtitle_service.dart:473— RemoteSubtitleService._ensureSingleSubtitleCached 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.
RemoteSubtitleService._tryResolveWebDavFromUrl (cyclomatic 20) lib/services/remote_subtitle_service.dart:1601— RemoteSubtitleService._tryResolveWebDavFromUrl 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.
WebApiService.handleImageProxyRequest (cyclomatic 20) lib/services/web_api_service.dart:166— WebApiService.handleImageProxyRequest 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.
_StorageSettingsContentState.build (cyclomatic 20) lib/settings/pages/storage_settings_content.dart:38— _StorageSettingsContentState.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.
_CachedNetworkImageWidgetState._resolveDecodeTarget (cyclomatic 20) lib/themes/nipaplay/widgets/cached_network_image_widget.dart:203— _CachedNetworkImageWidgetState._resolveDecodeTarget 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.
_NipaplayLargeScreenAnimeDetailPageState._buildHeroInfoSection (cyclomatic 20) lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:845— _NipaplayLargeScreenAnimeDetailPageState._buildHeroInfoSection 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.
_NipaplayLargeScreenAnimeDetailPageState._buildEpisodeCard (cyclomatic 20) lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1076— _NipaplayLargeScreenAnimeDetailPageState._buildEpisodeCard 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.
NipaplayLargeScreenViewContainer.build (cyclomatic 20) lib/themes/nipaplay/widgets/large_screen_view_container.dart:75— NipaplayLargeScreenViewContainer.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.
_LibraryManagementTabState._showBatchDanmakuMatchDialog (cyclomatic 20) lib/themes/nipaplay/widgets/library_management_tab.dart:4395— _LibraryManagementTabState._showBatchDanmakuMatchDialog 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.
SettingsItem._buildLargeScreen (cyclomatic 20) lib/themes/nipaplay/widgets/settings_item.dart:469— SettingsItem._buildLargeScreen 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.
NetworkAddressUtils._isPrivateIpv4 (cyclomatic 20) lib/utils/network_address_utils.dart:73— NetworkAddressUtils._isPrivateIpv4 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.
StorageService._getUniversalStorageDirectory (cyclomatic 20) lib/utils/storage_service.dart:171— StorageService._getUniversalStorageDirectory 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.
SubtitleParser._scoreDecodedText (cyclomatic 20) lib/utils/subtitle_parser.dart:613— SubtitleParser._scoreDecodedText 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.
VideoAspectGeometry.displayRect (cyclomatic 20) lib/utils/video_aspect_geometry.dart:21— VideoAspectGeometry.displayRect 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.
VideoPlayerState._parseSeekStepFrameRateValue (cyclomatic 20) lib/utils/video_player_state.dart:1431— VideoPlayerState._parseSeekStepFrameRateValue 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.
WatchHistoryAutoMatchHelper.tryAutoMatch (cyclomatic 20) lib/utils/watch_history_auto_match_helper.dart:36— WatchHistoryAutoMatchHelper.tryAutoMatch 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.
NativeSubtitleParser.parseBytes (cyclomatic 19) lib/cpp_native/bindings/subtitle_parser_io.dart:61— NativeSubtitleParser.parseBytes 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.
_NipaPlayNext2OverlayState._tryUpdateTexture (cyclomatic 19) lib/danmaku_next/nipaplay_next2_overlay.dart:234— _NipaPlayNext2OverlayState._tryUpdateTexture 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.
_WebDAVBrowserPageState._buildLargeScreenFileCard (cyclomatic 19) lib/pages/webdav_browser_page.dart:898— _WebDAVBrowserPageState._buildLargeScreenFileCard 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.
_ErikaDanmakuConfigPatch.isEmpty (cyclomatic 19) lib/player_abstraction/erika_player_adapter.dart:60— _ErikaDanmakuConfigPatch.isEmpty has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
VideoPlayerAdapter.prepare (cyclomatic 19) lib/player_abstraction/video_player_adapter.dart:456— VideoPlayerAdapter.prepare 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.
_PluginProcess.stop (cyclomatic 19) lib/plugins/plugin_process_manager.dart:281— _PluginProcess.stop 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.
SharedRemoteLibraryProvider._shouldBypassProxy (cyclomatic 19) lib/providers/shared_remote_library_provider.dart:699— SharedRemoteLibraryProvider._shouldBypassProxy 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.
DandanplayHttpClient.send (cyclomatic 19) lib/services/dandanplay_http_client.dart:59— DandanplayHttpClient.send 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.
DandanplayService.getBangumiByTmdbId (cyclomatic 19) lib/services/dandanplay_service_io.dart:2207— DandanplayService.getBangumiByTmdbId 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.
DandanplayService.refreshLinkedBangumiStatus (cyclomatic 19) lib/services/dandanplay_service_stub.dart:833— DandanplayService.refreshLinkedBangumiStatus 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.
DandanplayService.getUserPlayHistory (cyclomatic 19) lib/services/dandanplay_service_stub.dart:1343— DandanplayService.getUserPlayHistory 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.
EmbyService.createPlaybackSession (cyclomatic 19) lib/services/emby_service.dart:1227— EmbyService.createPlaybackSession 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.
EmbyService._buildPlaybackSessionFromResponse (cyclomatic 19) lib/services/emby_service.dart:1333— EmbyService._buildPlaybackSessionFromResponse 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.
EpisodeNavigationService._isSameRemoteEpisode (cyclomatic 19) lib/services/episode_navigation_service.dart:438— EpisodeNavigationService._isSameRemoteEpisode 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.
FullBackupService._restoreAccounts (cyclomatic 19) lib/services/full_backup_service.dart:1038— FullBackupService._restoreAccounts 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.
JellyfinService._buildPlaybackSessionFromResponse (cyclomatic 19) lib/services/jellyfin_service.dart:1208— JellyfinService._buildPlaybackSessionFromResponse 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.
QuarterlyReviewCache._load (cyclomatic 19) lib/services/quarterly_review_cache.dart:129— QuarterlyReviewCache._load has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteSubtitleService._listManagedLibraryCandidates (cyclomatic 19) lib/services/remote_subtitle_service.dart:927— RemoteSubtitleService._listManagedLibraryCandidates 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.
WebDAVService.resolveFileUrl (cyclomatic 19) lib/services/webdav_service.dart:769— WebDAVService.resolveFileUrl 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.
WebDAVService._shouldBypassProxy (cyclomatic 19) lib/services/webdav_service.dart:1798— WebDAVService._shouldBypassProxy 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.
_CupertinoTagSearchViewState._buildResultSlivers (cyclomatic 19) lib/themes/cupertino/widgets/cupertino_tag_search_view.dart:175— _CupertinoTagSearchViewState._buildResultSlivers 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.
HorizontalAnimeCard.build (cyclomatic 19) lib/themes/nipaplay/widgets/horizontal_anime_card.dart:138— HorizontalAnimeCard.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.
_LibraryManagementTabState._sortContents (cyclomatic 19) lib/themes/nipaplay/widgets/library_management_tab.dart:912— _LibraryManagementTabState._sortContents 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.
_LocalLibraryControlBarState.build (cyclomatic 19) lib/themes/nipaplay/widgets/local_library_control_bar.dart:107— _LocalLibraryControlBarState.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.
_PlaybackInfoMenuState._getErikaRuntimeInfo (cyclomatic 19) lib/themes/nipaplay/widgets/playback_info_menu.dart:549— _PlaybackInfoMenuState._getErikaRuntimeInfo 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.
_RatingDialogState.build (cyclomatic 19) lib/themes/nipaplay/widgets/rating_dialog.dart:105— _RatingDialogState.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.
_SubtitleListMenuState._loadSubtitles (cyclomatic 19) lib/themes/nipaplay/widgets/subtitle_list_menu.dart:129— _SubtitleListMenuState._loadSubtitles 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.
MediaSourceUtils.migrateWebDavPath (cyclomatic 19) lib/utils/media_source_utils.dart:259— MediaSourceUtils.migrateWebDavPath 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.
PlayerKernelManager.performPlayerKernelHotSwapSteps (cyclomatic 19) lib/utils/player_kernel_manager.dart:117— PlayerKernelManager.performPlayerKernelHotSwapSteps 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.
RemoteMediaFetcher._shouldBypassProxy (cyclomatic 19) lib/utils/remote_media_fetcher.dart:433— RemoteMediaFetcher._shouldBypassProxy 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.
DfmPlusLayoutBridge.layout (cyclomatic 18) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:234— DfmPlusLayoutBridge.layout 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.
LibraryNewContentTracker.load (cyclomatic 18) lib/media_library/adaptive_media_collection_view.dart:113— LibraryNewContentTracker.load 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.
_DanmakuRow.build (cyclomatic 18) lib/pages/external_player_console_page.dart:1187— _DanmakuRow.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.
_NipaplayErikaWindowOverlayVideoViewState._sendOverlayFrame (cyclomatic 18) lib/player_abstraction/erika_player_adapter.dart:436— _NipaplayErikaWindowOverlayVideoViewState._sendOverlayFrame 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.
PluginUrlResolver.resolve (cyclomatic 18) lib/plugins/url_resolver.dart:92— PluginUrlResolver.resolve 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.
SharedRemoteLibraryProvider.testWebDAVConnection (cyclomatic 18) lib/providers/shared_remote_library_provider.dart:1306— SharedRemoteLibraryProvider.testWebDAVConnection 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.
JellyfinService.getLatestMediaItems (cyclomatic 18) lib/services/jellyfin_service.dart:596— JellyfinService.getLatestMediaItems 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.
JellyfinService.buildHlsUrlWithAutoSubtitle (cyclomatic 18) lib/services/jellyfin_service.dart:1510— JellyfinService.buildHlsUrlWithAutoSubtitle 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.
LocalMediaManagementApi._handleStreamInternal (cyclomatic 18) lib/services/local_media_management_api.dart:746— LocalMediaManagementApi._handleStreamInternal 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.
LocalMediaManagementApi._handleSubtitles (cyclomatic 18) lib/services/local_media_management_api.dart:831— LocalMediaManagementApi._handleSubtitles 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.
AdaptiveSettingsTile._buildPhone (cyclomatic 18) lib/settings/adaptive_settings_widgets.dart:330— AdaptiveSettingsTile._buildPhone 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.
_AppearanceSettingsContentState.build (cyclomatic 18) lib/settings/pages/appearance_settings_content.dart:73— _AppearanceSettingsContentState.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.
CupertinoAudioTracksPane.build (cyclomatic 18) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:23— CupertinoAudioTracksPane.build has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
_DanmakuSettingsMenuState.build (cyclomatic 18) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1121— _DanmakuSettingsMenuState.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.
_DescriptionBlock.build (cyclomatic 18) lib/themes/nipaplay/widgets/immersive_anime_detail_scaffold.dart:705— _DescriptionBlock.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.
_LibraryManagementTabState._getDirectoryContents (cyclomatic 18) lib/themes/nipaplay/widgets/library_management_tab.dart:848— _LibraryManagementTabState._getDirectoryContents 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.
_LibraryManagementTabState._collectMountedVideoPaths (cyclomatic 18) lib/themes/nipaplay/widgets/library_management_tab.dart:3281— _LibraryManagementTabState._collectMountedVideoPaths 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.
_SwitchableViewState._schedulePreloadIfNeeded (cyclomatic 18) lib/themes/nipaplay/widgets/switchable_view.dart:177— _SwitchableViewState._schedulePreloadIfNeeded 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.
SubtitleManager._activateMdkExternalSubtitleTrack (cyclomatic 18) lib/utils/subtitle_manager.dart:1199— SubtitleManager._activateMdkExternalSubtitleTrack 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.
RustLibNipaplayPlugin.initSurface (cyclomatic 18) rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:176— RustLibNipaplayPlugin.initSurface 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.
MacOSNativeVideoPlugin.handle (cyclomatic 18) macos/Runner/MainFlutterWindow.swift:650— MacOSNativeVideoPlugin.handle 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.
ResponseState::handle_start (cyclomatic 18) rust/src/api/webdav_multistatus.rs:147— ResponseState::handle_start 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.
_AdaptiveMediaLibraryPageState.build (cyclomatic 17) lib/media_library/adaptive_media_library_page.dart:266— _AdaptiveMediaLibraryPageState.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.
_AdaptiveMediaLibraryPageState._playHistoryItem (cyclomatic 17) lib/media_library/adaptive_media_library_page.dart:465— _AdaptiveMediaLibraryPageState._playHistoryItem 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.
WatchHistoryManager.getHistoryItem (cyclomatic 17) lib/models/watch_history_model.dart:660— WatchHistoryManager.getHistoryItem 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.
_AnimeDetailPageState._syncBangumiEpisodeProgress (cyclomatic 17) lib/pages/anime_detail_page.dart:1148— _AnimeDetailPageState._syncBangumiEpisodeProgress 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.
_AnimeDetailPageState._buildImmersiveEpisodeRail (cyclomatic 17) lib/pages/anime_detail_page.dart:3208— _AnimeDetailPageState._buildImmersiveEpisodeRail 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.
VideoPlayerAdapter._playDirectly (cyclomatic 17) lib/player_abstraction/video_player_adapter.dart:1006— VideoPlayerAdapter._playDirectly has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SharedRemoteLibraryProvider._refreshLibraryForHost (cyclomatic 17) lib/providers/shared_remote_library_provider.dart:316— SharedRemoteLibraryProvider._refreshLibraryForHost 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.
SharedRemoteLibraryProvider.scanRemoteWebDAVFolder (cyclomatic 17) lib/providers/shared_remote_library_provider.dart:1378— SharedRemoteLibraryProvider.scanRemoteWebDAVFolder has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (SharedRemoteLibraryProvider.scanRemoteSMBFolder) 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.
SharedRemoteLibraryProvider.scanRemoteSMBFolder (cyclomatic 17) lib/providers/shared_remote_library_provider.dart:1631— SharedRemoteLibraryProvider.scanRemoteSMBFolder has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (SharedRemoteLibraryProvider.scanRemoteWebDAVFolder) 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.
AutoNextEpisodeService._playNextEpisode (cyclomatic 17) lib/services/auto_next_episode_service.dart:240— AutoNextEpisodeService._playNextEpisode 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.
BangumiApiService._makeRequest (cyclomatic 17) lib/services/bangumi_api_service.dart:312— BangumiApiService._makeRequest 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.
DefaultEmbyMediaSelectionResolver.resolve (cyclomatic 17) lib/services/emby_media_selection_resolver.dart:12— DefaultEmbyMediaSelectionResolver.resolve 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.
EmbyService.getServerMediaTechnicalInfo (cyclomatic 17) lib/services/emby_service.dart:161— EmbyService.getServerMediaTechnicalInfo 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.
FilePickerService.pickExternalPlayerExecutable (cyclomatic 17) lib/services/file_picker_service.dart:567— FilePickerService.pickExternalPlayerExecutable 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.
DanmakuIntroDetector.detect (cyclomatic 17) lib/services/intro_skip/danmaku_intro_detector.dart:147— DanmakuIntroDetector.detect 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.
LocalMediaManagementApi._scrapeRemoteFiles (cyclomatic 17) lib/services/local_media_management_api.dart:519— LocalMediaManagementApi._scrapeRemoteFiles has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: LocalMediaManagementApi._determineContentType (cyclomatic 18) 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.
PlaybackSourceService._resolveDandanplayRemote (cyclomatic 17) lib/services/playback_source_service.dart:371— PlaybackSourceService._resolveDandanplayRemote 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.
RemoteSubtitleService.ensureFontCached (cyclomatic 17) lib/services/remote_subtitle_service.dart:759— RemoteSubtitleService.ensureFontCached 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.
RemoteSubtitleService._resolveSmbConnectionFromUri (cyclomatic 17) lib/services/remote_subtitle_service.dart:1729— RemoteSubtitleService._resolveSmbConnectionFromUri 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.
RemoteTextInputApiService._handlePost (cyclomatic 17) lib/services/remote_text_input_service.dart:489— RemoteTextInputApiService._handlePost 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.
ScanService._loadScannedFolders (cyclomatic 17) lib/services/scan_service.dart:287— ScanService._loadScannedFolders 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.
ScanService._updateScanState (cyclomatic 17) lib/services/scan_service.dart:658— ScanService._updateScanState 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.
SystemProxyService._parseMacOSProxyOutput (cyclomatic 17) lib/services/system_proxy_service.dart:223— SystemProxyService._parseMacOSProxyOutput 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.
WebDAVService._validateConnection (cyclomatic 17) lib/services/webdav_service.dart:499— WebDAVService._validateConnection 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.
AdaptiveButton.build (cyclomatic 17) lib/themes/cupertino/cupertino_adaptive_platform_ui.dart:117— AdaptiveButton.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.
_RemoteMenuPaneSheetState._buildNumericParam (cyclomatic 17) lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:864— _RemoteMenuPaneSheetState._buildNumericParam 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.
_BlurDropdownState._handleMenuKeyEvent (cyclomatic 17) lib/themes/nipaplay/widgets/blur_dropdown.dart:422— _BlurDropdownState._handleMenuKeyEvent 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.
CustomMediaInfoDialog._showStep1 (cyclomatic 17) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:64— CustomMediaInfoDialog._showStep1 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.
_NetworkMediaLibraryViewState._loadData (cyclomatic 17) lib/themes/nipaplay/widgets/network_media_library_view.dart:1582— _NetworkMediaLibraryViewState._loadData 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.
_PlaylistMenuState._createJellyfinHistoryItem (cyclomatic 17) lib/themes/nipaplay/widgets/playlist_menu.dart:1116— _PlaylistMenuState._createJellyfinHistoryItem has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (_PlaylistMenuState._createEmbyHistoryItem) 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.
_PlaylistMenuState._createEmbyHistoryItem (cyclomatic 17) lib/themes/nipaplay/widgets/playlist_menu.dart:1245— _PlaylistMenuState._createEmbyHistoryItem has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (_PlaylistMenuState._createJellyfinHistoryItem) 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.
_SeekStepMenuState.build (cyclomatic 17) lib/themes/nipaplay/widgets/seek_step_menu.dart:124— _SeekStepMenuState.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.
SharedRemoteHostSelectionSheet._buildHostList (cyclomatic 17) lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:303— SharedRemoteHostSelectionSheet._buildHostList 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.
_SharedRemoteLanScanDialogContentState._discoverByUdp (cyclomatic 17) lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:245— _SharedRemoteLanScanDialogContentState._discoverByUdp 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.
_SharedRemoteLibraryViewState._appendUnifiedRemoteEntries (cyclomatic 17) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1735— _SharedRemoteLibraryViewState._appendUnifiedRemoteEntries 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.
_VideoUploadUIState._handlePlayFromUrl (cyclomatic 17) lib/themes/nipaplay/widgets/video_upload_ui.dart:166— _VideoUploadUIState._handlePlayFromUrl 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.
AudioTrackManager._detectRemoteExternalAudioPath (cyclomatic 17) lib/utils/audio_track_manager.dart:77— AudioTrackManager._detectRemoteExternalAudioPath 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.
SubtitleManager._pickTextSubtitleReplacement (cyclomatic 17) lib/utils/subtitle_manager.dart:1827— SubtitleManager._pickTextSubtitleReplacement 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.
SubtitleManager._pickRemoteSubtitleCandidate (cyclomatic 17) lib/utils/subtitle_manager.dart:2014— SubtitleManager._pickRemoteSubtitleCandidate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NipaPlayNextEngine.configure (cyclomatic 16) lib/danmaku_next/nipaplay_next_engine.dart:148— NipaPlayNextEngine.configure 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.
NipaPlayNextOldEngine.configure (cyclomatic 16) lib/danmaku_next/nipaplay_next_old_engine.dart:139— NipaPlayNextOldEngine.configure 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.
MpvSession._readMpvState (cyclomatic 16) lib/models/external_player_session/mpv_session.dart:616— MpvSession._readMpvState has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
_AnimeDetailPageState._handleBangumiCollectionSubmitted (cyclomatic 16) lib/pages/anime_detail_page.dart:3792— _AnimeDetailPageState._handleBangumiCollectionSubmitted 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.
_DashboardHomePageState._onJellyfinStateChanged (cyclomatic 16) lib/pages/dashboard_home_page.dart:767— _DashboardHomePageState._onJellyfinStateChanged has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (_DashboardHomePageState._onEmbyStateChanged) 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.
_DashboardHomePageState._onEmbyStateChanged (cyclomatic 16) lib/pages/dashboard_home_page.dart:829— _DashboardHomePageState._onEmbyStateChanged has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (_DashboardHomePageState._onJellyfinStateChanged) 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.
_MediaServerDetailPageState._requestLargeScreenContentFocus (cyclomatic 16) lib/pages/media_server_detail_page.dart:254— _MediaServerDetailPageState._requestLargeScreenContentFocus 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.
_MediaServerDetailPageState._loadMediaDetail (cyclomatic 16) lib/pages/media_server_detail_page.dart:288— _MediaServerDetailPageState._loadMediaDetail 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.
_MediaServerDetailPageState.build (cyclomatic 16) lib/pages/media_server_detail_page.dart:1438— _MediaServerDetailPageState.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.
_NewSeriesPageState._buildLargeScreenMainContent (cyclomatic 16) lib/pages/new_series_page.dart:319— _NewSeriesPageState._buildLargeScreenMainContent 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.
_PlayVideoPageState._captureScreenshot (cyclomatic 16) lib/pages/play_video_page.dart:383— _PlayVideoPageState._captureScreenshot 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.
_NipaplayErikaWindowOverlayVideoViewState._attachOverlaySurface (cyclomatic 16) lib/player_abstraction/erika_player_adapter.dart:355— _NipaplayErikaWindowOverlayVideoViewState._attachOverlaySurface 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.
MediaKitPlayerAdapter._performSubtitleSyncLogic (cyclomatic 16) lib/player_abstraction/media_kit_player_adapter.dart:1701— MediaKitPlayerAdapter._performSubtitleSyncLogic 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.
MediaKitPlayerAdapter._openMainMedia (cyclomatic 16) lib/player_abstraction/media_kit_player_adapter.dart:2394— MediaKitPlayerAdapter._openMainMedia 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.
PluginProcessManager.start (cyclomatic 16) lib/plugins/plugin_process_manager.dart:18— PluginProcessManager.start 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.
SharedRemoteLibraryProvider.loadAnimeEpisodes (cyclomatic 16) lib/providers/shared_remote_library_provider.dart:479— SharedRemoteLibraryProvider.loadAnimeEpisodes 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.
WatchHistoryProvider.loadHistory (cyclomatic 16) lib/providers/watch_history_provider.dart:214— WatchHistoryProvider.loadHistory 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.
BangumiService.getCalendar (cyclomatic 16) lib/services/bangumi_service.dart:222— BangumiService.getCalendar has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ConcurrentVideoProcessor._processSingleVideoPath (cyclomatic 16) lib/services/concurrent_video_processor.dart:119— ConcurrentVideoProcessor._processSingleVideoPath 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.
DandanplayService.getUserFavorites (cyclomatic 16) lib/services/dandanplay_service_stub.dart:1738— DandanplayService.getUserFavorites 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.
DanmakuSpoilerFilterService.detectSpoilerDanmakuTexts (cyclomatic 16) lib/services/danmaku_spoiler_filter_service.dart:17— DanmakuSpoilerFilterService.detectSpoilerDanmakuTexts 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.
JellyfinService.getServerMediaTechnicalInfo (cyclomatic 16) lib/services/jellyfin_service.dart:144— JellyfinService.getServerMediaTechnicalInfo 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.
LocalMediaShareApi._handleUpdateEpisodeThumbnail (cyclomatic 16) lib/services/local_media_share_api.dart:392— LocalMediaShareApi._handleUpdateEpisodeThumbnail 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.
MediaServerServiceBase.connect (cyclomatic 16) lib/services/media_server_service_base.dart:300— MediaServerServiceBase.connect 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.
PlaybackSourceService._resolve (cyclomatic 16) lib/services/playback_source_service.dart:50— PlaybackSourceService._resolve 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.
PlaybackSourceService.sourceKindForPath (cyclomatic 16) lib/services/playback_source_service.dart:149— PlaybackSourceService.sourceKindForPath 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.
RemoteSubtitleService._listSharedRemoteCandidates (cyclomatic 16) lib/services/remote_subtitle_service.dart:1049— RemoteSubtitleService._listSharedRemoteCandidates 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.
SearchService.searchAnimeAdvanced (cyclomatic 16) lib/services/search_service.dart:163— SearchService.searchAnimeAdvanced 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.
ServerHistorySyncService._processResumeItems (cyclomatic 16) lib/services/server_history_sync_service.dart:162— ServerHistorySyncService._processResumeItems 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.
WebServerService.getAccessUrls (cyclomatic 16) lib/services/web_server_service.dart:517— WebServerService.getAccessUrls 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.
WebDAVService._legacyTestConnection (cyclomatic 16) lib/services/webdav_service.dart:1104— WebDAVService._legacyTestConnection 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.
CupertinoBottomSheet._buildSheet (cyclomatic 16) lib/themes/cupertino/widgets/cupertino_bottom_sheet.dart:198— CupertinoBottomSheet._buildSheet 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.
CupertinoAudioTracksPane._buildServerTrackTile (cyclomatic 16) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:191— CupertinoAudioTracksPane._buildServerTrackTile 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.
_ImmersiveEpisodeCardState.build (cyclomatic 16) lib/themes/nipaplay/widgets/immersive_episode_rail.dart:236— _ImmersiveEpisodeCardState.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.
_NipaplayLargeScreenFocusableActionState.build (cyclomatic 16) lib/themes/nipaplay/widgets/large_screen_focusable_action.dart:61— _NipaplayLargeScreenFocusableActionState.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.
_NipaplayLargeScreenPlayerMenuPanelState._handleKeyEvent (cyclomatic 16) lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:305— _NipaplayLargeScreenPlayerMenuPanelState._handleKeyEvent 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.
_NipaplayLargeScreenPlayerMenuPanelState._focusFirstFullyVisibleDanmakuRow (cyclomatic 16) lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:503— _NipaplayLargeScreenPlayerMenuPanelState._focusFirstFullyVisibleDanmakuRow has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_LibraryManagementTabState._buildFileSystemNodes (cyclomatic 16) lib/themes/nipaplay/widgets/library_management_tab.dart:1093— _LibraryManagementTabState._buildFileSystemNodes 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.
_MediaCaptureDialogContentState._validateSource (cyclomatic 16) lib/themes/nipaplay/widgets/media_capture_dialog.dart:241— _MediaCaptureDialogContentState._validateSource 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.
_SearchBarActionButtonState.build (cyclomatic 16) lib/themes/nipaplay/widgets/search_bar_action_button.dart:31— _SearchBarActionButtonState.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.
_SharedRemoteLibraryViewState._buildRemoteDirectoryChildren (cyclomatic 16) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1397— _SharedRemoteLibraryViewState._buildRemoteDirectoryChildren 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.
_SubtitleTracksMenuState._loadExternalSubtitles (cyclomatic 16) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:73— _SubtitleTracksMenuState._loadExternalSubtitles 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.
_TagSearchStyle.from (cyclomatic 16) lib/themes/nipaplay/widgets/tag_search_widget.dart:77— _TagSearchStyle.from 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.
_WebRemoteAccessGateState._autoMountSharedLibraries (cyclomatic 16) lib/themes/nipaplay/widgets/web_remote_access_gate.dart:32— _WebRemoteAccessGateState._autoMountSharedLibraries 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.
DecoderManager.checkDecoderAfterScreenshot (cyclomatic 16) lib/utils/decoder_manager.dart:457— DecoderManager.checkDecoderAfterScreenshot 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.
NetworkChecker.checkConnection (cyclomatic 16) lib/utils/network_checker.dart:6— NetworkChecker.checkConnection 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.
SubtitleManager._autoLoadLocalSubtitleGroup (cyclomatic 16) lib/utils/subtitle_manager.dart:1731— SubtitleManager._autoLoadLocalSubtitleGroup 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.
_SingleDanmakuState._calculatePosition (cyclomatic 16) lib/widgets/single_danmaku.dart:81— _SingleDanmakuState._calculatePosition 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.
DanmakuAtlasPainter.paint (cognitive 314) lib/danmaku_next/danmaku_atlas_painter.dart:392— DanmakuAtlasPainter.paint has cognitive complexity 314 (threshold 15). Drivers by points: if/else 104 (218 pts), ternaries 20 (58 pts), boolean chains 26, loops 6 (12 pts) (nesting depth added 158). 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.
_PlaylistMenuState._playEpisode (cognitive 201) lib/themes/nipaplay/widgets/playlist_menu.dart:680— _PlaylistMenuState._playEpisode has cognitive complexity 201 (threshold 15). Drivers by points: if/else 43 (171 pts), boolean chains 11, ternaries 2 (10 pts), error handling 3 (9 pts) (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.
SubtitleManager.autoDetectAndLoadSubtitle (cognitive 200) lib/utils/subtitle_manager.dart:1434— SubtitleManager.autoDetectAndLoadSubtitle has cognitive complexity 200 (threshold 15). Drivers by points: if/else 42 (159 pts), boolean chains 14, error handling 4 (13 pts), loops 2 (9 pts), ternaries 1 (5 pts) (nesting depth added 137). 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.
WebDAVService._parseWebDAVResponseDart (cognitive 194) lib/services/webdav_service.dart:1494— WebDAVService._parseWebDAVResponseDart has cognitive complexity 194 (threshold 15). Drivers by points: if/else 40 (160 pts), boolean chains 13, ternaries 3 (10 pts), error handling 3 (9 pts), loops 1 (2 pts) (nesting depth added 134). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmbyDandanplayMatcher._matchWithDandanPlay (cognitive 174) lib/services/emby_dandanplay_matcher.dart:297— EmbyDandanplayMatcher._matchWithDandanPlay has cognitive complexity 174 (threshold 15). Drivers by points: if/else 50 (134 pts), error handling 6 (17 pts), boolean chains 15, ternaries 3 (8 pts) (nesting depth added 100). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
JellyfinDandanplayMatcher._matchWithDandanPlay (cognitive 168) lib/services/jellyfin_dandanplay_matcher.dart:285— JellyfinDandanplayMatcher._matchWithDandanPlay has cognitive complexity 168 (threshold 15). Drivers by points: if/else 50 (125 pts), boolean chains 23, error handling 5 (13 pts), ternaries 3 (7 pts) (nesting depth added 87). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_WebDAVBrowserPageState._playVideo (cognitive 128) lib/pages/webdav_browser_page.dart:240— _WebDAVBrowserPageState._playVideo has cognitive complexity 128 (threshold 15). Drivers by points: if/else 17 (89 pts), loops 3 (23 pts), boolean chains 12, error handling 2 (4 pts) (nesting depth added 94). 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.
_PlayerSettingsContentState.build (cognitive 128) lib/settings/pages/player_settings_content.dart:291— _PlayerSettingsContentState.build has cognitive complexity 128 (threshold 15). Drivers by points: if/else 51 (81 pts), ternaries 18 (31 pts), boolean chains 9, error handling 2 (6 pts), match/switch 1 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginService._handlePluginBridgeCall (cognitive 123) lib/plugins/plugin_service.dart:460— PluginService._handlePluginBridgeCall has cognitive complexity 123 (threshold 15). Drivers by points: if/else 34 (78 pts), error handling 12 (33 pts), boolean chains 9, loops 1 (2 pts), match/switch 1 (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
VideoPlayerAdapter.snapshot (cognitive 117) lib/player_abstraction/video_player_adapter.dart:556— VideoPlayerAdapter.snapshot has cognitive complexity 117 (threshold 15). Drivers by points: if/else 29 (76 pts), loops 7 (27 pts), error handling 3 (8 pts), boolean chains 6 (nesting depth added 72). 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.
BangumiSyncService._syncAnimeToBangumi (cognitive 114) lib/services/bangumi_sync_service.dart:217— BangumiSyncService._syncAnimeToBangumi has cognitive complexity 114 (threshold 15). Drivers by points: if/else 36 (91 pts), loops 4 (11 pts), ternaries 1 (6 pts), boolean chains 5, error handling 1 (nesting depth added 67). 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.
_VideoUploadUIState._handleUploadVideo (cognitive 106) lib/themes/nipaplay/widgets/video_upload_ui.dart:229— _VideoUploadUIState._handleUploadVideo has cognitive complexity 106 (threshold 15). Drivers by points: if/else 32 (97 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 68). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AudioTracksMenu.build (cognitive 101) lib/themes/nipaplay/widgets/audio_tracks_menu.dart:156— AudioTracksMenu.build has cognitive complexity 101 (threshold 15). Drivers by points: if/else 20 (45 pts), ternaries 16 (34 pts), boolean chains 17, error handling 2 (5 pts) (nesting depth added 46). 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.
_PlayVideoPageState._buildMaterialControls (cognitive 100) lib/pages/play_video_page.dart:995— _PlayVideoPageState._buildMaterialControls has cognitive complexity 100 (threshold 15). Drivers by points: ternaries 28 (45 pts), if/else 24 (33 pts), boolean chains 22 (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.
DanmakuSpoilerFilterService._extractTextFromResponseBody (cognitive 100) lib/services/danmaku_spoiler_filter_service.dart:215— DanmakuSpoilerFilterService._extractTextFromResponseBody has cognitive complexity 100 (threshold 15). Drivers by points: if/else 19 (79 pts), ternaries 2 (13 pts), boolean chains 7, error handling 1 (nesting depth added 71). 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.
SubtitleManager._prefetchRemoteFontsForSubtitle (cognitive 99) lib/utils/subtitle_manager.dart:2258— SubtitleManager._prefetchRemoteFontsForSubtitle has cognitive complexity 99 (threshold 15). Drivers by points: if/else 25 (82 pts), loops 3 (9 pts), error handling 3 (7 pts), boolean chains 1 (nesting depth added 67). 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.
_PlaybackInfoMenuState._getAudioInfo (cognitive 98) lib/themes/nipaplay/widgets/playback_info_menu.dart:655— _PlaybackInfoMenuState._getAudioInfo has cognitive complexity 98 (threshold 15). Drivers by points: if/else 22 (65 pts), boolean chains 19, ternaries 6 (14 pts) (nesting depth added 51). 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.
_AnimeDetailPageState._buildEpisodesListView (cognitive 97) lib/pages/anime_detail_page.dart:1942— _AnimeDetailPageState._buildEpisodesListView has cognitive complexity 97 (threshold 15). Drivers by points: ternaries 32 (41 pts), if/else 30 (36 pts), boolean chains 18, error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
_Step2DialogState.scanVideoFiles (cognitive 97) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1520— _Step2DialogState.scanVideoFiles has cognitive complexity 97 (threshold 15). Drivers by points: if/else 23 (74 pts), loops 2 (8 pts), ternaries 2 (6 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 64). 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.
FullBackupService._restoreMediaLibraries (cognitive 92) lib/services/full_backup_service.dart:709— FullBackupService._restoreMediaLibraries has cognitive complexity 92 (threshold 15). Drivers by points: if/else 19 (54 pts), error handling 7 (22 pts), loops 4 (13 pts), boolean chains 3 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ShortcutsSettingsPageState._keyToText (cognitive 91) lib/pages/shortcuts_settings_page.dart:166— _ShortcutsSettingsPageState._keyToText has cognitive complexity 91 (threshold 15). Drivers by points: if/else 87 (89 pts), 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.
EpisodeNavigationService._getNextEpisodeFromJellyfin (cognitive 84) lib/services/episode_navigation_service.dart:1476— EpisodeNavigationService._getNextEpisodeFromJellyfin has cognitive complexity 84 (threshold 15). Drivers by points: if/else 21 (60 pts), error handling 5 (15 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (EpisodeNavigationService._getPreviousEpisodeFromEmby, EpisodeNavigationService._getNextEpisodeFromEmby) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EpisodeNavigationService._getPreviousEpisodeFromEmby (cognitive 84) lib/services/episode_navigation_service.dart:1753— EpisodeNavigationService._getPreviousEpisodeFromEmby has cognitive complexity 84 (threshold 15). Drivers by points: if/else 21 (60 pts), error handling 5 (15 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (EpisodeNavigationService._getNextEpisodeFromJellyfin, EpisodeNavigationService._getNextEpisodeFromEmby) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EpisodeNavigationService._getNextEpisodeFromEmby (cognitive 84) lib/services/episode_navigation_service.dart:1920— EpisodeNavigationService._getNextEpisodeFromEmby has cognitive complexity 84 (threshold 15). Drivers by points: if/else 21 (60 pts), error handling 5 (15 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (EpisodeNavigationService._getNextEpisodeFromJellyfin, EpisodeNavigationService._getPreviousEpisodeFromEmby) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsItem.build (cognitive 84) lib/themes/nipaplay/widgets/settings_item.dart:587— SettingsItem.build has cognitive complexity 84 (threshold 15). Drivers by points: ternaries 37 (74 pts), boolean chains 6, if/else 2 (3 pts), match/switch 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaKitPlayerAdapter._ensureDefaultTracksSelected (cognitive 83) lib/player_abstraction/media_kit_player_adapter.dart:1803— MediaKitPlayerAdapter._ensureDefaultTracksSelected has cognitive complexity 83 (threshold 15). Drivers by points: if/else 20 (51 pts), boolean chains 20, loops 3 (11 pts), error handling 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UserActivityController.loadUserActivity (cognitive 82) lib/controllers/user_activity_controller.dart:31— UserActivityController.loadUserActivity has cognitive complexity 82 (threshold 15). Drivers by points: if/else 14 (54 pts), loops 3 (12 pts), boolean chains 10, ternaries 1 (5 pts), error handling 1 (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_DanmakuContainerState._getYPosition (cognitive 81) lib/widgets/danmaku_container.dart:430— _DanmakuContainerState._getYPosition has cognitive complexity 81 (threshold 15). Drivers by points: if/else 27 (61 pts), loops 5 (14 pts), boolean chains 3, ternaries 3 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmbyService.getSubtitleTracks (cognitive 80) lib/services/emby_service.dart:1914— EmbyService.getSubtitleTracks has cognitive complexity 80 (threshold 15). Drivers by points: if/else 16 (54 pts), ternaries 3 (15 pts), loops 2 (7 pts), boolean chains 3, error handling 1 (nesting depth added 55). 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.
_NipaplayLargeScreenScaffoldLayoutState._dispatchInputCommand (cognitive 79) lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:866— _NipaplayLargeScreenScaffoldLayoutState._dispatchInputCommand has cognitive complexity 79 (threshold 15). Drivers by points: if/else 31 (49 pts), boolean chains 20, match/switch 4 (7 pts), ternaries 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.
_JellyfinQualityMenuState._applySelection (cognitive 76) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:194— _JellyfinQualityMenuState._applySelection has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (45 pts), ternaries 7 (21 pts), boolean chains 9, 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.
_BangumiCommentsWidgetState._loadComments (cognitive 74) lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:87— _BangumiCommentsWidgetState._loadComments has cognitive complexity 74 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 14, ternaries 3 (12 pts), error handling 1 (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.
_DfmPlusOverlayState._tryUpdateTexture (cognitive 73) lib/danmaku_dfm/dfm_plus_overlay.dart:667— _DfmPlusOverlayState._tryUpdateTexture has cognitive complexity 73 (threshold 15). Drivers by points: if/else 23 (39 pts), boolean chains 23, ternaries 6 (7 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NipaplayLargeScreenScaffoldLayoutState._handleInputKeyEvent (cognitive 73) lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:1072— _NipaplayLargeScreenScaffoldLayoutState._handleInputKeyEvent has cognitive complexity 73 (threshold 15). Drivers by points: if/else 25 (44 pts), ternaries 7 (14 pts), boolean chains 10, match/switch 3 (5 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_VideoPlayerUIState.build (cognitive 73) lib/themes/nipaplay/widgets/video_player_ui.dart:1151— _VideoPlayerUIState.build has cognitive complexity 73 (threshold 15). Drivers by points: if/else 24 (44 pts), ternaries 8 (16 pts), boolean chains 13 (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.
FilePickerService._copyToDocumentsIfNeeded (cognitive 72) lib/services/file_picker_service.dart:88— FilePickerService._copyToDocumentsIfNeeded has cognitive complexity 72 (threshold 15). Drivers by points: if/else 14 (57 pts), boolean chains 5, loops 1 (4 pts), error handling 2 (3 pts), ternaries 1 (3 pts) (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.
WatchHistoryDatabase._ensureWebStoreLoaded (cognitive 69) lib/models/watch_history_database.dart:334— WatchHistoryDatabase._ensureWebStoreLoaded has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (49 pts), error handling 3 (10 pts), boolean chains 6, loops 1 (4 pts) (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DandanplayService._getVideoInfoWithMetadata (cognitive 69) lib/services/dandanplay_service_stub.dart:2138— DandanplayService._getVideoInfoWithMetadata has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (41 pts), error handling 4 (18 pts), boolean chains 10 (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.
_DanmakuSettingsContentState.build (cognitive 69) lib/settings/pages/danmaku_settings_content.dart:773— _DanmakuSettingsContentState.build has cognitive complexity 69 (threshold 15). Drivers by points: if/else 28 (35 pts), ternaries 10 (16 pts), boolean chains 14, loops 2 (4 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.
_SubtitleTracksMenuState.build (cognitive 67) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:687— _SubtitleTracksMenuState.build has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 12 (24 pts), boolean chains 10 (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.
EpisodeNavigationService._getPreviousEpisodeFromJellyfin (cognitive 65) lib/services/episode_navigation_service.dart:1322— EpisodeNavigationService._getPreviousEpisodeFromJellyfin has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (47 pts), error handling 5 (15 pts), boolean chains 3 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SubtitleTracksMenuState._loadRemoteSubtitle (cognitive 65) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:283— _SubtitleTracksMenuState._loadRemoteSubtitle has cognitive complexity 65 (threshold 15). Drivers by points: if/else 24 (52 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiAddressServerService.identifyServer (cognitive 63) lib/services/multi_address_server_service.dart:371— MultiAddressServerService.identifyServer has cognitive complexity 63 (threshold 15). Drivers by points: if/else 11 (41 pts), loops 5 (18 pts), boolean chains 2, error handling 2 (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.
SubtitleManager._registerRemainingSubtitlesAfterRestore (cognitive 63) lib/utils/subtitle_manager.dart:1895— SubtitleManager._registerRemainingSubtitlesAfterRestore has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 4 (10 pts), boolean chains 4, error handling 2 (3 pts), ternaries 1 (3 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.
AutoSyncService._applyOperationsLocally (cognitive 62) lib/services/auto_sync_service.dart:851— AutoSyncService._applyOperationsLocally has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 22, loops 8 (12 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService._getVideoInfoWithMetadata (cognitive 61) lib/services/dandanplay_service_io.dart:1235— DandanplayService._getVideoInfoWithMetadata has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (32 pts), error handling 4 (18 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WebDAVService._searchBreadthFirst (cognitive 61) lib/services/webdav_service.dart:2082— WebDAVService._searchBreadthFirst has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (39 pts), boolean chains 8, ternaries 4 (8 pts), loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EpisodeNavigationService._getPreviousEpisodeFromDatabase (cognitive 60) lib/services/episode_navigation_service.dart:647— EpisodeNavigationService._getPreviousEpisodeFromDatabase has cognitive complexity 60 (threshold 15). Drivers by points: if/else 11 (31 pts), ternaries 2 (10 pts), error handling 3 (9 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (EpisodeNavigationService._getNextEpisodeFromDatabase) 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.
EpisodeNavigationService._getNextEpisodeFromDatabase (cognitive 60) lib/services/episode_navigation_service.dart:772— EpisodeNavigationService._getNextEpisodeFromDatabase has cognitive complexity 60 (threshold 15). Drivers by points: if/else 11 (31 pts), ternaries 2 (10 pts), error handling 3 (9 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (EpisodeNavigationService._getPreviousEpisodeFromDatabase) 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.
_WatchHistoryPageState._onWatchHistoryItemTap (cognitive 60) lib/themes/nipaplay/pages/settings/watch_history_page.dart:512— _WatchHistoryPageState._onWatchHistoryItemTap has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 4 (17 pts), error handling 2 (6 pts), boolean chains 5 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_LibraryManagementTabState._buildManagementItems (cognitive 60) lib/themes/nipaplay/widgets/library_management_tab.dart:2639— _LibraryManagementTabState._buildManagementItems has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 17 (49 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 35). 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.
MsdfFontAtlas._buildSegments (cognitive 59) lib/danmaku_next/msdf_font_atlas.dart:383— MsdfFontAtlas._buildSegments has cognitive complexity 59 (threshold 15). Drivers by points: if/else 12 (37 pts), loops 6 (13 pts), boolean chains 3, match/switch 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FullBackupService._restoreAccounts (cognitive 59) lib/services/full_backup_service.dart:1038— FullBackupService._restoreAccounts has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (50 pts), error handling 2 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_PlaybackInfoMenuState._getVideoInfo (cognitive 59) lib/themes/nipaplay/widgets/playback_info_menu.dart:377— _PlaybackInfoMenuState._getVideoInfo has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 13, ternaries 4 (8 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.
_DfmPlusOverlayState._runUpdateLoop (cognitive 58) lib/danmaku_dfm/dfm_plus_overlay.dart:494— _DfmPlusOverlayState._runUpdateLoop has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (49 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_JellyfinQualityMenuState._loadCurrentQuality (cognitive 58) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:49— _JellyfinQualityMenuState._loadCurrentQuality has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (32 pts), ternaries 6 (20 pts), boolean chains 5, error handling 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubtitleManager._writeExternalSubtitleSelection (cognitive 58) lib/utils/subtitle_manager.dart:483— SubtitleManager._writeExternalSubtitleSelection has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 3 (10 pts), boolean chains 5, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubtitleParser.decodeSubtitleFile (cognitive 58) lib/utils/subtitle_parser.dart:135— SubtitleParser.decodeSubtitleFile has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 6, loops 2 (5 pts), error handling 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GpuDanmakuTextRenderer.renderItem (cognitive 57) lib/danmaku_gpu/lib/gpu_danmaku_text_renderer.dart:111— GpuDanmakuTextRenderer.renderItem has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 17, loops 4 (8 pts), error handling 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AnimeDetailPageState._loadBangumiUserData (cognitive 57) lib/pages/anime_detail_page.dart:834— _AnimeDetailPageState._loadBangumiUserData has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (50 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ErikaPlayerAdapter._handleEvent (cognitive 57) lib/player_abstraction/erika_player_adapter.dart:1702— ErikaPlayerAdapter._handleEvent has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 4 (10 pts), boolean chains 8, loops 4 (8 pts), match/switch 2 (4 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.
EpisodeFileSelectionService.resolve (cognitive 56) lib/services/episode_file_selection_service.dart:76— EpisodeFileSelectionService.resolve has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 24, if/else 15 (19 pts), ternaries 6 (10 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ModernVideoControlsState.build (cognitive 56) lib/themes/nipaplay/widgets/modern_video_controls.dart:660— _ModernVideoControlsState.build has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 35 (49 pts), if/else 6, 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.
StorageService._getUniversalStorageDirectory (cognitive 56) lib/utils/storage_service.dart:171— StorageService._getUniversalStorageDirectory has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (42 pts), error handling 3 (10 pts), boolean chains 4 (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.
SharedRemoteLibraryProvider._fetchRemoteWebDAVDirectory (cognitive 55) lib/providers/shared_remote_library_provider.dart:1202— SharedRemoteLibraryProvider._fetchRemoteWebDAVDirectory has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (27 pts), ternaries 7 (19 pts), error handling 2 (4 pts), loops 1 (3 pts), boolean chains 2 (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.
ScanService._loadScannedFolders (cognitive 55) lib/services/scan_service.dart:287— ScanService._loadScannedFolders has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (44 pts), loops 2 (7 pts), boolean chains 3, error handling 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SubtitleManager._loadExternalSubtitleWithEncodingFix (cognitive 55) lib/utils/subtitle_manager.dart:1270— SubtitleManager._loadExternalSubtitleWithEncodingFix has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (53 pts), boolean chains 1, error handling 1 (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.
_AnimeDetailPageState._buildDetailContent (cognitive 54) lib/pages/anime_detail_page.dart:1585— _AnimeDetailPageState._buildDetailContent has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (33 pts), ternaries 5 (12 pts), boolean chains 9 (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.
SharedRemoteLibraryProvider.browseRemoteDirectory (cognitive 54) lib/providers/shared_remote_library_provider.dart:1061— SharedRemoteLibraryProvider.browseRemoteDirectory has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 6 (14 pts), error handling 3 (7 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoJellyfinQualityPaneState._applySelection (cognitive 54) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:154— _CupertinoJellyfinQualityPaneState._applySelection has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 7 (21 pts), boolean chains 7, 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.
_LibraryManagementTabState._buildControlBarActionsLocal (cognitive 54) lib/themes/nipaplay/widgets/library_management_tab.dart:1846— _LibraryManagementTabState._buildControlBarActionsLocal has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 11 (23 pts), match/switch 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanService.startDirectoryScan (cognitive 53) lib/services/scan_service.dart:816— ScanService.startDirectoryScan has cognitive complexity 53 (threshold 15). Drivers by points: if/else 31 (41 pts), boolean chains 8, ternaries 2 (3 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.
_SharedRemoteLanScanDialogContentState.build (cognitive 53) lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:401— _SharedRemoteLanScanDialogContentState.build has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 46 (50 pts), if/else 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.
NipaPlayNextEngine.layout (cognitive 52) lib/danmaku_next/nipaplay_next_engine.dart:219— NipaPlayNextEngine.layout has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 9, loops 2 (7 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WatchHistoryProvider._validateFilePathBatch (cognitive 52) lib/providers/watch_history_provider.dart:335— WatchHistoryProvider._validateFilePathBatch has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 9, loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WebApiService.handleUpdateHistoryProgressRequest (cognitive 52) lib/services/web_api_service.dart:751— WebApiService.handleUpdateHistoryProgressRequest has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 11 (26 pts), if/else 10 (14 pts), boolean chains 10, error handling 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebDAVProxyService._handleStreamInternal (cognitive 52) lib/services/webdav_proxy_service.dart:160— WebDAVProxyService._handleStreamInternal has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 6, error handling 3 (5 pts), ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebDAVService._legacyAttemptConnection (cognitive 52) lib/services/webdav_service.dart:1187— WebDAVService._legacyAttemptConnection has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 7, ternaries 2 (6 pts), error handling 2 (3 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState.build (cognitive 52) lib/themes/nipaplay/widgets/library_management_tab.dart:2129— _LibraryManagementTabState.build has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 9, ternaries 6 (8 pts), loops 1 (3 pts), match/switch 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.
MediaKitPlayerAdapter.attachPlatformVideoSurface (cognitive 51) lib/player_abstraction/media_kit_player_adapter.dart:3072— MediaKitPlayerAdapter.attachPlatformVideoSurface has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 7, ternaries 3 (5 pts), error handling 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoPlayerAdapter._actuallyCreateController (cognitive 51) lib/player_abstraction/video_player_adapter.dart:868— VideoPlayerAdapter._actuallyCreateController has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (36 pts), error handling 4 (10 pts), boolean chains 5 (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.
SharedRemoteLibraryProvider.refreshManagement (cognitive 51) lib/providers/shared_remote_library_provider.dart:891— SharedRemoteLibraryProvider.refreshManagement has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 3 (9 pts), ternaries 4 (8 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.
SharedRemoteLibraryProvider._fetchRemoteSMBDirectory (cognitive 51) lib/providers/shared_remote_library_provider.dart:1481— SharedRemoteLibraryProvider._fetchRemoteSMBDirectory has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 6 (17 pts), error handling 2 (4 pts), loops 1 (3 pts), boolean chains 2 (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.
_BackupRestorePageState._showFullRestoreDialog (cognitive 51) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:336— _BackupRestorePageState._showFullRestoreDialog has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 5 (20 pts), error handling 2, 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.
WatchHistoryManager.getHistoryItem (cognitive 50) lib/models/watch_history_model.dart:660— WatchHistoryManager.getHistoryItem has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 4 (12 pts), error handling 2 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmbyService.loadAvailableLibraries (cognitive 50) lib/services/emby_service.dart:476— EmbyService.loadAvailableLibraries has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 7, error handling 2 (3 pts), loops 1 (3 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_NipaplayWindowScaffoldState.build (cognitive 50) lib/themes/nipaplay/widgets/nipaplay_window.dart:248— _NipaplayWindowScaffoldState.build has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 19 (30 pts), if/else 10 (14 pts), boolean chains 6 (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.
_LibraryManagementTabState._pickAndScanDirectory (cognitive 49) lib/themes/nipaplay/widgets/library_management_tab.dart:609— _LibraryManagementTabState._pickAndScanDirectory has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 8, error handling 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._getDirectoryContents (cognitive 49) lib/themes/nipaplay/widgets/library_management_tab.dart:848— _LibraryManagementTabState._getDirectoryContents has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 2 (7 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_SubtitleListMenuState._loadSubtitles (cognitive 49) lib/themes/nipaplay/widgets/subtitle_list_menu.dart:129— _SubtitleListMenuState._loadSubtitles has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 1 (5 pts), boolean chains 4, error handling 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DandanplayService.getUserPlayHistory (cognitive 48) lib/services/dandanplay_service_stub.dart:1343— DandanplayService.getUserPlayHistory has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 1 (5 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BaseSettingsMenu.build (cognitive 48) lib/themes/nipaplay/widgets/base_settings_menu.dart:87— BaseSettingsMenu.build has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 18 (25 pts), if/else 10 (15 pts), boolean chains 8 (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.
_AnimeDetailPageState._buildImmersiveSubtitle (cognitive 47) lib/pages/anime_detail_page.dart:3288— _AnimeDetailPageState._buildImmersiveSubtitle has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 11, loops 4 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SharedRemoteLibraryViewState.build (cognitive 47) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:148— _SharedRemoteLibraryViewState.build has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (26 pts), ternaries 10 (13 pts), boolean chains 8 (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.
BangumiAnime.fromDandanplayDetail (cognitive 46) lib/models/bangumi_model.dart:149— BangumiAnime.fromDandanplayDetail has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 16, loops 2 (4 pts), ternaries 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.
_AnimeDetailPageState._syncBangumiCollection (cognitive 46) lib/pages/anime_detail_page.dart:1058— _AnimeDetailPageState._syncBangumiCollection has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (30 pts), ternaries 4 (9 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_PluginProcess.launch (cognitive 46) lib/plugins/plugin_process_manager.dart:99— _PluginProcess.launch has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 5 (10 pts), error handling 1 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_PlaylistMenuState._createJellyfinHistoryItem (cognitive 46) lib/themes/nipaplay/widgets/playlist_menu.dart:1116— _PlaylistMenuState._createJellyfinHistoryItem has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (38 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (_PlaylistMenuState._createEmbyHistoryItem) 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.
_PlaylistMenuState._createEmbyHistoryItem (cognitive 46) lib/themes/nipaplay/widgets/playlist_menu.dart:1245— _PlaylistMenuState._createEmbyHistoryItem has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (38 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (_PlaylistMenuState._createJellyfinHistoryItem) 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.
_ExternalSubtitleOverlayState._buildPathBlock (cognitive 46) lib/widgets/external_subtitle_overlay.dart:163— _ExternalSubtitleOverlayState._buildPathBlock has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 10, ternaries 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.
RemoteSubtitleService._downloadPair (cognitive 45) lib/services/remote_subtitle_service.dart:383— RemoteSubtitleService._downloadPair has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 16, 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.
SMBProxyService._handleStreamInternal (cognitive 45) lib/services/smb_proxy_service.dart:149— SMBProxyService._handleStreamInternal has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (36 pts), error handling 3 (6 pts), boolean chains 3 (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.
_DanmakuListMenuState.build (cognitive 45) lib/themes/nipaplay/widgets/danmaku_list_menu.dart:374— _DanmakuListMenuState.build has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 16, boolean chains 13 (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.
_VideoProgressBarState.build (cognitive 45) lib/themes/nipaplay/widgets/video_progress_bar.dart:230— _VideoProgressBarState.build has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 13 (19 pts), boolean chains 5 (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.
RemoteMediaFetcher._fetchHeadWithDart (cognitive 45) lib/utils/remote_media_fetcher.dart:68— RemoteMediaFetcher._fetchHeadWithDart has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 8, ternaries 2 (8 pts), error handling 3 (7 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.
_MediaServerDetailPageState._buildEpisodesListForSelectedSeason (cognitive 44) lib/pages/media_server_detail_page.dart:2111— _MediaServerDetailPageState._buildEpisodesListForSelectedSeason has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 16, if/else 14, ternaries 14. 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.
JellyfinService.getSubtitleTracks (cognitive 44) lib/services/jellyfin_service.dart:1574— JellyfinService.getSubtitleTracks has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 4 (20 pts), if/else 7 (19 pts), loops 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PlayerRemoteControlBridge._buildParameters (cognitive 44) lib/services/player_remote_control_bridge.dart:213— PlayerRemoteControlBridge._buildParameters has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (28 pts), ternaries 4 (9 pts), loops 3 (6 pts), boolean chains 1 (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.
_MediaProxyServer._serve (cognitive 44) lib/services/plugin_media_proxy.dart:144— _MediaProxyServer._serve has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (7 pts), error handling 3 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuarterlyReviewCache._load (cognitive 44) lib/services/quarterly_review_cache.dart:129— QuarterlyReviewCache._load has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 5 (14 pts), error handling 2 (4 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.
_AnimeDetailPageState._buildSummaryView (cognitive 43) lib/pages/anime_detail_page.dart:1331— _AnimeDetailPageState._buildSummaryView has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 13 (18 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.
_PluginProcess.stop (cognitive 43) lib/plugins/plugin_process_manager.dart:281— _PluginProcess.stop has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 5 (15 pts), boolean chains 4 (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.
ExternalPlayerService.play (cognitive 43) lib/services/external_player_service.dart:31— ExternalPlayerService.play has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 5, error handling 4 (5 pts), match/switch 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._showManualDanmakuMatchDialog (cognitive 43) lib/themes/nipaplay/widgets/library_management_tab.dart:4694— _LibraryManagementTabState._showManualDanmakuMatchDialog has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (35 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_DanmakuContainerState.build (cognitive 43) lib/widgets/danmaku_container.dart:812— _DanmakuContainerState.build has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 5 (15 pts), loops 2 (3 pts), boolean chains 2 (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.
WatchHistoryProvider._syncRemoteHistory (cognitive 42) lib/providers/watch_history_provider.dart:45— WatchHistoryProvider._syncRemoteHistory has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 9, loops 2 (3 pts), error handling 2, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BangumiCommentsWidgetState.build (cognitive 42) lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:287— _BangumiCommentsWidgetState.build has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 12 (14 pts), boolean chains 9 (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.
_LibraryManagementTabState._scrapeRemoteFiles (cognitive 42) lib/themes/nipaplay/widgets/library_management_tab.dart:5879— _LibraryManagementTabState._scrapeRemoteFiles has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 4 (12 pts), boolean chains 9, error handling 1 (2 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.
SubtitleManager.updateEmbeddedSubtitleTrack (cognitive 42) lib/utils/subtitle_manager.dart:2070— SubtitleManager.updateEmbeddedSubtitleTrack has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 18 (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.
MediaKitPlayerAdapter._performSubtitleSyncLogic (cognitive 41) lib/player_abstraction/media_kit_player_adapter.dart:1701— MediaKitPlayerAdapter._performSubtitleSyncLogic has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 2 (7 pts), boolean chains 4, 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.
SharedRemoteLibraryProvider._shouldBypassProxy (cognitive 41) lib/providers/shared_remote_library_provider.dart:699— SharedRemoteLibraryProvider._shouldBypassProxy has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 4, ternaries 1 (3 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.
BangumiService.getCalendar (cognitive 41) lib/services/bangumi_service.dart:222— BangumiService.getCalendar has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 4 (13 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmbyService.getLatestMediaItems (cognitive 41) lib/services/emby_service.dart:712— EmbyService.getLatestMediaItems has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (25 pts), error handling 4 (8 pts), boolean chains 6, loops 1 (2 pts) (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.
WebDAVService._shouldBypassProxy (cognitive 41) lib/services/webdav_service.dart:1798— WebDAVService._shouldBypassProxy has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 4, ternaries 1 (3 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.
RemoteMediaFetcher._shouldBypassProxy (cognitive 41) lib/utils/remote_media_fetcher.dart:433— RemoteMediaFetcher._shouldBypassProxy has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 4, ternaries 1 (3 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.
AppDelegate.didInitializeImplicitFlutterEngine (cognitive 41) ios/Runner/AppDelegate.swift:31— AppDelegate.didInitializeImplicitFlutterEngine has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (29 pts), boolean chains 7, ternaries 2 (4 pts), match/switch 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.
NativeSubtitleParser.parseBytes (cognitive 40) lib/cpp_native/bindings/subtitle_parser_io.dart:61— NativeSubtitleParser.parseBytes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 4 (11 pts), ternaries 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaKitPlayerAdapter.setMedia (cognitive 40) lib/player_abstraction/media_kit_player_adapter.dart:2272— MediaKitPlayerAdapter.setMedia has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (34 pts), error handling 2 (4 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.
DandanplayService.getBangumiOAuthLoginUrl (cognitive 40) lib/services/dandanplay_service_stub.dart:737— DandanplayService.getBangumiOAuthLoginUrl has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 7, error handling 2 (3 pts), ternaries 1 (2 pts) (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.
DandanplayService.getUserFavorites (cognitive 40) lib/services/dandanplay_service_stub.dart:1738— DandanplayService.getUserFavorites has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 1 (5 pts), error handling 2 (3 pts), boolean chains 2, ternaries 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.
WebDAVService._validateConnection (cognitive 40) lib/services/webdav_service.dart:499— WebDAVService._validateConnection has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (34 pts), error handling 2 (4 pts), boolean chains 1, loops 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.
_LibraryManagementTabState._scanWebDAVFolder (cognitive 40) lib/themes/nipaplay/widgets/library_management_tab.dart:5990— _LibraryManagementTabState._scanWebDAVFolder has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (37 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (_LibraryManagementTabState._scanSMBFolder) 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.
_LibraryManagementTabState._scanSMBFolder (cognitive 40) lib/themes/nipaplay/widgets/library_management_tab.dart:6226— _LibraryManagementTabState._scanSMBFolder has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (37 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (_LibraryManagementTabState._scanWebDAVFolder) 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.
_DfmPlusOverlayState.didUpdateWidget (cognitive 39) lib/danmaku_dfm/dfm_plus_overlay.dart:247— _DfmPlusOverlayState.didUpdateWidget has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 22, if/else 15 (17 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.
_MediaServerDetailPageState._loadMediaDetail (cognitive 39) lib/pages/media_server_detail_page.dart:288— _MediaServerDetailPageState._loadMediaDetail has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (30 pts), ternaries 2 (7 pts), boolean chains 1, error handling 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.
_MediaServerDetailPageState._playEpisode (cognitive 39) lib/pages/media_server_detail_page.dart:1870— _MediaServerDetailPageState._playEpisode has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 4 (9 pts), boolean chains 5, 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.
BangumiApiService.getSubjectCommentsFallback (cognitive 39) lib/services/bangumi_api_service.dart:909— BangumiApiService.getSubjectCommentsFallback has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (30 pts), ternaries 2 (5 pts), boolean chains 3, error handling 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_LibraryManagementTabState._buildLargeScreenManagementStatus (cognitive 39) lib/themes/nipaplay/widgets/library_management_tab.dart:3546— _LibraryManagementTabState._buildLargeScreenManagementStatus has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 4 (10 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SharedRemoteLanScanDialogContentState._startScan (cognitive 39) lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:149— _SharedRemoteLanScanDialogContentState._startScan has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 6, loops 1 (3 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.
_SubtitleListMenuState.build (cognitive 39) lib/themes/nipaplay/widgets/subtitle_list_menu.dart:580— _SubtitleListMenuState.build has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 16, if/else 9 (13 pts), 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.
_SystemResourceDisplayState.build (cognitive 39) lib/themes/nipaplay/widgets/system_resource_display.dart:196— _SystemResourceDisplayState.build has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 8 (13 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubtitleManager.setExternalSubtitle (cognitive 39) lib/utils/subtitle_manager.dart:677— SubtitleManager.setExternalSubtitle has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 8, ternaries 1 (2 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BangumiService.cleanExpiredDetailCache (cognitive 38) lib/services/bangumi_service.dart:520— BangumiService.cleanExpiredDetailCache has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (24 pts), ternaries 1 (6 pts), error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcurrentVideoProcessor._processSingleVideoPath (cognitive 38) lib/services/concurrent_video_processor.dart:119— ConcurrentVideoProcessor._processSingleVideoPath has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 3 (9 pts), boolean chains 4, error handling 2 (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.
_CupertinoSubtitleTracksPaneState.build (cognitive 38) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:337— _CupertinoSubtitleTracksPaneState.build has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 9 (14 pts), boolean chains 7 (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.
_AdaptiveMediaDetailActionButtonState.build (cognitive 38) lib/themes/nipaplay/widgets/adaptive_media_detail_action.dart:54— _AdaptiveMediaDetailActionButtonState.build has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 24 (28 pts), if/else 4 (5 pts), boolean chains 3, 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.
_CachedNetworkImageWidgetState.build (cognitive 38) lib/themes/nipaplay/widgets/cached_network_image_widget.dart:403— _CachedNetworkImageWidgetState.build has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 15, ternaries 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.
_LibraryManagementTabState._buildWebDAVFileNodes (cognitive 38) lib/themes/nipaplay/widgets/library_management_tab.dart:5412— _LibraryManagementTabState._buildWebDAVFileNodes has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 11 (16 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_LibraryManagementTabState._buildSMBFileNodes) 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.
_LibraryManagementTabState._buildSMBFileNodes (cognitive 38) lib/themes/nipaplay/widgets/library_management_tab.dart:5617— _LibraryManagementTabState._buildSMBFileNodes has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 11 (16 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_LibraryManagementTabState._buildWebDAVFileNodes) 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.
_NetworkMediaServerDialogState._handleQualityChanged (cognitive 38) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:1240— _NetworkMediaServerDialogState._handleQualityChanged has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (31 pts), error handling 3 (7 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DecoderManager.checkDecoderAfterScreenshot (cognitive 38) lib/utils/decoder_manager.dart:457— DecoderManager.checkDecoderAfterScreenshot has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 7, error handling 2 (6 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MediaSourceUtils.migrateWebDavPath (cognitive 38) lib/utils/media_source_utils.dart:259— MediaSourceUtils.migrateWebDavPath has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 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.
LibraryNewContentTracker.load (cognitive 37) lib/media_library/adaptive_media_collection_view.dart:113— LibraryNewContentTracker.load has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 6, error handling 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.
_WebDAVBrowserPageState._startSearch (cognitive 37) lib/pages/webdav_browser_page.dart:1949— _WebDAVBrowserPageState._startSearch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 10, 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.
PluginUrlResolver.resolve (cognitive 37) lib/plugins/url_resolver.dart:92— PluginUrlResolver.resolve has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DanmakuCacheManager._clearExpiredCache (cognitive 37) lib/services/danmaku_cache_manager.dart:327— DanmakuCacheManager._clearExpiredCache has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (29 pts), error handling 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EpisodeNavigationService._locateRemoteEpisode (cognitive 37) lib/services/episode_navigation_service.dart:519— EpisodeNavigationService._locateRemoteEpisode has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 5 (10 pts), boolean chains 4 (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.
LocalMediaManagementApi._handleStreamInternal (cognitive 37) lib/services/local_media_management_api.dart:746— LocalMediaManagementApi._handleStreamInternal has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 5 (18 pts), if/else 7 (14 pts), boolean chains 4, error handling 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.
LocalMediaManagementApi._handleSubtitles (cognitive 37) lib/services/local_media_management_api.dart:831— LocalMediaManagementApi._handleSubtitles has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), error handling 2 (4 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebApiService.handleImageProxyRequest (cognitive 37) lib/services/web_api_service.dart:166— WebApiService.handleImageProxyRequest has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 7, error handling 3 (4 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.
WebDAVService.resolveFileUrl (cognitive 37) lib/services/webdav_service.dart:769— WebDAVService.resolveFileUrl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoSubtitleTracksPaneState._loadRemoteSubtitleFile (cognitive 37) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:129— _CupertinoSubtitleTracksPaneState._loadRemoteSubtitleFile has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 1, 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.
_SubtitleTracksMenuState._loadExternalSubtitle (cognitive 37) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:189— _SubtitleTracksMenuState._loadExternalSubtitle has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 4, 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.
NipaPlayNextEngine._rebuildLayout (cognitive 36) lib/danmaku_next/nipaplay_next_engine.dart:678— NipaPlayNextEngine._rebuildLayout has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4, match/switch 2 (4 pts), loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NipaPlayNextOldEngine._rebuildLayout (cognitive 36) lib/danmaku_next/nipaplay_next_old_engine.dart:521— NipaPlayNextOldEngine._rebuildLayout has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4, match/switch 2 (4 pts), loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchHistoryDatabase.getHistoryByFilePath (cognitive 36) lib/models/watch_history_database.dart:838— WatchHistoryDatabase.getHistoryByFilePath has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 1 (2 pts), error handling 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MediaKitPlayerAdapter._updateMediaInfo (cognitive 36) lib/player_abstraction/media_kit_player_adapter.dart:1273— MediaKitPlayerAdapter._updateMediaInfo has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, loops 4 (7 pts), ternaries 2 (5 pts), error handling 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaKitPlayerAdapter.activeAudioTracks (cognitive 36) lib/player_abstraction/media_kit_player_adapter.dart:2089— MediaKitPlayerAdapter.activeAudioTracks has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (7 pts), boolean chains 3, 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.
BangumiService._getAnimeDetails (cognitive 36) lib/services/bangumi_service.dart:393— BangumiService._getAnimeDetails has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._buildControlBarActionsRemote (cognitive 36) lib/themes/nipaplay/widgets/library_management_tab.dart:2013— _LibraryManagementTabState._buildControlBarActionsRemote has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 5 (10 pts), boolean chains 3, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
_VideoPlayerUIState._handleKeyEvent (cognitive 36) lib/themes/nipaplay/widgets/video_player_ui.dart:196— _VideoPlayerUIState._handleKeyEvent has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 1 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioTrackManager._detectRemoteExternalAudioPath (cognitive 36) lib/utils/audio_track_manager.dart:77— AudioTrackManager._detectRemoteExternalAudioPath has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 2 (4 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.
DanmakuGroupWidget.build (cognitive 36) lib/widgets/danmaku_group_widget.dart:27— DanmakuGroupWidget.build has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 5 (12 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoPlayerAdapter.prepare (cognitive 35) lib/player_abstraction/video_player_adapter.dart:456— VideoPlayerAdapter.prepare has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 6, error handling 2 (4 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.
SharedRemoteLibraryProvider._loadPersistedHosts (cognitive 35) lib/providers/shared_remote_library_provider.dart:114— SharedRemoteLibraryProvider._loadPersistedHosts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 3, error handling 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.
DandanplayService.login (cognitive 35) lib/services/dandanplay_service_stub.dart:630— DandanplayService.login has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 2 (8 pts), error handling 2 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_MacOSWindowNativeVideoOverlaySurfaceState._sendOverlayFrame (cognitive 35) lib/widgets/macos_native_video_view.dart:397— _MacOSWindowNativeVideoOverlaySurfaceState._sendOverlayFrame has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 11, 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.
EmbyService.getServerMediaTechnicalInfo (cognitive 34) lib/services/emby_service.dart:161— EmbyService.getServerMediaTechnicalInfo has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 6, loops 1 (5 pts), error handling 2 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WebServerService.getAccessUrls (cognitive 34) lib/services/web_server_service.dart:517— WebServerService.getAccessUrls has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (2 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.
_NipaplayLargeScreenScaffoldLayoutState.build (cognitive 34) lib/themes/nipaplay/widgets/large_screen_scaffold_layout.dart:1254— _NipaplayLargeScreenScaffoldLayoutState.build has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 12, ternaries 11 (12 pts), if/else 8 (10 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.
SubtitleManager._pickTextSubtitleReplacement (cognitive 34) lib/utils/subtitle_manager.dart:1827— SubtitleManager._pickTextSubtitleReplacement has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (6 pts), boolean chains 2, ternaries 1 (2 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.
SubtitleParser.parseSubtitleFile (cognitive 34) lib/utils/subtitle_parser.dart:779— SubtitleParser.parseSubtitleFile has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (27 pts), error handling 2 (4 pts), match/switch 1 (2 pts), boolean chains 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.
DfmPlusLayoutBridge.configure (cognitive 33) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:57— DfmPlusLayoutBridge.configure has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (10 pts), loops 4 (6 pts), ternaries 2 (4 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.
JellyfinService.getServerMediaTechnicalInfo (cognitive 33) lib/services/jellyfin_service.dart:144— JellyfinService.getServerMediaTechnicalInfo has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 5, loops 1 (5 pts), error handling 2 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LocalMediaManagementApi._scrapeRemoteFiles (cognitive 33) lib/services/local_media_management_api.dart:519— LocalMediaManagementApi._scrapeRemoteFiles has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 6 (18 pts), boolean chains 6, if/else 2 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._collectMountedVideoPaths (cognitive 33) lib/themes/nipaplay/widgets/library_management_tab.dart:3281— _LibraryManagementTabState._collectMountedVideoPaths has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (6 pts), ternaries 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 18). 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.
_AdaptiveMediaLibraryPageState._playHistoryItem (cognitive 32) lib/media_library/adaptive_media_library_page.dart:465— _AdaptiveMediaLibraryPageState._playHistoryItem has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 3 (10 pts), boolean chains 5, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BangumiAnime.fromJson (cognitive 32) lib/models/bangumi_model.dart:306— BangumiAnime.fromJson has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 13, loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_AnimeDetailPageState._fetchAnimeDetails (cognitive 32) lib/pages/anime_detail_page.dart:636— _AnimeDetailPageState._fetchAnimeDetails has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), error handling 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AnimeDetailPageState._syncBangumiEpisodeProgress (cognitive 32) lib/pages/anime_detail_page.dart:1148— _AnimeDetailPageState._syncBangumiEpisodeProgress has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaKitPlayerAdapter._addEventListeners (cognitive 32) lib/player_abstraction/media_kit_player_adapter.dart:1002— MediaKitPlayerAdapter._addEventListeners has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 9, ternaries 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
MediaKitPlayerAdapter.activeSubtitleTracks (cognitive 32) lib/player_abstraction/media_kit_player_adapter.dart:2011— MediaKitPlayerAdapter.activeSubtitleTracks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (6 pts), error handling 2 (4 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.
DandanplayService.getEpisodesWatchStatus (cognitive 32) lib/services/dandanplay_service_io.dart:2334— DandanplayService.getEpisodesWatchStatus has cognitive complexity 32 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 4 (13 pts), boolean chains 4, 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.
RemoteSubtitleService._tryResolveWebDavFromUrl (cognitive 32) lib/services/remote_subtitle_service.dart:1601— RemoteSubtitleService._tryResolveWebDavFromUrl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, loops 2 (3 pts), ternaries 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.
SearchService.searchAnimeAdvanced (cognitive 32) lib/services/search_service.dart:163— SearchService.searchAnimeAdvanced has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (27 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebDAVService._legacyTestConnection (cognitive 32) lib/services/webdav_service.dart:1104— WebDAVService._legacyTestConnection has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1, 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.
_LibraryManagementTabState._loadMountedDirectory (cognitive 32) lib/themes/nipaplay/widgets/library_management_tab.dart:3052— _LibraryManagementTabState._loadMountedDirectory has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 5 (9 pts), boolean chains 6, match/switch 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.
_MediaCaptureDialogContentState._buildImageTab (cognitive 32) lib/themes/nipaplay/widgets/media_capture_dialog.dart:559— _MediaCaptureDialogContentState._buildImageTab has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 12 (13 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.
_SharedRemoteLanScanDialogContentState._discoverByUdp (cognitive 32) lib/themes/nipaplay/widgets/shared_remote_lan_scan_dialog.dart:245— _SharedRemoteLanScanDialogContentState._discoverByUdp has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 3 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DecoderManager.updateCurrentActiveDecoder (cognitive 32) lib/utils/decoder_manager.dart:360— DecoderManager.updateCurrentActiveDecoder has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 6, error handling 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
StorageService.isValidStorageDirectory (cognitive 32) lib/utils/storage_service.dart:69— StorageService.isValidStorageDirectory has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (20 pts), error handling 4 (11 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.
SubtitleParser._normalizeEncodingName (cognitive 32) lib/utils/subtitle_parser.dart:943— SubtitleParser._normalizeEncodingName has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17, boolean chains 15. 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.
AdaptiveMediaActionButton.build (cognitive 31) lib/media_library/adaptive_media_library_primitives.dart:48— AdaptiveMediaActionButton.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 12 (22 pts), if/else 6 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AdaptiveMediaTextFieldState.build (cognitive 31) lib/media_library/adaptive_media_library_primitives.dart:756— _AdaptiveMediaTextFieldState.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 17 (26 pts), if/else 3, 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.
_WebDAVBrowserPageState._loadDirectory (cognitive 31) lib/pages/webdav_browser_page.dart:122— _WebDAVBrowserPageState._loadDirectory has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 11, ternaries 1 (4 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.
_WebDAVBrowserPageState._buildFileItem (cognitive 31) lib/pages/webdav_browser_page.dart:1385— _WebDAVBrowserPageState._buildFileItem has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, ternaries 4, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedRemoteLibraryProvider.testWebDAVConnection (cognitive 31) lib/providers/shared_remote_library_provider.dart:1306— SharedRemoteLibraryProvider.testWebDAVConnection has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (7 pts), boolean chains 4, error handling 2 (4 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.
SharedRemoteLibraryProvider.scanRemoteWebDAVFolder (cognitive 31) lib/providers/shared_remote_library_provider.dart:1378— SharedRemoteLibraryProvider.scanRemoteWebDAVFolder has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (11 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. This shape REPEATS in the file: one other method here (SharedRemoteLibraryProvider.scanRemoteSMBFolder) 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.
SharedRemoteLibraryProvider.scanRemoteSMBFolder (cognitive 31) lib/providers/shared_remote_library_provider.dart:1631— SharedRemoteLibraryProvider.scanRemoteSMBFolder has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (11 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. This shape REPEATS in the file: one other method here (SharedRemoteLibraryProvider.scanRemoteWebDAVFolder) 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.
BangumiSyncService.syncWatchHistoryToBangumi (cognitive 31) lib/services/bangumi_sync_service.dart:497— BangumiSyncService.syncWatchHistoryToBangumi has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 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.
_CupertinoMainPageState.build (cognitive 31) lib/themes/cupertino/pages/cupertino_main_page.dart:331— _CupertinoMainPageState.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 7 (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.
_CupertinoJellyfinQualityPaneState.build (cognitive 31) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:262— _CupertinoJellyfinQualityPaneState.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (22 pts), if/else 4 (6 pts), loops 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BlurButtonState._buildButtonBody (cognitive 31) lib/themes/nipaplay/widgets/blur_button.dart:107— _BlurButtonState._buildButtonBody has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 17 (18 pts), boolean chains 8, if/else 4 (5 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_HoverTooltipBubbleState._calculateOverlayOffset (cognitive 31) lib/themes/nipaplay/widgets/hover_tooltip_bubble.dart:253— _HoverTooltipBubbleState._calculateOverlayOffset has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_PlaylistMenuState._loadFileSystemData (cognitive 31) lib/themes/nipaplay/widgets/playlist_menu.dart:74— _PlaylistMenuState._loadFileSystemData has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 1, 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.
VideoPlayerState._parseSeekStepFrameRateValue (cognitive 31) lib/utils/video_player_state.dart:1431— VideoPlayerState._parseSeekStepFrameRateValue has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 8 (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.
WatchHistoryAutoMatchHelper.tryAutoMatch (cognitive 31) lib/utils/watch_history_auto_match_helper.dart:36— WatchHistoryAutoMatchHelper.tryAutoMatch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (9 pts), boolean chains 5, error handling 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.
generate_tvos_icons.generate (cognitive 31) tool/generate_tvos_icons.py:12— generate_tvos_icons.generate has cognitive complexity 31 (threshold 15). Drivers by points: loops 7 (12 pts), ternaries 3 (12 pts), if/else 2 (7 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.
_ErikaOhosSmokeAppState._run (cognitive 30) tool/ohos_erika_smoke.dart:65— _ErikaOhosSmokeAppState._run has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 4 (7 pts), ternaries 2 (4 pts), loops 1 (3 pts), error handling 1 (nesting depth added 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.
DfmPlusLayoutBridge.layout (cognitive 30) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:234— DfmPlusLayoutBridge.layout has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 4 (7 pts), boolean chains 3, 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.
VideoPlayerAdapter._playDirectly (cognitive 30) lib/player_abstraction/video_player_adapter.dart:1006— VideoPlayerAdapter._playDirectly has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 4 (9 pts), boolean chains 6, loops 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.
CertificateTrustService._isLanHost (cognitive 30) lib/services/certificate_trust_service.dart:131— CertificateTrustService._isLanHost has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.getBangumiByTmdbId (cognitive 30) lib/services/dandanplay_service_io.dart:2207— DandanplayService.getBangumiByTmdbId has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, ternaries 1 (3 pts), error handling 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.refreshLinkedBangumiStatus (cognitive 30) lib/services/dandanplay_service_stub.dart:833— DandanplayService.refreshLinkedBangumiStatus has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, error handling 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.
WebDavIncrementalSyncTransport._propfind (cognitive 30) lib/services/incremental_sync_transport.dart:200— WebDavIncrementalSyncTransport._propfind has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (25 pts), error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JellyfinService.getMediaInfo (cognitive 30) lib/services/jellyfin_service.dart:879— JellyfinService.getMediaInfo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 9, 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.
ServerHistorySyncService._processResumeItems (cognitive 30) lib/services/server_history_sync_service.dart:162— ServerHistorySyncService._processResumeItems has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (25 pts), error handling 1 (3 pts), boolean chains 1, 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.
_SubtitleTracksMenuState._loadExternalSubtitles (cognitive 30) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:73— _SubtitleTracksMenuState._loadExternalSubtitles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (4 pts), boolean chains 2, 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.
_WebDAVFormState._testConnection (cognitive 30) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:370— _WebDAVFormState._testConnection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 3 (8 pts), error handling 2 (4 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.
SubtitleManager._activateMdkExternalSubtitleTrack (cognitive 30) lib/utils/subtitle_manager.dart:1199— SubtitleManager._activateMdkExternalSubtitleTrack has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustLibNipaplayPlugin.initSurface (cognitive 30) rust_builder/android/src/main/java/com/flutter_rust_bridge/rust_lib_nipaplay/RustLibNipaplayPlugin.java:176— RustLibNipaplayPlugin.initSurface has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5 (9 pts), ternaries 2 (6 pts), boolean chains 3, 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.
DandanplayService.register (cognitive 29) lib/services/dandanplay_service_io.dart:969— DandanplayService.register has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EpisodeNavigationService._createEmbyHistoryItem (cognitive 29) lib/services/episode_navigation_service.dart:2114— EpisodeNavigationService._createEmbyHistoryItem has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (20 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (2 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.
IncrementalSyncCodec.inflateState (cognitive 29) lib/services/incremental_sync_repository.dart:258— IncrementalSyncCodec.inflateState has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuarterlyReviewCache.reserveCollectionProbe (cognitive 29) lib/services/quarterly_review_cache.dart:482— QuarterlyReviewCache.reserveCollectionProbe has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteSubtitleService._listSharedRemoteFontCandidates (cognitive 29) lib/services/remote_subtitle_service.dart:1271— RemoteSubtitleService._listSharedRemoteFontCandidates has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 2 (4 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteTextInputApiService._handlePost (cognitive 29) lib/services/remote_text_input_service.dart:489— RemoteTextInputApiService._handlePost has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (4 pts), boolean chains 3, 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.
_BackupRestorePageState._showFullBackupDialog (cognitive 29) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:207— _BackupRestorePageState._showFullBackupDialog has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 7 (8 pts), boolean chains 4, 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.
NipaplayAnimeDetailLayout.build (cognitive 29) lib/themes/nipaplay/widgets/anime_detail_shell.dart:40— NipaplayAnimeDetailLayout.build has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 7, if/else 6 (7 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.
_LibraryManagementTabState._buildAdaptiveManagementView (cognitive 29) lib/themes/nipaplay/widgets/library_management_tab.dart:2413— _LibraryManagementTabState._buildAdaptiveManagementView has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 15 (22 pts), if/else 4, 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.
SettingsItem._buildLargeScreen (cognitive 29) lib/themes/nipaplay/widgets/settings_item.dart:469— SettingsItem._buildLargeScreen has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
_MdkOhosSmokeAppState._run (cognitive 28) tool/ohos_mdk_smoke.dart:42— _MdkOhosSmokeAppState._run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 10, ternaries 3 (6 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.
_AnimeDetailPageState._handleBangumiCollectionSubmitted (cognitive 28) lib/pages/anime_detail_page.dart:3792— _AnimeDetailPageState._handleBangumiCollectionSubmitted has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginService._importPluginFromContent (cognitive 28) lib/plugins/plugin_service.dart:1388— PluginService._importPluginFromContent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedRemoteLibraryProvider._refreshLibraryForHost (cognitive 28) lib/providers/shared_remote_library_provider.dart:316— SharedRemoteLibraryProvider._refreshLibraryForHost has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 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.
AutoSyncService._synchronizeRepository (cognitive 28) lib/services/auto_sync_service.dart:251— AutoSyncService._synchronizeRepository has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5, loops 4, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DandanplayService.getEpisodesWatchStatus (cognitive 28) lib/services/dandanplay_service_stub.dart:1689— DandanplayService.getEpisodesWatchStatus has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (12 pts), boolean chains 3, 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.
JellyfinDandanplayMatcher._getAnimeEpisodes (cognitive 28) lib/services/jellyfin_dandanplay_matcher.dart:816— JellyfinDandanplayMatcher._getAnimeEpisodes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JellyfinService.getLatestMediaItems (cognitive 28) lib/services/jellyfin_service.dart:596— JellyfinService.getLatestMediaItems has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaybackSourceService._resolve (cognitive 28) lib/services/playback_source_service.dart:50— PlaybackSourceService._resolve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 2, 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.
RemoteSubtitleService._listSharedRemoteAudioCandidates (cognitive 28) lib/services/remote_subtitle_service.dart:1153— RemoteSubtitleService._listSharedRemoteAudioCandidates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 2 (4 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkMediaServerDialogState._handleTranscodeEnabledChanged (cognitive 28) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:1194— _NetworkMediaServerDialogState._handleTranscodeEnabledChanged has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 3 (7 pts), ternaries 1 (4 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.
_SharedRemoteLibraryViewState._appendUnifiedRemoteEntries (cognitive 28) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1735— _SharedRemoteLibraryViewState._appendUnifiedRemoteEntries has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 4 (7 pts), boolean chains 2, 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.
_WebDAVFormState._saveConnection (cognitive 28) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:442— _WebDAVFormState._saveConnection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 2 (7 pts), 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.
NetworkChecker.checkConnection (cognitive 28) lib/utils/network_checker.dart:6— NetworkChecker.checkConnection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 3, loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Next2EmojiPipeline.buildPayload (cognitive 27) lib/danmaku_next/next2_emoji_pipeline.dart:90— Next2EmojiPipeline.buildPayload has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchHistoryDatabase.migrateFromJson (cognitive 27) lib/models/watch_history_database.dart:196— WatchHistoryDatabase.migrateFromJson has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (5 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NewSeriesPageState._loadAnimes (cognitive 27) lib/pages/new_series_page.dart:100— _NewSeriesPageState._loadAnimes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 2 (4 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.
_PlayVideoPageState._captureScreenshot (cognitive 27) lib/pages/play_video_page.dart:383— _PlayVideoPageState._captureScreenshot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaKitPlayerAdapter._handleActiveSubtitleTrackDataChange (cognitive 27) lib/player_abstraction/media_kit_player_adapter.dart:1640— MediaKitPlayerAdapter._handleActiveSubtitleTrackDataChange has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaKitPlayerAdapter._onTick (cognitive 27) lib/player_abstraction/media_kit_player_adapter.dart:3480— MediaKitPlayerAdapter._onTick has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (10 pts), boolean chains 5 (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.
AniSkipService._requestSkipTimes (cognitive 27) lib/services/intro_skip/aniskip_service.dart:124— AniSkipService._requestSkipTimes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, 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.
SearchService.getSearchConfig (cognitive 27) lib/services/search_service.dart:20— SearchService.getSearchConfig has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 3 (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.
_AppearanceSettingsContentState._pickImageFromGalleryForBackground (cognitive 27) lib/settings/pages/appearance_settings_content.dart:859— _AppearanceSettingsContentState._pickImageFromGalleryForBackground has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_DanmakuSettingsMenuState._applyDanmakuFontFromLibrary (cognitive 27) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:299— _DanmakuSettingsMenuState._applyDanmakuFontFromLibrary has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (23 pts), 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.
HorizontalAnimeCard.build (cognitive 27) lib/themes/nipaplay/widgets/horizontal_anime_card.dart:138— HorizontalAnimeCard.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 5, 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.
_LoadingOverlayState.build (cognitive 27) lib/themes/nipaplay/widgets/loading_overlay.dart:110— _LoadingOverlayState.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 18 (21 pts), boolean chains 4, if/else 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
SubtitleManager._lookupPersistedDisplayName (cognitive 27) lib/utils/subtitle_manager.dart:579— SubtitleManager._lookupPersistedDisplayName has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 1 (4 pts), boolean chains 3, error handling 2 (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.
WatchHistoryDatabase.mergeWatchHistoryBatch (cognitive 26) lib/models/watch_history_database.dart:490— WatchHistoryDatabase.mergeWatchHistoryBatch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, 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.
_AnimeDetailPageState._showEpisodeListCleanupDialog (cognitive 26) lib/pages/anime_detail_page.dart:3617— _AnimeDetailPageState._showEpisodeListCleanupDialog has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (9 pts), boolean chains 1, error handling 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_NipaplayErikaWindowOverlayVideoViewState._sendOverlayFrame (cognitive 26) lib/player_abstraction/erika_player_adapter.dart:436— _NipaplayErikaWindowOverlayVideoViewState._sendOverlayFrame has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, 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.
MediaKitPlayerAdapter._requestWindowsNativeVideoHandlesWithRetry (cognitive 26) lib/player_abstraction/media_kit_player_adapter.dart:669— MediaKitPlayerAdapter._requestWindowsNativeVideoHandlesWithRetry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.getBangumiOAuthLoginUrl (cognitive 26) lib/services/dandanplay_service_io.dart:822— DandanplayService.getBangumiOAuthLoginUrl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DandanplayService.getDanmaku (cognitive 26) lib/services/dandanplay_service_io.dart:1608— DandanplayService.getDanmaku has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 3 (7 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.addFavorite (cognitive 26) lib/services/dandanplay_service_stub.dart:1831— DandanplayService.addFavorite has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilePickerService.pickExternalPlayerExecutable (cognitive 26) lib/services/file_picker_service.dart:567— FilePickerService.pickExternalPlayerExecutable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilePickerService.pickDirectory (cognitive 26) lib/services/file_picker_service.dart:656— FilePickerService.pickDirectory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EpisodeNumberExtractor.extract (cognitive 26) lib/services/intro_skip/episode_number_extractor.dart:31— EpisodeNumberExtractor.extract has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7 (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.
JellyfinService.loadAvailableLibraries (cognitive 26) lib/services/jellyfin_service.dart:387— JellyfinService.loadAvailableLibraries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 3, loops 1 (3 pts), 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.
MediaServerServiceBase.connect (cognitive 26) lib/services/media_server_service_base.dart:300— MediaServerServiceBase.connect has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaServerServiceBase._makeAuthenticatedRequestWithRetry (cognitive 26) lib/services/media_server_service_base.dart:528— MediaServerServiceBase._makeAuthenticatedRequestWithRetry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 2 (4 pts), boolean chains 1, 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.
MediaServerWatchHistorySync.refresh (cognitive 26) lib/services/media_server_watch_history_sync.dart:169— MediaServerWatchHistorySync.refresh has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TorrentSessionStorage.prepare (cognitive 26) lib/services/torrent_session_storage.dart:9— TorrentSessionStorage.prepare has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), ternaries 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoDanmakuSettingsPaneState.build (cognitive 26) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:304— _CupertinoDanmakuSettingsPaneState.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 8 (10 pts), match/switch 1 (2 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.
_CustomScaffoldState.build (cognitive 26) lib/themes/nipaplay/widgets/custom_scaffold.dart:136— _CustomScaffoldState.build has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, ternaries 10, 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.
_DanmakuSettingsMenuState.build (cognitive 26) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1121— _DanmakuSettingsMenuState.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, ternaries 4, error handling 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.
_LibraryManagementTabState._sortContents (cognitive 26) lib/themes/nipaplay/widgets/library_management_tab.dart:912— _LibraryManagementTabState._sortContents has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (12 pts), error handling 4 (8 pts), if/else 3, boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._showBatchDanmakuMatchDialog (cognitive 26) lib/themes/nipaplay/widgets/library_management_tab.dart:4395— _LibraryManagementTabState._showBatchDanmakuMatchDialog has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_WebRemoteAccessGateState._autoMountSharedLibraries (cognitive 26) lib/themes/nipaplay/widgets/web_remote_access_gate.dart:32— _WebRemoteAccessGateState._autoMountSharedLibraries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, 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.
MacOSStorageMigration._hasDataToMigrate (cognitive 26) lib/utils/macos_storage_migration.dart:45— MacOSStorageMigration._hasDataToMigrate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 1 (2 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteMediaFetcher._parseContentDispositionFileName (cognitive 26) lib/utils/remote_media_fetcher.dart:339— RemoteMediaFetcher._parseContentDispositionFileName has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (3 pts), loops 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.
SubtitleParser._scoreDecodedText (cognitive 26) lib/utils/subtitle_parser.dart:613— SubtitleParser._scoreDecodedText has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SingleDanmakuState._calculatePosition (cognitive 26) lib/widgets/single_danmaku.dart:81— _SingleDanmakuState._calculatePosition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nipaplay_dandanplay_gateway::proxy (cognitive 26) server/dandanplay-gateway/src/main.rs:250— nipaplay_dandanplay_gateway::proxy has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 5 (6 pts), boolean chains 4, loops 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, 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.
_NipaPlayNext2OverlayState._tryUpdateTexture (cognitive 25) lib/danmaku_next/nipaplay_next2_overlay.dart:234— _NipaPlayNext2OverlayState._tryUpdateTexture has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, ternaries 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.
WatchHistoryManager.addOrUpdateHistory (cognitive 25) lib/models/watch_history_model.dart:555— WatchHistoryManager.addOrUpdateHistory has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), error handling 2 (3 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.
_MediaServerDetailPageState._loadEpisodesForSeason (cognitive 25) lib/pages/media_server_detail_page.dart:379— _MediaServerDetailPageState._loadEpisodesForSeason has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (23 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.
_PlayVideoPageState._shareCurrentMedia (cognitive 25) lib/pages/play_video_page.dart:330— _PlayVideoPageState._shareCurrentMedia has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SharedRemoteLibraryProvider.addRemoteFolder (cognitive 25) lib/providers/shared_remote_library_provider.dart:1731— SharedRemoteLibraryProvider.addRemoteFolder has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 2 (4 pts), loops 1 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchHistoryProvider.loadHistory (cognitive 25) lib/providers/watch_history_provider.dart:214— WatchHistoryProvider.loadHistory 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.
DandanplayHttpClient.send (cognitive 25) lib/services/dandanplay_http_client.dart:59— DandanplayHttpClient.send has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 10 (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.
DanmakuSpoilerFilterService.detectSpoilerDanmakuTexts (cognitive 25) lib/services/danmaku_spoiler_filter_service.dart:17— DanmakuSpoilerFilterService.detectSpoilerDanmakuTexts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmbyService._buildPlaybackSessionFromResponse (cognitive 25) lib/services/emby_service.dart:1333— EmbyService._buildPlaybackSessionFromResponse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, loops 2 (4 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.
EpisodeNavigationService._createJellyfinHistoryItem (cognitive 25) lib/services/episode_navigation_service.dart:1670— EpisodeNavigationService._createJellyfinHistoryItem has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (18 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FullBackupService._collectPreferences (cognitive 25) lib/services/full_backup_service.dart:150— FullBackupService._collectPreferences has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 22, if/else 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FullBackupService.importBackup (cognitive 25) lib/services/full_backup_service.dart:494— FullBackupService.importBackup has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (6 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.
JellyfinService.createPlaybackSession (cognitive 25) lib/services/jellyfin_service.dart:1083— JellyfinService.createPlaybackSession has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, ternaries 4 (6 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.
JellyfinService._buildPlaybackSessionFromResponse (cognitive 25) lib/services/jellyfin_service.dart:1208— JellyfinService._buildPlaybackSessionFromResponse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, loops 2 (4 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.
RemoteSubtitleService._listManagedLibraryCandidates (cognitive 25) lib/services/remote_subtitle_service.dart:927— RemoteSubtitleService._listManagedLibraryCandidates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 2 (4 pts), error handling 2, 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.
SMBProxyService._parseRangeHeader (cognitive 25) lib/services/smb_proxy_service.dart:413— SMBProxyService._parseRangeHeader has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 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.
WebServerService.startServer (cognitive 25) lib/services/web_server_service.dart:359— WebServerService.startServer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 3 (7 pts), ternaries 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.
WebServerService._accessUrlSortWeight (cognitive 25) lib/services/web_server_service.dart:471— WebServerService._accessUrlSortWeight has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (12 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_UnifiedRemoteAccessSettingsContentState._scanQrAndConnect (cognitive 25) lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:94— _UnifiedRemoteAccessSettingsContentState._scanQrAndConnect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoDanmakuListPaneState.build (cognitive 25) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:228— _CupertinoDanmakuListPaneState.build has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 6 (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.
_CupertinoSubtitleTracksPaneState._loadExternalSubtitleFile (cognitive 25) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_tracks_pane.dart:61— _CupertinoSubtitleTracksPaneState._loadExternalSubtitleFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 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.
_MediaCaptureDialogContentState._exportFile (cognitive 25) lib/themes/nipaplay/widgets/media_capture_dialog.dart:390— _MediaCaptureDialogContentState._exportFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 5, 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.
_VideoPlayerUIState._shareCurrentMedia (cognitive 25) lib/themes/nipaplay/widgets/video_player_ui.dart:889— _VideoPlayerUIState._shareCurrentMedia has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ImageCacheManager.clearCache (cognitive 25) lib/utils/image_cache_manager.dart:585— ImageCacheManager.clearCache has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 3 (9 pts), loops 1 (2 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.
PlayerKernelManager.performPlayerKernelHotSwapSteps (cognitive 25) lib/utils/player_kernel_manager.dart:117— PlayerKernelManager.performPlayerKernelHotSwapSteps has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (24 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.
_DanmakuContainerState._resize (cognitive 25) lib/widgets/danmaku_container.dart:306— _DanmakuContainerState._resize has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 5 (11 pts), loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MacOSNativeVideoPlugin.handle (cognitive 25) macos/Runner/MainFlutterWindow.swift:650— MacOSNativeVideoPlugin.handle has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
_ReopenSmokeState._run (cognitive 24) tool/ohos_mdk_reopen_smoke.dart:49— _ReopenSmokeState._run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 1 (2 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.
NipaPlayNextEngine._prepareMergedDanmakuList (cognitive 24) lib/danmaku_next/nipaplay_next_engine.dart:919— NipaPlayNextEngine._prepareMergedDanmakuList has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NipaPlayNextOldEngine._prepareMergedDanmakuList (cognitive 24) lib/danmaku_next/nipaplay_next_old_engine.dart:762— NipaPlayNextOldEngine._prepareMergedDanmakuList has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ShortcutsSettingsPageState._handleKeyPress (cognitive 24) lib/pages/shortcuts_settings_page.dart:314— _ShortcutsSettingsPageState._handleKeyPress has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 10, 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.
_TorrentDownloadPageState._playTask (cognitive 24) lib/pages/torrent_download_page.dart:537— _TorrentDownloadPageState._playTask has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ErikaPlayerAdapter._flushDanmakuConfig (cognitive 24) lib/player_abstraction/erika_player_adapter.dart:1539— ErikaPlayerAdapter._flushDanmakuConfig has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (6 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.
MediaKitPlayerAdapter._openMainMedia (cognitive 24) lib/player_abstraction/media_kit_player_adapter.dart:2394— MediaKitPlayerAdapter._openMainMedia has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, error handling 2 (4 pts), ternaries 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.
BangumiApiService._makeRequest (cognitive 24) lib/services/bangumi_api_service.dart:312— BangumiApiService._makeRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 2 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.addPlayHistory (cognitive 24) lib/services/dandanplay_service_stub.dart:1450— DandanplayService.addPlayHistory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 2 (3 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.
EmbyService._addTranscodeParameters (cognitive 24) lib/services/emby_service.dart:1563— EmbyService._addTranscodeParameters has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JellyfinService._addTranscodeParameters (cognitive 24) lib/services/jellyfin_service.dart:1426— JellyfinService._addTranscodeParameters has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalMediaShareService.buildExternalAudioResponse (cognitive 24) lib/services/local_media_share_service.dart:781— LocalMediaShareService.buildExternalAudioResponse has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 5 (8 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteSubtitleService.ensureFontCached (cognitive 24) lib/services/remote_subtitle_service.dart:759— RemoteSubtitleService.ensureFontCached has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemProxyService._parseMacOSProxyOutput (cognitive 24) lib/services/system_proxy_service.dart:223— SystemProxyService._parseMacOSProxyOutput has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, 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.
WebApiService.handleGetLocalMediaItemsRequest (cognitive 24) lib/services/web_api_service.dart:958— WebApiService.handleGetLocalMediaItemsRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_StorageSettingsContentState.build (cognitive 24) lib/settings/pages/storage_settings_content.dart:38— _StorageSettingsContentState.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 6 (8 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CupertinoAudioTracksPane._buildServerTrackTile (cognitive 24) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:191— CupertinoAudioTracksPane._buildServerTrackTile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (9 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.
_CupertinoSubtitleListPaneState._loadSubtitles (cognitive 24) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:91— _CupertinoSubtitleListPaneState._loadSubtitles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BlurDropdownState._openDropdown (cognitive 24) lib/themes/nipaplay/widgets/blur_dropdown.dart:487— _BlurDropdownState._openDropdown has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 12, if/else 7 (8 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_NipaplayLargeScreenAnimeDetailPageState._buildEpisodeCard (cognitive 24) lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:1076— _NipaplayLargeScreenAnimeDetailPageState._buildEpisodeCard has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (13 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, 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.
_LocalLibraryControlBarState.build (cognitive 24) lib/themes/nipaplay/widgets/local_library_control_bar.dart:107— _LocalLibraryControlBarState.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 8 (9 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.
_WebDAVFormState.build (cognitive 24) lib/themes/nipaplay/widgets/webdav_connection_dialog.dart:82— _WebDAVFormState.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 13, if/else 6, boolean chains 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.
MediaSourceUtils._matchesRemoteWebDavConnection (cognitive 24) lib/utils/media_source_utils.dart:116— MediaSourceUtils._matchesRemoteWebDavConnection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_DanmakuContainerState._getCachedGroupedDanmaku (cognitive 24) lib/widgets/danmaku_container.dart:979— _DanmakuContainerState._getCachedGroupedDanmaku has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 5, loops 1 (2 pts) (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.
MainPageState._handleThemeToggleFromButton (cognitive 23) lib/main.dart:1842— MainPageState._handleThemeToggleFromButton has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (6 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.
_AnimeDetailPageState.updateEpisodeWatchStatus (cognitive 23) lib/pages/anime_detail_page.dart:1230— _AnimeDetailPageState.updateEpisodeWatchStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (4 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_WebDAVBrowserPageState.build (cognitive 23) lib/pages/webdav_browser_page.dart:483— _WebDAVBrowserPageState.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 7, 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.
PluginService._reloadPlugins (cognitive 23) lib/plugins/plugin_service.dart:846— PluginService._reloadPlugins has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (6 pts), error handling 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedRemoteLibraryProvider.testSMBConnection (cognitive 23) lib/providers/shared_remote_library_provider.dart:1574— SharedRemoteLibraryProvider.testSMBConnection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedRemoteLibraryProvider.removeRemoteFolder (cognitive 23) lib/providers/shared_remote_library_provider.dart:1817— SharedRemoteLibraryProvider.removeRemoteFolder has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (4 pts), loops 1 (3 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.
BangumiApiService._syncLoginStatusFromServer (cognitive 23) lib/services/bangumi_api_service.dart:118— BangumiApiService._syncLoginStatusFromServer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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.
DandanplayService._renewNow (cognitive 23) lib/services/dandanplay_service_io.dart:357— DandanplayService._renewNow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DandanplayService.getCachedVideoInfo (cognitive 23) lib/services/dandanplay_service_stub.dart:335— DandanplayService.getCachedVideoInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (22 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.
DandanplayService._fetchBangumiDetailsFromApi (cognitive 23) lib/services/dandanplay_service_stub.dart:1606— DandanplayService._fetchBangumiDetailsFromApi has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (3 pts), boolean chains 2 (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.
EmbyService.downloadSubtitleFile (cognitive 23) lib/services/emby_service.dart:2019— EmbyService.downloadSubtitleFile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1 (3 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.
FilePickerService.pickVideoFile (cognitive 23) lib/services/file_picker_service.dart:258— FilePickerService.pickVideoFile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (4 pts), boolean chains 3, ternaries 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.
DanmakuIntroDetector.detect (cognitive 23) lib/services/intro_skip/danmaku_intro_detector.dart:147— DanmakuIntroDetector.detect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalMediaManagementApi._handleBrowse (cognitive 23) lib/services/local_media_management_api.dart:682— LocalMediaManagementApi._handleBrowse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (3 pts), loops 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.
LocalMediaShareService.buildStreamResponse (cognitive 23) lib/services/local_media_share_service.dart:409— LocalMediaShareService.buildStreamResponse has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 4 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalMediaShareService._collectFontFiles (cognitive 23) lib/services/local_media_share_service.dart:732— LocalMediaShareService._collectFontFiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 1 (3 pts), boolean chains 2, 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.
PlaybackSourceService._resolveDandanplayRemote (cognitive 23) lib/services/playback_source_service.dart:371— PlaybackSourceService._resolveDandanplayRemote has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 5 (7 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchService.searchAnimeByTags (cognitive 23) lib/services/search_service.dart:99— SearchService.searchAnimeByTags has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemProxyService._loadWindowsProxySettings (cognitive 23) lib/services/system_proxy_service.dart:125— SystemProxyService._loadWindowsProxySettings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BlurDropdownState.build (cognitive 23) lib/themes/nipaplay/widgets/blur_dropdown.dart:213— _BlurDropdownState.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9, boolean chains 7, ternaries 7. 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.
_LibraryManagementTabState._buildFileSystemNodes (cognitive 23) lib/themes/nipaplay/widgets/library_management_tab.dart:1093— _LibraryManagementTabState._buildFileSystemNodes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4 (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.
_ManualDanmakuMatchDialogState._loadAnimeEpisodes (cognitive 23) lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:173— _ManualDanmakuMatchDialogState._loadAnimeEpisodes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (4 pts), loops 1 (3 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.
SharedRemoteHostSelectionSheet.build (cognitive 23) lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:65— SharedRemoteHostSelectionSheet.build has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 17, boolean chains 3, 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.
SystemResourceMonitor._updateFromRustSamples (cognitive 23) lib/utils/system_resource_monitor.dart:289— SystemResourceMonitor._updateFromRustSamples has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, error handling 3, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MpvSession._isProcessRunning (cognitive 22) lib/models/external_player_session/mpv_session.dart:567— MpvSession._isProcessRunning has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchHistoryDatabase.mergeEpisodeMatchBatch (cognitive 22) lib/models/watch_history_database.dart:594— WatchHistoryDatabase.mergeEpisodeMatchBatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_WebDAVBrowserPageState._buildLargeScreenFileCard (cognitive 22) lib/pages/webdav_browser_page.dart:898— _WebDAVBrowserPageState._buildLargeScreenFileCard has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 7, boolean chains 4, 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.
ErikaPlayerAdapter.snapshot (cognitive 22) lib/player_abstraction/erika_player_adapter.dart:1009— ErikaPlayerAdapter.snapshot has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (8 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.
AppearanceSettingsProvider._loadSettings (cognitive 22) lib/providers/appearance_settings_provider.dart:167— AppearanceSettingsProvider._loadSettings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedRemoteLibraryProvider.loadAnimeEpisodes (cognitive 22) lib/providers/shared_remote_library_provider.dart:479— SharedRemoteLibraryProvider.loadAnimeEpisodes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.getCachedVideoInfo (cognitive 22) lib/services/dandanplay_service_io.dart:439— DandanplayService.getCachedVideoInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (22 pts) (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.
DandanplayService.removeFavorite (cognitive 22) lib/services/dandanplay_service_stub.dart:1920— DandanplayService.removeFavorite has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 2 (3 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.
EpisodeNavigationService._updateCurrentEpisodeHistory (cognitive 22) lib/services/episode_navigation_service.dart:2200— EpisodeNavigationService._updateCurrentEpisodeHistory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 3, error handling 2 (3 pts) (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.
RemoteSubtitleService._ensureSingleSubtitleCached (cognitive 22) lib/services/remote_subtitle_service.dart:473— RemoteSubtitleService._ensureSingleSubtitleCached has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, error handling 1, match/switch 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteSubtitleService._cleanupCacheIfNeeded (cognitive 22) lib/services/remote_subtitle_service.dart:662— RemoteSubtitleService._cleanupCacheIfNeeded has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (8 pts), loops 2 (4 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.
_AppearanceSettingsContentState.build (cognitive 22) lib/settings/pages/appearance_settings_content.dart:73— _AppearanceSettingsContentState.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 2 (3 pts), ternaries 1 (3 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.
_RemoteMenuPaneSheetState._buildNumericParam (cognitive 22) lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart:864— _RemoteMenuPaneSheetState._buildNumericParam has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (17 pts), if/else 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoPlaylistPaneState._loadData (cognitive 22) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:59— _CupertinoPlaylistPaneState._loadData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BatchDanmakuMatchDialogState._displayNameFromPath (cognitive 22) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:126— _BatchDanmakuMatchDialogState._displayNameFromPath has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 1 (4 pts), boolean chains 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.
_CachedNetworkImageWidgetState._resolveDecodeTarget (cognitive 22) lib/themes/nipaplay/widgets/cached_network_image_widget.dart:203— _CachedNetworkImageWidgetState._resolveDecodeTarget has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), ternaries 2 (4 pts), error handling 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.
_NipaplayLargeScreenAnimeDetailPageState._buildHeroInfoSection (cognitive 22) lib/themes/nipaplay/widgets/large_screen_anime_detail_page.dart:845— _NipaplayLargeScreenAnimeDetailPageState._buildHeroInfoSection has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 6, 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.
_LibraryManagementTabState._showRemoveScanResultDialog (cognitive 22) lib/themes/nipaplay/widgets/library_management_tab.dart:4787— _LibraryManagementTabState._showRemoveScanResultDialog has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_PlaybackInfoMenuState._getServerMetaInfo (cognitive 22) lib/themes/nipaplay/widgets/playback_info_menu.dart:219— _PlaybackInfoMenuState._getServerMetaInfo has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 7. 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.
_SharedRemoteLibraryViewState._buildRemoteDirectoryChildren (cognitive 22) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1397— _SharedRemoteLibraryViewState._buildRemoteDirectoryChildren has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 6 (9 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_VideoPlayerUIState._captureScreenshot (cognitive 22) lib/themes/nipaplay/widgets/video_player_ui.dart:997— _VideoPlayerUIState._captureScreenshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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.
MacOSStorageMigration.performMigration (cognitive 22) lib/utils/macos_storage_migration.dart:103— MacOSStorageMigration.performMigration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (4 pts), 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.
SubtitleManager.removeExternalSubtitleFromStack (cognitive 22) lib/utils/subtitle_manager.dart:791— SubtitleManager.removeExternalSubtitleFromStack has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (6 pts), ternaries 2 (3 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.
MpvSession._readMpvState (cognitive 21) lib/models/external_player_session/mpv_session.dart:616— MpvSession._readMpvState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, match/switch 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_DashboardHomePageState._onJellyfinStateChanged (cognitive 21) lib/pages/dashboard_home_page.dart:767— _DashboardHomePageState._onJellyfinStateChanged has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_DashboardHomePageState._onEmbyStateChanged) 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.
_DashboardHomePageState._onEmbyStateChanged (cognitive 21) lib/pages/dashboard_home_page.dart:829— _DashboardHomePageState._onEmbyStateChanged has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_DashboardHomePageState._onJellyfinStateChanged) 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.
_DashboardHomePageState.dispose (cognitive 21) lib/pages/dashboard_home_page.dart:980— _DashboardHomePageState.dispose has cognitive complexity 21 (threshold 15). Drivers by points: error handling 9 (13 pts), if/else 2 (4 pts), loops 2 (4 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.
_MediaServerDetailPageState._buildInfoView (cognitive 21) lib/pages/media_server_detail_page.dart:1544— _MediaServerDetailPageState._buildInfoView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, 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.
VideoPlayerAdapter._pauseDirectly (cognitive 21) lib/player_abstraction/video_player_adapter.dart:1067— VideoPlayerAdapter._pauseDirectly has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (7 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeSectionsSettingsProvider._loadSettings (cognitive 21) lib/providers/home_sections_settings_provider.dart:125— HomeSectionsSettingsProvider._loadSettings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (8 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.
DandanplayService.login (cognitive 21) lib/services/dandanplay_service_io.dart:746— DandanplayService.login has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.register (cognitive 21) lib/services/dandanplay_service_stub.dart:1035— DandanplayService.register has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (3 pts) (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.
DanmakuSpoilerFilterService._parseSpoilerTexts (cognitive 21) lib/services/danmaku_spoiler_filter_service.dart:310— DanmakuSpoilerFilterService._parseSpoilerTexts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalMediaShareService.listEpisodeSubtitles (cognitive 21) lib/services/local_media_share_service.dart:470— LocalMediaShareService.listEpisodeSubtitles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 1 (2 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaServerServiceBase.getClientInfo (cognitive 21) lib/services/media_server_service_base.dart:148— MediaServerServiceBase.getClientInfo has cognitive complexity 21 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 3 (6 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginPlaybackService.prepare (cognitive 21) lib/services/plugin_playback_service.dart:15— PluginPlaybackService.prepare has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 9. 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.
RemoteSubtitleService._listSharedRemoteCandidates (cognitive 21) lib/services/remote_subtitle_service.dart:1049— RemoteSubtitleService._listSharedRemoteCandidates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (4 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanService.rescanAllFolders (cognitive 21) lib/services/scan_service.dart:701— ScanService.rescanAllFolders has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (4 pts), error handling 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.
_RemoteMediaLibrarySettingsContentState._showDandanplayConnectionDialog (cognitive 21) lib/settings/pages/remote_media_library_settings_content.dart:880— _RemoteMediaLibrarySettingsContentState._showDandanplayConnectionDialog has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (6 pts), error handling 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.
AdaptiveButton.build (cognitive 21) lib/themes/cupertino/cupertino_adaptive_platform_ui.dart:117— AdaptiveButton.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 5 (8 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CupertinoNetworkServerConnectionDialog.show (cognitive 21) lib/themes/cupertino/widgets/cupertino_network_server_connection_dialog.dart:14— CupertinoNetworkServerConnectionDialog.show has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoRemoteTextInputContentState.build (cognitive 21) lib/themes/cupertino/widgets/cupertino_remote_text_input_sheet.dart:116— _CupertinoRemoteTextInputContentState.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), loops 1 (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.
CupertinoAudioTracksPane.build (cognitive 21) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:23— CupertinoAudioTracksPane.build has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._buildAdaptiveManagementStatus (cognitive 21) lib/themes/nipaplay/widgets/library_management_tab.dart:2540— _LibraryManagementTabState._buildAdaptiveManagementStatus has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts), if/else 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.
SharedRemoteHostSelectionSheet._buildHostList (cognitive 21) lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:303— SharedRemoteHostSelectionSheet._buildHostList has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (17 pts), if/else 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_SMBConnectionFormState.build (cognitive 21) lib/themes/nipaplay/widgets/smb_connection_dialog.dart:133— _SMBConnectionFormState.build has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 7. 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.
_TvOSRemoteTextInputScopeState._showRemoteInput (cognitive 21) lib/themes/nipaplay/widgets/tvos_remote_text_input_scope.dart:582— _TvOSRemoteTextInputScopeState._showRemoteInput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_VideoUploadUIState._handlePlayFromUrl (cognitive 21) lib/themes/nipaplay/widgets/video_upload_ui.dart:166— _VideoUploadUIState._handlePlayFromUrl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinuxStorageMigration._hasDataToMigrate (cognitive 21) lib/utils/linux_storage_migration.dart:110— LinuxStorageMigration._hasDataToMigrate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 1 (2 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.
NetworkAddressUtils._isPrivateIpv4 (cognitive 21) lib/utils/network_address_utils.dart:73— NetworkAddressUtils._isPrivateIpv4 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MainPageState.build (cognitive 20) lib/main.dart:1947— MainPageState.build has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, ternaries 7, 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.
DanmakuLayoutEngine.configure (cognitive 20) lib/cpp_native/bindings/danmaku_layout_io.dart:84— DanmakuLayoutEngine.configure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (8 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.
_AdaptiveMediaCollectionViewState._loadWebCollection (cognitive 20) lib/media_library/adaptive_media_collection_view.dart:737— _AdaptiveMediaCollectionViewState._loadWebCollection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (6 pts), boolean chains 2, 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.
AccountPageController.performBangumiSync (cognitive 20) lib/pages/account/account_controller.dart:438— AccountPageController.performBangumiSync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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.
_AnimeDetailPageState._buildContent (cognitive 20) lib/pages/anime_detail_page.dart:2474— _AnimeDetailPageState._buildContent has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11, if/else 4 (5 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_MediaServerDetailPageState.build (cognitive 20) lib/pages/media_server_detail_page.dart:1438— _MediaServerDetailPageState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 5, boolean chains 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.
_TorrentDownloadPageState._autoScanCompletedTask (cognitive 20) lib/pages/torrent_download_page.dart:491— _TorrentDownloadPageState._autoScanCompletedTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LargeScreenTorrentTaskCard.build (cognitive 20) lib/pages/torrent_download_page.dart:2429— _LargeScreenTorrentTaskCard.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 13, if/else 5, 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.
MediaKitPlayerAdapter._handleJellyfinStreamingTracks (cognitive 20) lib/player_abstraction/media_kit_player_adapter.dart:1499— MediaKitPlayerAdapter._handleJellyfinStreamingTracks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 4, 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.
BackupService.importWatchHistorySilent (cognitive 20) lib/services/backup_service.dart:346— BackupService.importWatchHistorySilent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 2 (4 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.
DanmakuCacheManager._clearAllCache (cognitive 20) lib/services/danmaku_cache_manager.dart:370— DanmakuCacheManager._clearAllCache has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (6 pts), boolean chains 2, 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.
EmbyService.createPlaybackSession (cognitive 20) lib/services/emby_service.dart:1227— EmbyService.createPlaybackSession has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, 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.
EpisodeNavigationService._isSameRemoteEpisode (cognitive 20) lib/services/episode_navigation_service.dart:438— EpisodeNavigationService._isSameRemoteEpisode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 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.
SkipIdResolver._searchAniList (cognitive 20) lib/services/intro_skip/skip_id_resolver.dart:254— SkipIdResolver._searchAniList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JellyfinService.buildHlsUrlWithAutoSubtitle (cognitive 20) lib/services/jellyfin_service.dart:1510— JellyfinService.buildHlsUrlWithAutoSubtitle has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (5 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RemoteSubtitleService._resolveSmbConnectionFromUri (cognitive 20) lib/services/remote_subtitle_service.dart:1729— RemoteSubtitleService._resolveSmbConnectionFromUri has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, ternaries 2, 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.
ScanService.removeScannedFolder (cognitive 20) lib/services/scan_service.dart:1066— ScanService.removeScannedFolder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (4 pts), error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubtitleService.loadExternalSubtitles (cognitive 20) lib/services/subtitle_service.dart:34— SubtitleService.loadExternalSubtitles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (3 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.
AdaptiveSettingsTile._buildPhone (cognitive 20) lib/settings/adaptive_settings_widgets.dart:330— AdaptiveSettingsTile._buildPhone has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 5, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CupertinoAudioTracksPane._resolveTrackTitle (cognitive 20) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:371— CupertinoAudioTracksPane._resolveTrackTitle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7 (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.
_CupertinoSubtitleListPaneState.build (cognitive 20) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:394— _CupertinoSubtitleListPaneState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (16 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.
_BlurLoginDialogState._handleLogin (cognitive 20) lib/themes/nipaplay/widgets/blur_login_dialog.dart:119— _BlurLoginDialogState._handleLogin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlurSnackBar.show (cognitive 20) lib/themes/nipaplay/widgets/blur_snackbar.dart:30— BlurSnackBar.show has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11, if/else 5, boolean chains 3, error handling 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.
_DanmakuSettingsMenuState._saveDanmaku (cognitive 20) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:205— _DanmakuSettingsMenuState._saveDanmaku has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 2 (4 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.
_DescriptionBlock.build (cognitive 20) lib/themes/nipaplay/widgets/immersive_anime_detail_scaffold.dart:705— _DescriptionBlock.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 6, if/else 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
NipaplayLargeScreenViewContainer.build (cognitive 20) lib/themes/nipaplay/widgets/large_screen_view_container.dart:75— NipaplayLargeScreenViewContainer.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 16 (17 pts), boolean chains 2, if/else 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_LibraryManagementTabState._showSMBConnectionDialog (cognitive 20) lib/themes/nipaplay/widgets/library_management_tab.dart:537— _LibraryManagementTabState._showSMBConnectionDialog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 4 (8 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.
_NetworkMediaLibraryViewState._loadData (cognitive 20) lib/themes/nipaplay/widgets/network_media_library_view.dart:1582— _NetworkMediaLibraryViewState._loadData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, match/switch 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkMediaServerDialogState.didChangeDependencies (cognitive 20) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:405— _NetworkMediaServerDialogState.didChangeDependencies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_PlaybackInfoMenuState._getErikaRuntimeInfo (cognitive 20) lib/themes/nipaplay/widgets/playback_info_menu.dart:549— _PlaybackInfoMenuState._getErikaRuntimeInfo has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 7, boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_PlaylistMenuState._getEpisodeDisplayName (cognitive 20) lib/themes/nipaplay/widgets/playlist_menu.dart:1031— _PlaylistMenuState._getEpisodeDisplayName 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.
SendDanmakuDialogContentState.build (cognitive 20) lib/themes/nipaplay/widgets/send_danmaku_dialog.dart:114— SendDanmakuDialogContentState.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 3, boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_TvOSRemoteTextInputScopeState._openRemoteInput (cognitive 20) lib/themes/nipaplay/widgets/tvos_remote_text_input_scope.dart:470— _TvOSRemoteTextInputScopeState._openRemoteInput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 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.
HotkeyService._getKeyCodeFromString (cognitive 20) lib/utils/hotkey_service.dart:461— HotkeyService._getKeyCodeFromString has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (8 pts), boolean chains 6, if/else 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageCacheManager._cleanupDirectoryByAge (cognitive 20) lib/utils/image_cache_manager.dart:522— ImageCacheManager._cleanupDirectoryByAge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (5 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubtitleParser.parseMicrodvd (cognitive 20) lib/utils/subtitle_parser.dart:399— SubtitleParser.parseMicrodvd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NipaPlayNextOldCanvasPainter.paint (cognitive 19) lib/danmaku_next/nipaplay_next_old_canvas_painter.dart:65— NipaPlayNextOldCanvasPainter.paint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibraryOpenTimeStore.load (cognitive 19) lib/media_library/adaptive_media_collection_view.dart:329— LibraryOpenTimeStore.load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 3, 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.
AccountPageController.performRegister (cognitive 19) lib/pages/account/account_controller.dart:177— AccountPageController.performRegister has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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.
_AnimeDetailPageState._changeImmersiveBackdrop (cognitive 19) lib/pages/anime_detail_page.dart:3053— _AnimeDetailPageState._changeImmersiveBackdrop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, ternaries 2 (4 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.
_MediaServerDetailPageState._createWatchHistoryItem (cognitive 19) lib/pages/media_server_detail_page.dart:527— _MediaServerDetailPageState._createWatchHistoryItem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_WebDAVBrowserPageState._buildLargeScreenWebDavPage (cognitive 19) lib/pages/webdav_browser_page.dart:657— _WebDAVBrowserPageState._buildLargeScreenWebDavPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 5 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_ErikaDanmakuConfigPatch.differenceFrom (cognitive 19) lib/player_abstraction/erika_player_adapter.dart:106— _ErikaDanmakuConfigPatch.differenceFrom has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 19. 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.
_NipaplayErikaWindowOverlayVideoViewState._attachOverlaySurface (cognitive 19) lib/player_abstraction/erika_player_adapter.dart:355— _NipaplayErikaWindowOverlayVideoViewState._attachOverlaySurface has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, error handling 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.
MediaKitPlayerAdapter._loadPendingExternalAudio (cognitive 19) lib/player_abstraction/media_kit_player_adapter.dart:2470— MediaKitPlayerAdapter._loadPendingExternalAudio has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaKitPlayerAdapter._refreshChapters (cognitive 19) lib/player_abstraction/media_kit_player_adapter.dart:2841— MediaKitPlayerAdapter._refreshChapters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedRemoteLibraryProvider.refreshScanStatus (cognitive 19) lib/providers/shared_remote_library_provider.dart:999— SharedRemoteLibraryProvider.refreshScanStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), 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.
DanmakuCacheManager._migrateLegacyCacheIfNeeded (cognitive 19) lib/services/danmaku_cache_manager.dart:135— DanmakuCacheManager._migrateLegacyCacheIfNeeded has cognitive complexity 19 (threshold 15). Drivers by points: error handling 3 (8 pts), if/else 4 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DanmakuCacheManager._getDanmakuFromCache (cognitive 19) lib/services/danmaku_cache_manager.dart:255— DanmakuCacheManager._getDanmakuFromCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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.
_AnimeMatchDialogState._tryAutoMatchEpisode (cognitive 19) lib/services/emby_dandanplay_matcher.dart:1239— _AnimeMatchDialogState._tryAutoMatchEpisode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 1 (3 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.
EmbyService.getMediaFileInfo (cognitive 19) lib/services/emby_service.dart:1733— EmbyService.getMediaFileInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 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.
FileAssociationService._drainIOSQueue (cognitive 19) lib/services/file_association_service.dart:100— FileAssociationService._drainIOSQueue has cognitive complexity 19 (threshold 15). Drivers by points: error handling 2 (8 pts), loops 2 (5 pts), if/else 1 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilePickerService._normalizePath (cognitive 19) lib/services/file_picker_service.dart:39— FilePickerService._normalizePath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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.
FullBackupService._restorePreferences (cognitive 19) lib/services/full_backup_service.dart:661— FullBackupService._restorePreferences has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (5 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalMediaShareService.listEpisodeFonts (cognitive 19) lib/services/local_media_share_service.dart:671— LocalMediaShareService.listEpisodeFonts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteAccessQrService._tryParseJsonPayload (cognitive 19) lib/services/remote_access_qr_service.dart:197— RemoteAccessQrService._tryParseJsonPayload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanService.cleanupMissingScannedFolders (cognitive 19) lib/services/scan_service.dart:1127— ScanService.cleanupMissingScannedFolders has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (3 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AppearanceSettingsContentState._pickCustomBackground (cognitive 19) lib/settings/pages/appearance_settings_content.dart:781— _AppearanceSettingsContentState._pickCustomBackground has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (7 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.
_GeneralSettingsContentState.build (cognitive 19) lib/settings/pages/general_settings_content.dart:73— _GeneralSettingsContentState.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (19 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.
_RemoteMediaLibrarySettingsContentState._connectSharedRemoteByQr (cognitive 19) lib/settings/pages/remote_media_library_settings_content.dart:1033— _RemoteMediaLibrarySettingsContentState._connectSharedRemoteByQr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BatchDanmakuMatchDialogState._performSearch (cognitive 19) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:236— _BatchDanmakuMatchDialogState._performSearch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BlurDropdownState._handleMenuKeyEvent (cognitive 19) lib/themes/nipaplay/widgets/blur_dropdown.dart:422— _BlurDropdownState._handleMenuKeyEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_DanmakuSettingsMenuState._addBlockWordFromInput (cognitive 19) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:111— _DanmakuSettingsMenuState._addBlockWordFromInput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_DanmakuTracksMenuState._loadLocalDanmakuFile (cognitive 19) lib/themes/nipaplay/widgets/danmaku_tracks_menu.dart:30— _DanmakuTracksMenuState._loadLocalDanmakuFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NipaplayLargeScreenPlayerMenuPanelState._focusFirstFullyVisibleDanmakuRow (cognitive 19) lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:503— _NipaplayLargeScreenPlayerMenuPanelState._focusFirstFullyVisibleDanmakuRow has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_LibraryManagementTabState._basenameOrUrlLastSegment (cognitive 19) lib/themes/nipaplay/widgets/library_management_tab.dart:4496— _LibraryManagementTabState._basenameOrUrlLastSegment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 1 (4 pts), boolean chains 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.
_LibraryManagementTabState._refreshSMBConnection (cognitive 19) lib/themes/nipaplay/widgets/library_management_tab.dart:6438— _LibraryManagementTabState._refreshSMBConnection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 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.
_NetworkMediaLibraryViewState._performCrossLibrarySearch (cognitive 19) lib/themes/nipaplay/widgets/network_media_library_view.dart:1852— _NetworkMediaLibraryViewState._performCrossLibrarySearch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (4 pts), match/switch 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkMediaServerDialogState._buildTranscodeSection (cognitive 19) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:988— _NetworkMediaServerDialogState._buildTranscodeSection has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (18 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.
_PlaylistMenuState._loadSharedRemoteAnimeEpisodes (cognitive 19) lib/themes/nipaplay/widgets/playlist_menu.dart:390— _PlaylistMenuState._loadSharedRemoteAnimeEpisodes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_RatingDialogState.build (cognitive 19) lib/themes/nipaplay/widgets/rating_dialog.dart:105— _RatingDialogState.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 14 (15 pts), if/else 3, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SharedRemoteHostSelectionSheet._connectByQr (cognitive 19) lib/themes/nipaplay/widgets/shared_remote_host_selection_sheet.dart:620— SharedRemoteHostSelectionSheet._connectByQr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SwitchableViewState._schedulePreloadIfNeeded (cognitive 19) lib/themes/nipaplay/widgets/switchable_view.dart:177— _SwitchableViewState._schedulePreloadIfNeeded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_TooltipBubbleState._recalculatePosition (cognitive 19) lib/themes/nipaplay/widgets/tooltip_bubble.dart:66— _TooltipBubbleState._recalculatePosition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, ternaries 5 (8 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, 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.
StorageService._getLinuxStorageDirectory (cognitive 19) lib/utils/storage_service.dart:266— StorageService._getLinuxStorageDirectory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubtitleManager.preloadSubtitleFile (cognitive 19) lib/utils/subtitle_manager.dart:371— SubtitleManager.preloadSubtitleFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 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.
NipaPlayNextEngine.configure (cognitive 18) lib/danmaku_next/nipaplay_next_engine.dart:148— NipaPlayNextEngine.configure has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 2 (3 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.
NipaPlayNextOldEngine.configure (cognitive 18) lib/danmaku_next/nipaplay_next_old_engine.dart:139— NipaPlayNextOldEngine.configure has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 2 (3 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.
NipaPlayNextOldEngine._layoutNative (cognitive 18) lib/danmaku_next/nipaplay_next_old_engine.dart:236— NipaPlayNextOldEngine._layoutNative has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_MediaServerDetailPageState._startEpisodePlayback (cognitive 18) lib/pages/media_server_detail_page.dart:2014— _MediaServerDetailPageState._startEpisodePlayback has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (6 pts), error handling 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ErikaDanmakuConfigPatch.isEmpty (cognitive 18) lib/player_abstraction/erika_player_adapter.dart:60— _ErikaDanmakuConfigPatch.isEmpty has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 18. 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.
VideoPlayerAdapter.updateTexture (cognitive 18) lib/player_abstraction/video_player_adapter.dart:307— VideoPlayerAdapter.updateTexture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AnimeInfoRepository.linkDandanplayBangumiAnime (cognitive 18) lib/services/anime_info/anime_info_service_impl.dart:145— _AnimeInfoRepository.linkDandanplayBangumiAnime has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoNextEpisodeService._playNextEpisode (cognitive 18) lib/services/auto_next_episode_service.dart:240— AutoNextEpisodeService._playNextEpisode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EpisodeNavigationService._getPreviousEpisodeFromFileSystem (cognitive 18) lib/services/episode_navigation_service.dart:897— EpisodeNavigationService._getPreviousEpisodeFromFileSystem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (EpisodeNavigationService._getNextEpisodeFromFileSystem) 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.
EpisodeNavigationService._getNextEpisodeFromFileSystem (cognitive 18) lib/services/episode_navigation_service.dart:957— EpisodeNavigationService._getNextEpisodeFromFileSystem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (EpisodeNavigationService._getPreviousEpisodeFromFileSystem) 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.
ExternalPlayerConsoleService._updateDisplayDanmakuList (cognitive 18) lib/services/external_player_console_service.dart:409— ExternalPlayerConsoleService._updateDisplayDanmakuList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 4, match/switch 1 (2 pts), ternaries 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilePickerService.getValidFilePath (cognitive 18) lib/services/file_picker_service.dart:751— FilePickerService.getValidFilePath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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.
FullBackupService.restoreFromData (cognitive 18) lib/services/full_backup_service.dart:591— FullBackupService.restoreFromData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalMediaShareApi._handleUpdateEpisodeThumbnail (cognitive 18) lib/services/local_media_share_api.dart:392— LocalMediaShareApi._handleUpdateEpisodeThumbnail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalMediaShareService.listEpisodeExternalAudio (cognitive 18) lib/services/local_media_share_service.dart:598— LocalMediaShareService.listEpisodeExternalAudio has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 1 (2 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteTextInputApiService._buildInputPage (cognitive 18) lib/services/remote_text_input_service.dart:602— RemoteTextInputApiService._buildInputPage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 1, if/else 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.
WebDAVService._loadConnections (cognitive 18) lib/services/webdav_service.dart:322— WebDAVService._loadConnections has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (6 pts), boolean chains 2, error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoTagSearchViewState._buildResultSlivers (cognitive 18) lib/themes/cupertino/widgets/cupertino_tag_search_view.dart:175— _CupertinoTagSearchViewState._buildResultSlivers has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7, boolean chains 6, 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.
_CupertinoPlaylistPaneState.build (cognitive 18) lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:628— _CupertinoPlaylistPaneState.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 5 (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.
_InformationHeader.build (cognitive 18) lib/themes/nipaplay/widgets/immersive_anime_detail_scaffold.dart:600— _InformationHeader.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._buildLargeScreenManagementActions (cognitive 18) lib/themes/nipaplay/widgets/library_management_tab.dart:3475— _LibraryManagementTabState._buildLargeScreenManagementActions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 1, 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.
_LibraryManagementTabState._testWebDAVConnection (cognitive 18) lib/themes/nipaplay/widgets/library_management_tab.dart:6588— _LibraryManagementTabState._testWebDAVConnection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (4 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.
_ManualDanmakuMatchDialogState._performSearch (cognitive 18) lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:118— _ManualDanmakuMatchDialogState._performSearch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (3 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.
_PlaylistMenuState._loadSharedRemoteManagementEpisodes (cognitive 18) lib/themes/nipaplay/widgets/playlist_menu.dart:321— _PlaylistMenuState._loadSharedRemoteManagementEpisodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (6 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.
_PluginMarketDialogState._installPlugin (cognitive 18) lib/themes/nipaplay/widgets/plugin_market_dialog.dart:306— _PluginMarketDialogState._installPlugin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (3 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.
_SubtitleTracksMenuState._switchToEmbeddedSubtitle (cognitive 18) lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:515— _SubtitleTracksMenuState._switchToEmbeddedSubtitle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_TypingTextState._startTypingAnimation (cognitive 18) lib/themes/nipaplay/widgets/typing_text.dart:57— _TypingTextState._startTypingAnimation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 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.
MediaInfoHelper.identifySubtitleLanguages (cognitive 18) lib/utils/media_info_helper.dart:62— MediaInfoHelper.identifySubtitleLanguages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 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.
RemoteMediaFetcher._extractFileNameFromUri (cognitive 18) lib/utils/remote_media_fetcher.dart:306— RemoteMediaFetcher._extractFileNameFromUri has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (5 pts), 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.
SubtitleManager._autoLoadLocalSubtitleGroup (cognitive 18) lib/utils/subtitle_manager.dart:1731— SubtitleManager._autoLoadLocalSubtitleGroup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 1 (2 pts), loops 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VideoAspectGeometry.displayRect (cognitive 18) lib/utils/video_aspect_geometry.dart:21— VideoAspectGeometry.displayRect has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4 (7 pts), boolean chains 1, 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.
AppDelegate.prepareOpenedFile (cognitive 18) ios/Runner/AppDelegate.swift:381— AppDelegate.prepareOpenedFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, 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.
_AdaptiveMediaLibraryPageState.build (cognitive 17) lib/media_library/adaptive_media_library_page.dart:266— _AdaptiveMediaLibraryPageState.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 3 (4 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MediaLibraryScope.containsPath (cognitive 17) lib/models/media_library_scope.dart:26— MediaLibraryScope.containsPath has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 16, match/switch 1. 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.
WatchHistoryDatabase._cleanupJsonBackups (cognitive 17) lib/models/watch_history_database.dart:292— WatchHistoryDatabase._cleanupJsonBackups has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchHistoryManager.removeHistoryByAnimeId (cognitive 17) lib/models/watch_history_model.dart:1061— WatchHistoryManager.removeHistoryByAnimeId has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 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.
WatchHistoryManager.getHistoryItemByPath (cognitive 17) lib/models/watch_history_model.dart:1125— WatchHistoryManager.getHistoryItemByPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 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.
AccountPageController.performLogin (cognitive 17) lib/pages/account/account_controller.dart:92— AccountPageController.performLogin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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.
_MediaServerDetailPageState._playMovie (cognitive 17) lib/pages/media_server_detail_page.dart:626— _MediaServerDetailPageState._playMovie has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MdkPlayerAdapter.getDetailedMediaInfo (cognitive 17) lib/player_abstraction/mdk_player_adapter_io.dart:733— MdkPlayerAdapter.getDetailedMediaInfo has cognitive complexity 17 (threshold 15). Drivers by points: error handling 7 (12 pts), if/else 2 (4 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.
MediaKitPlayerAdapter.detachPlatformVideoSurface (cognitive 17) lib/player_abstraction/media_kit_player_adapter.dart:3261— MediaKitPlayerAdapter.detachPlatformVideoSurface has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, 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.
AutoSyncService._cleanupCompactedPatches (cognitive 17) lib/services/auto_sync_service.dart:672— AutoSyncService._cleanupCompactedPatches has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BangumiApiService.initialize (cognitive 17) lib/services/bangumi_api_service.dart:52— BangumiApiService.initialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BangumiService._executeRequest (cognitive 17) lib/services/bangumi_service.dart:171— BangumiService._executeRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.updateEpisodeWatchStatus (cognitive 17) lib/services/dandanplay_service_stub.dart:1127— DandanplayService.updateEpisodeWatchStatus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (3 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.
DanmakuDensityAnalyzer.findPeakSegments (cognitive 17) lib/services/danmaku_density_analyzer.dart:84— DanmakuDensityAnalyzer.findPeakSegments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultEmbyMediaSelectionResolver.resolve (cognitive 17) lib/services/emby_media_selection_resolver.dart:12— DefaultEmbyMediaSelectionResolver.resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, 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.
EmbyService.buildHlsUrlWithOptions (cognitive 17) lib/services/emby_service.dart:1495— EmbyService.buildHlsUrlWithOptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 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.
IncrementalSyncDataFilter._normalizeWebDavConnections (cognitive 17) lib/services/incremental_sync_data_filter.dart:99— IncrementalSyncDataFilter._normalizeWebDavConnections has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NipaPlayLanDiscoveryResponder.start (cognitive 17) lib/services/nipaplay_lan_discovery.dart:97— NipaPlayLanDiscoveryResponder.start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaybackSourceService.sourceKindForPath (cognitive 17) lib/services/playback_source_service.dart:149— PlaybackSourceService.sourceKindForPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 3 (5 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RemoteControlAccessGuardService._resolveRemoteIp (cognitive 17) lib/services/remote_control_access_guard_service.dart:302— RemoteControlAccessGuardService._resolveRemoteIp 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.
ScanService._cleanupFolderHashCache (cognitive 17) lib/services/scan_service.dart:549— ScanService._cleanupFolderHashCache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (3 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerHistorySyncService._resolveThumbnailPath (cognitive 17) lib/services/server_history_sync_service.dart:391— ServerHistorySyncService._resolveThumbnailPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubtitleService.addExternalSubtitles (cognitive 17) lib/services/subtitle_service.dart:205— SubtitleService.addExternalSubtitles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 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.
SystemProxyService._parseWindowsProxyServer (cognitive 17) lib/services/system_proxy_service.dart:303— SystemProxyService._parseWindowsProxyServer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CupertinoJellyfinQualityPaneState._selectMediaSource (cognitive 17) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:118— _CupertinoJellyfinQualityPaneState._selectMediaSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BangumiCollectionDialogState._buildEpisodeStatusSection (cognitive 17) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:477— _BangumiCollectionDialogState._buildEpisodeStatusSection has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 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.
BangumiCommentPromptController.showForCurrentAnime (cognitive 17) lib/themes/nipaplay/widgets/bangumi_comment_prompt_controller.dart:25— BangumiCommentPromptController.showForCurrentAnime has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BatchDanmakuMatchDialogState._selectAnime (cognitive 17) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:287— _BatchDanmakuMatchDialogState._selectAnime has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BlurDropdownState._handleControlKeyEvent (cognitive 17) lib/themes/nipaplay/widgets/blur_dropdown.dart:385— _BlurDropdownState._handleControlKeyEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
_DanmakuSettingsMenuState._splitBlockWords (cognitive 17) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:75— _DanmakuSettingsMenuState._splitBlockWords has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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.
_DanmakuSettingsMenuState._buildDanmakuStyleSection (cognitive 17) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:525— _DanmakuSettingsMenuState._buildDanmakuStyleSection has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 4 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_ImmersiveEpisodeCardState.build (cognitive 17) lib/themes/nipaplay/widgets/immersive_episode_rail.dart:236— _ImmersiveEpisodeCardState.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5, boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_JellyfinQualityMenuState._selectMediaSource (cognitive 17) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:157— _JellyfinQualityMenuState._selectMediaSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_JellyfinQualityMenuState.build (cognitive 17) lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:403— _JellyfinQualityMenuState.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkMediaLibraryViewState._performSearch (cognitive 17) lib/themes/nipaplay/widgets/network_media_library_view.dart:1792— _NetworkMediaLibraryViewState._performSearch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkMediaServerDialogState._handleAddAddress (cognitive 17) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:490— _NetworkMediaServerDialogState._handleAddAddress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_PlaylistMenuState._buildContent (cognitive 17) lib/themes/nipaplay/widgets/playlist_menu.dart:1412— _PlaylistMenuState._buildContent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 3, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SwitchableViewState.build (cognitive 17) lib/themes/nipaplay/widgets/switchable_view.dart:269— _SwitchableViewState.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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.
DecoderManager._updateActiveDecoderInfo (cognitive 17) lib/utils/decoder_manager.dart:257— DecoderManager._updateActiveDecoderInfo has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (5 pts), ternaries 1 (2 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.
LinuxStorageMigration.performMigration (cognitive 17) lib/utils/linux_storage_migration.dart:162— LinuxStorageMigration.performMigration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (4 pts), 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.
LinuxStorageMigration.emergencyRestorePersonalFiles (cognitive 17) lib/utils/linux_storage_migration.dart:325— LinuxStorageMigration.emergencyRestorePersonalFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (4 pts), 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.
MediaIdentityResolver.forPath (cognitive 17) lib/utils/media_identity_resolver.dart:12— MediaIdentityResolver.forPath has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteAccessAddressUtils.classifyUrl (cognitive 17) lib/utils/remote_access_address_utils.dart:9— RemoteAccessAddressUtils.classifyUrl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (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.
SubtitleManager._clearExternalSubtitleState (cognitive 17) lib/utils/subtitle_manager.dart:614— SubtitleManager._clearExternalSubtitleState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate-build-info-json._detect_memory_bytes (cognitive 17) .github/workflows/scripts/generate-build-info-json.py:78— generate-build-info-json._detect_memory_bytes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smoke-macos-app.main (cognitive 17) .github/workflows/scripts/smoke-macos-app.py:23— smoke-macos-app.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ResponseState::handle_start (cognitive 17) rust/src/api/webdav_multistatus.rs:147— ResponseState::handle_start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeLibrary._open (cognitive 16) lib/cpp_native/native_library.dart:13— NativeLibrary._open has cognitive complexity 16 (threshold 15). Drivers by points: error handling 2 (6 pts), if/else 6, loops 2 (4 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.
MsdfFontAtlas._traceContour (cognitive 16) lib/danmaku_next/msdf_font_atlas.dart:548— MsdfFontAtlas._traceContour has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AdaptiveMediaLibraryPageState._handleRequestedSection (cognitive 16) lib/media_library/adaptive_media_library_page.dart:186— _AdaptiveMediaLibraryPageState._handleRequestedSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
WatchHistoryManager._checkAndRecoverFromBackup (cognitive 16) lib/models/watch_history_model.dart:228— WatchHistoryManager._checkAndRecoverFromBackup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchHistoryManager._loadCacheFromFile (cognitive 16) lib/models/watch_history_model.dart:387— WatchHistoryManager._loadCacheFromFile has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 4 (6 pts), loops 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.
AccountPageController.saveBangumiToken (cognitive 16) lib/pages/account/account_controller.dart:359— AccountPageController.saveBangumiToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
_AnimeDetailPageState._loadPlaybackEpisodes (cognitive 16) lib/pages/anime_detail_page.dart:517— _AnimeDetailPageState._loadPlaybackEpisodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AnimeDetailPageState._extractBangumiSubjectId (cognitive 16) lib/pages/anime_detail_page.dart:794— _AnimeDetailPageState._extractBangumiSubjectId has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 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.
_AnimeDetailPageState._buildImmersiveEpisodeRail (cognitive 16) lib/pages/anime_detail_page.dart:3208— _AnimeDetailPageState._buildImmersiveEpisodeRail 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.
_MediaServerDetailPageState._requestLargeScreenContentFocus (cognitive 16) lib/pages/media_server_detail_page.dart:254— _MediaServerDetailPageState._requestLargeScreenContentFocus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. 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.
_MediaServerDetailPageState._buildLargeScreenDetailPage (cognitive 16) lib/pages/media_server_detail_page.dart:952— _MediaServerDetailPageState._buildLargeScreenDetailPage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), boolean chains 5, if/else 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_NewSeriesPageState._buildLargeScreenMainContent (cognitive 16) lib/pages/new_series_page.dart:319— _NewSeriesPageState._buildLargeScreenMainContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 6, 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.
PluginManifest.fromJson (cognitive 16) lib/plugins/models/plugin_manifest.dart:29— PluginManifest.fromJson has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 2, 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.
_AnimeInfoRepository._loadAnimeEpisodeDebugTitles (cognitive 16) lib/services/anime_info/anime_info_service_impl.dart:323— _AnimeInfoRepository._loadAnimeEpisodeDebugTitles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BangumiApiService.getUserCollection (cognitive 16) lib/services/bangumi_api_service.dart:415— BangumiApiService.getUserCollection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayRemoteService.refreshLibrary (cognitive 16) lib/services/dandanplay_remote_service.dart:141— DandanplayRemoteService.refreshLibrary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
DandanplayRemoteService._extractDandanplayIdentifier (cognitive 16) lib/services/dandanplay_remote_service.dart:398— DandanplayRemoteService._extractDandanplayIdentifier has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.getUserPlayHistory (cognitive 16) lib/services/dandanplay_service_io.dart:1912— DandanplayService.getUserPlayHistory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.getVideoInfo (cognitive 16) lib/services/dandanplay_service_stub.dart:1199— DandanplayService.getVideoInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DandanplayService.sendDanmaku (cognitive 16) lib/services/dandanplay_service_stub.dart:2040— DandanplayService.sendDanmaku has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 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.
_DatabaseDebugPrinter.printAnimeEpisodeRelations (cognitive 16) lib/services/database/database_debug.dart:32— _DatabaseDebugPrinter.printAnimeEpisodeRelations has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 6). 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.
EpisodeFileSelectionService.select (cognitive 16) lib/services/episode_file_selection_service.dart:32— EpisodeFileSelectionService.select has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 3 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EpisodeNavigationService._extractDandanplayIdentifier (cognitive 16) lib/services/episode_navigation_service.dart:582— EpisodeNavigationService._extractDandanplayIdentifier has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DanmakuIntroDetector.parseTimestamp (cognitive 16) lib/services/intro_skip/danmaku_intro_detector.dart:216— DanmakuIntroDetector.parseTimestamp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LocalMediaManagementApi._buildEntryJson (cognitive 16) lib/services/local_media_management_api.dart:1109— LocalMediaManagementApi._buildEntryJson has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaServerWatchHistorySync._canMigrateLegacy (cognitive 16) lib/services/media_server_watch_history_sync.dart:134— MediaServerWatchHistorySync._canMigrateLegacy has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PlaybackService.tryPlayExternally (cognitive 16) lib/services/playback_service.dart:25— PlaybackService.tryPlayExternally has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 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.
PlayerRemoteControlBridge._setDanmakuBlockWords (cognitive 16) lib/services/player_remote_control_bridge.dart:1292— PlayerRemoteControlBridge._setDanmakuBlockWords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (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.
RemoteControlClientService.fetchState (cognitive 16) lib/services/remote_control_client_service.dart:141— RemoteControlClientService.fetchState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
ScanService._updateScanState (cognitive 16) lib/services/scan_service.dart:658— ScanService._updateScanState has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 6. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SecurityBookmarkService.restoreAllBookmarks (cognitive 16) lib/services/security_bookmark_service.dart:117— SecurityBookmarkService.restoreAllBookmarks 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, 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.
SharedRemotePlaybackSyncService.syncProgress (cognitive 16) lib/services/shared_remote_playback_sync_service.dart:20— SharedRemotePlaybackSyncService.syncProgress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3, error handling 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SharedRemotePlaybackSyncService.syncThumbnail (cognitive 16) lib/services/shared_remote_playback_sync_service.dart:87— SharedRemotePlaybackSyncService.syncThumbnail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 3, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WebRemoteHistorySyncService.syncProgress (cognitive 16) lib/services/web_remote_history_sync_service.dart:19— WebRemoteHistorySyncService.syncProgress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3, boolean chains 2, error handling 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.
DeveloperOptionsSettingsContent.build (cognitive 16) lib/settings/pages/developer_options_settings_content.dart:33— DeveloperOptionsSettingsContent.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (6 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.
_WebDAVQuickSettingsContentState.build (cognitive 16) lib/settings/pages/webdav_quick_settings_content.dart:42— _WebDAVQuickSettingsContentState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CupertinoBottomSheet._buildSheet (cognitive 16) lib/themes/cupertino/widgets/cupertino_bottom_sheet.dart:198— CupertinoBottomSheet._buildSheet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 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.
_CupertinoJellyfinQualityPaneState._loadInitialState (cognitive 16) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:50— _CupertinoJellyfinQualityPaneState._loadInitialState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_BackupRestorePageState._backupHistory (cognitive 16) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:461— _BackupRestorePageState._backupHistory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomMediaInfoDialog._showStep1 (cognitive 16) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:64— CustomMediaInfoDialog._showStep1 has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 13, if/else 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_DanmakuSettingsMenuState._pickDanmakuFontFolder (cognitive 16) lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:359— _DanmakuSettingsMenuState._pickDanmakuFontFolder has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 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.
_NipaplayLargeScreenFocusableActionState.build (cognitive 16) lib/themes/nipaplay/widgets/large_screen_focusable_action.dart:61— _NipaplayLargeScreenFocusableActionState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 6, boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_NipaplayLargeScreenPlayerMenuPanelState._handleKeyEvent (cognitive 16) lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:305— _NipaplayLargeScreenPlayerMenuPanelState._handleKeyEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LibraryManagementTabState._showMountedCustomMediaInfo (cognitive 16) lib/themes/nipaplay/widgets/library_management_tab.dart:3184— _LibraryManagementTabState._showMountedCustomMediaInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 4, error handling 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NetworkMediaLibraryViewState._buildLibraryContentView (cognitive 16) lib/themes/nipaplay/widgets/network_media_library_view.dart:1285— _NetworkMediaLibraryViewState._buildLibraryContentView has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 4, 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.
_SeekStepMenuState.build (cognitive 16) lib/themes/nipaplay/widgets/seek_step_menu.dart:124— _SeekStepMenuState.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11, if/else 3, 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.
_SharedRemoteLibraryViewState._ensureManagementLoaded (cognitive 16) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1252— _SharedRemoteLibraryViewState._ensureManagementLoaded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SharedRemoteLibraryViewState._buildUnifiedRemoteManagementItems (cognitive 16) lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1673— _SharedRemoteLibraryViewState._buildUnifiedRemoteManagementItems has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_WebRemoteAccessGateState.build (cognitive 16) lib/themes/nipaplay/widgets/web_remote_access_gate.dart:162— _WebRemoteAccessGateState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 5 (8 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.
ChineseConverter.convertAnimeData (cognitive 16) lib/utils/chinese_converter.dart:41— ChineseConverter.convertAnimeData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 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.
ImageCacheManager._enforceByteBudget (cognitive 16) lib/utils/image_cache_manager.dart:316— ImageCacheManager._enforceByteBudget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoPlayerState.dispose (cognitive 16) lib/utils/video_player_state.dart:1906— VideoPlayerState.dispose has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, error handling 3 (5 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_DanmakuOverlayState.build (cognitive 16) lib/widgets/danmaku_overlay.dart:44— _DanmakuOverlayState.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MotionClock::anchor (cognitive 16) rust/src/next2_engine/engine/motion.rs:46— MotionClock::anchor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TooManyFields: Next2Renderer rust/src/next2_engine/engine/rendering.rs:1154— TooManyFields — 41 stored fields beside 19 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Near-duplicate member family (4 members, 45 shared lines) · ×1
Near-duplicate member family (4 members, 45 shared lines) lib/services/remote_subtitle_service.dart:927— lib/services/remote_subtitle_service.dart:927-1039 | lib/services/remote_subtitle_service.dart:1049-1151 | lib/services/remote_subtitle_service.dart:1153-1269 | lib/services/remote_subtitle_service.dart:1271-1390 — These 4 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 30 shared lines) · ×1
Near-duplicate member family (4 members, 30 shared lines) lib/services/dandanplay_service_io.dart:1912— lib/services/dandanplay_service_io.dart:1912-1979 | lib/services/dandanplay_service_io.dart:2394-2456 | lib/services/dandanplay_service_stub.dart:1343-1448 | lib/services/dandanplay_service_stub.dart:1738-1829 — These 4 members are variants of one another: a block of 30 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, 18 shared lines) · ×1
Near-duplicate member family (4 members, 18 shared lines) lib/services/dandanplay_service_io.dart:2653— lib/services/dandanplay_service_io.dart:2653-2731 | lib/services/dandanplay_service_stub.dart:1450-1542 | lib/services/dandanplay_service_stub.dart:1831-1918 | lib/services/dandanplay_service_stub.dart:2040-2136 — These 4 members are variants of one another: a block of 18 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.
Near-duplicate member pair (116 shared lines) lib/themes/nipaplay/widgets/library_management_tab.dart:5990— lib/themes/nipaplay/widgets/library_management_tab.dart:5990-6131 | lib/themes/nipaplay/widgets/library_management_tab.dart:6226-6365 — These two members are variants of one another: 116 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 (79 shared lines) lib/themes/nipaplay/widgets/playback_rate_menu.dart:110— lib/themes/nipaplay/widgets/playback_rate_menu.dart:110-327 | lib/themes/nipaplay/widgets/seek_step_menu.dart:124-599 — These two members are variants of one another: 79 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (75 shared lines) lib/pages/torrent_download_page.dart:1978— lib/pages/torrent_download_page.dart:1978-2118 | lib/pages/torrent_download_page.dart:2165-2299 — These two members are variants of one another: 75 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 (68 shared lines) lib/services/dandanplay_service_io.dart:746— lib/services/dandanplay_service_io.dart:746-820 | lib/services/dandanplay_service_stub.dart:630-735 — These two members are variants of one another: 68 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 (58 shared lines) lib/services/dandanplay_service_io.dart:1235— lib/services/dandanplay_service_io.dart:1235-1352 | lib/services/dandanplay_service_stub.dart:2138-2254 — These two members are variants of one another: 58 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 (52 shared lines) lib/danmaku_next/nipaplay_next_old_overlay.dart:116— lib/danmaku_next/nipaplay_next_old_overlay.dart:116-194 | lib/danmaku_next/nipaplay_next_overlay.dart:134-230 — 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.
Near-duplicate member pair (48 shared lines) lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:226— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:226-341 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:270-383 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (29 shared lines) rust/src/next2_engine/engine/rendering.rs:229— rust/src/next2_engine/engine/rendering.rs:229-359 | rust/src/next2_engine/engine/rendering.rs:770-911 — These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) lib/providers/shared_remote_library_provider.dart:1061— lib/providers/shared_remote_library_provider.dart:1061-1168 | lib/providers/shared_remote_library_provider.dart:1202-1304 | lib/providers/shared_remote_library_provider.dart:1306-1376 | lib/providers/shared_remote_library_provider.dart:1378-1447 | lib/providers/shared_remote_library_provider.dart:1481-1572 | lib/providers/shared_remote_library_provider.dart:1574-1629 | lib/providers/shared_remote_library_provider.dart:1631-1699 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Edited copy of a member (431 corresponding lines) · ×1
Edited copy of a member (431 corresponding lines) lib/themes/nipaplay/widgets/danmaku_list_menu.dart:374— lib/themes/nipaplay/widgets/danmaku_list_menu.dart:374-915 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:580-1010 — These two members are one piece of code written twice and then edited apart: 431 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (118 corresponding lines) · ×1
Edited copy of a member (118 corresponding lines) lib/settings/pages/plugin_settings_content.dart:632— lib/settings/pages/plugin_settings_content.dart:632-749 | lib/settings/pages/plugin_settings_content.dart:751-894 — These two members are one piece of code written twice and then edited apart: 118 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) rust/src/api/file_scan.rs:231— rust/src/api/file_scan.rs:231-314 | rust/src/api/incremental_sync.rs:450-525 — 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 (92 corresponding lines) · ×1
Edited copy of a member (92 corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:5224— lib/themes/nipaplay/widgets/library_management_tab.dart:5224-5315 | lib/themes/nipaplay/widgets/library_management_tab.dart:5317-5410 — 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 (85 corresponding lines) · ×1
Edited copy of a member (85 corresponding lines) lib/services/local_media_management_api.dart:519— lib/services/local_media_management_api.dart:519-603 | lib/themes/nipaplay/widgets/library_management_tab.dart:5879-5987 — These two members are one piece of code written twice and then edited apart: 85 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (72 corresponding lines) · ×1
Edited copy of a member (72 corresponding lines) lib/services/local_media_share_service.dart:470— lib/services/local_media_share_service.dart:470-559 | lib/services/local_media_share_service.dart:598-669 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (96 corresponding lines) · ×1
Edited copy of a member (96 corresponding lines) lib/services/emby_dandanplay_matcher.dart:1141— lib/services/emby_dandanplay_matcher.dart:1141-1236 | lib/services/jellyfin_dandanplay_matcher.dart:1215-1310 — These two members are one piece of code written twice and then edited apart: 96 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (84 corresponding lines) · ×1
Edited copy of a member (84 corresponding lines) lib/services/emby_service.dart:1227— lib/services/emby_service.dart:1227-1310 | lib/services/jellyfin_service.dart:1083-1185 — 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 (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) lib/services/shared_remote_playback_sync_service.dart:20— lib/services/shared_remote_playback_sync_service.dart:20-85 | lib/services/shared_remote_playback_sync_service.dart:87-165 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (71 corresponding lines) · ×1
Edited copy of a member (71 corresponding lines) lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart:1278— lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart:1278-1352 | lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart:1354-1424 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) lib/themes/nipaplay/widgets/local_library_control_bar.dart:280— lib/themes/nipaplay/widgets/local_library_control_bar.dart:280-352 | lib/themes/nipaplay/widgets/network_media_library_view.dart:2264-2341 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
Edited copy of a member (50 corresponding lines) rust/src/next2_engine/engine/renderer_draw.rs:755— rust/src/next2_engine/engine/renderer_draw.rs:755-825 | rust/src/next2_engine/engine/renderer_draw.rs:841-890 — 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 (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) lib/services/episode_navigation_service.dart:1117— lib/services/episode_navigation_service.dart:1117-1172 | lib/services/episode_navigation_service.dart:1174-1229 — 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 (70 corresponding lines) · ×1
Edited copy of a member (70 corresponding lines) lib/themes/nipaplay/widgets/modern_video_controls.dart:314— lib/themes/nipaplay/widgets/modern_video_controls.dart:314-392 | lib/themes/nipaplay/widgets/modern_video_controls.dart:394-463 — 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 (69 corresponding lines) · ×1
Edited copy of a member (69 corresponding lines) lib/services/local_media_share_api.dart:322— lib/services/local_media_share_api.dart:322-390 | lib/services/local_media_share_api.dart:392-470 — 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 (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) lib/services/dandanplay_service_stub.dart:1127— lib/services/dandanplay_service_stub.dart:1127-1197 | lib/services/dandanplay_service_stub.dart:1920-1986 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) lib/services/dandanplay_service_io.dart:1784— lib/services/dandanplay_service_io.dart:1784-1845 | lib/services/dandanplay_service_stub.dart:2532-2578 — 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 (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:212— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:212-265 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:173-237 — 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 (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) lib/pages/dashboard_home_page.dart:767— lib/pages/dashboard_home_page.dart:767-827 | lib/pages/dashboard_home_page.dart:829-888 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (58 corresponding lines) · ×1
Edited copy of a member (58 corresponding lines) lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1242— lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1242-1300 | lib/themes/nipaplay/pages/settings/backup_restore_page.dart:1537-1594 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 50+ corresponding lines) · ×1
Edited copies of one member (4 members, 50+ corresponding lines) lib/services/dandanplay_service_io.dart:1124— lib/services/dandanplay_service_io.dart:1124-1177 | lib/services/dandanplay_service_io.dart:1982-2051 | lib/services/dandanplay_service_io.dart:2459-2522 | lib/services/dandanplay_service_io.dart:2525-2574 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 50 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 (57 corresponding lines) · ×1
Edited copy of a member (57 corresponding lines) lib/themes/nipaplay/widgets/network_media_library_view.dart:2021— lib/themes/nipaplay/widgets/network_media_library_view.dart:2021-2083 | lib/themes/nipaplay/widgets/network_media_library_view.dart:2085-2141 — 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 copies of one member (3 members, 38+ corresponding lines) · ×1
Edited copies of one member (3 members, 38+ corresponding lines) lib/services/remote_subtitle_service.dart:1515— lib/services/remote_subtitle_service.dart:1515-1552 | lib/services/remote_subtitle_service.dart:1554-1599 | lib/services/remote_subtitle_service.dart:1787-1826 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) lib/services/dandanplay_service_io.dart:2334— lib/services/dandanplay_service_io.dart:2334-2391 | lib/services/dandanplay_service_stub.dart:1689-1736 — 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 (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) lib/services/emby_service.dart:957— lib/services/emby_service.dart:957-994 | lib/services/emby_service.dart:1003-1030 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 34+ corresponding lines) · ×1
Edited copies of one member (3 members, 34+ corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:3860— lib/themes/nipaplay/widgets/library_management_tab.dart:3860-3906 | lib/themes/nipaplay/widgets/library_management_tab.dart:4009-4042 | lib/themes/nipaplay/widgets/library_management_tab.dart:4144-4178 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 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, 41+ corresponding lines) · ×1
Edited copies of one member (3 members, 41+ corresponding lines) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:955— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:955-999 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:586-626 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:668-709 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 38+ corresponding lines) · ×1
Edited copies of one member (4 members, 38+ corresponding lines) lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:252— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:252-289 | lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:291-330 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:162-201 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:203-245 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 42+ corresponding lines) · ×1
Edited copies of one member (3 members, 42+ corresponding lines) lib/providers/dandanplay_remote_provider.dart:92— lib/providers/dandanplay_remote_provider.dart:92-133 | lib/providers/emby_provider.dart:269-310 | lib/providers/jellyfin_provider.dart:302-343 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 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, 32+ corresponding lines) · ×1
Edited copies of one member (3 members, 32+ corresponding lines) lib/services/local_media_share_api.dart:158— lib/services/local_media_share_api.dart:158-189 | lib/services/local_media_share_api.dart:224-255 | lib/services/local_media_share_api.dart:289-320 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 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, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:219— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:219-251 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:255-290 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:537-560 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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/services/web_api_service.dart:516— lib/services/web_api_service.dart:516-550 | lib/services/web_api_service.dart:552-579 | lib/services/web_api_service.dart:581-609 — 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, 46+ corresponding lines) · ×1
Edited copies of one member (3 members, 46+ corresponding lines) lib/services/smb2_native_service_ffi.dart:329— lib/services/smb2_native_service_ffi.dart:329-374 | lib/services/smb2_native_service_ffi.dart:376-424 | lib/services/smb2_native_service_ffi.dart:426-471 — 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 copies of one member (3 members, 29+ corresponding lines) · ×1
Edited copies of one member (3 members, 29+ corresponding lines) lib/themes/nipaplay/widgets/network_media_server_dialog.dart:490— lib/themes/nipaplay/widgets/network_media_server_dialog.dart:490-522 | lib/themes/nipaplay/widgets/network_media_server_dialog.dart:551-579 | lib/themes/nipaplay/widgets/network_media_server_dialog.dart:581-611 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 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, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) lib/models/watch_history_database.dart:928— lib/models/watch_history_database.dart:928-953 | lib/models/watch_history_database.dart:1069-1093 | lib/models/watch_history_database.dart:1096-1127 | lib/models/watch_history_database.dart:1130-1161 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 24+ corresponding lines) · ×1
Edited copies of one member (4 members, 24+ corresponding lines) lib/providers/emby_provider.dart:207— lib/providers/emby_provider.dart:207-240 | lib/providers/emby_provider.dart:243-266 | lib/providers/jellyfin_provider.dart:241-273 | lib/providers/jellyfin_provider.dart:276-299 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 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, 21+ corresponding lines) · ×1
Edited copies of one member (4 members, 21+ corresponding lines) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:59— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_list_pane.dart:59-79 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:69-89 | lib/themes/nipaplay/widgets/danmaku_list_menu.dart:82-113 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:90-126 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×1
Edited copies of one member (4 members, 20+ corresponding lines) lib/services/local_media_management_api.dart:476— lib/services/local_media_management_api.dart:476-496 | lib/services/local_media_management_api.dart:498-517 | lib/themes/nipaplay/widgets/library_management_tab.dart:6134-6163 | lib/themes/nipaplay/widgets/library_management_tab.dart:6367-6389 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) lib/providers/emby_provider.dart:342— lib/providers/emby_provider.dart:342-360 | lib/providers/emby_provider.dart:363-383 | lib/providers/jellyfin_provider.dart:375-393 | lib/providers/jellyfin_provider.dart:396-416 — 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, 26+ corresponding lines) · ×1
Edited copies of one member (6 members, 26+ corresponding lines) lib/settings/adaptive_settings_widgets.dart:61— lib/settings/adaptive_settings_widgets.dart:61-86 | lib/settings/adaptive_settings_widgets.dart:88-113 | lib/settings/adaptive_settings_widgets.dart:115-142 | lib/settings/adaptive_settings_widgets.dart:144-170 | lib/settings/adaptive_settings_widgets.dart:172-203 | lib/settings/adaptive_settings_widgets.dart:205-230 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) lib/services/emby_service.dart:912— lib/services/emby_service.dart:912-932 | lib/services/jellyfin_service.dart:764-782 | lib/services/jellyfin_service.dart:858-876 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) lib/player_menu/player_menu_pane_controllers.dart:95— lib/player_menu/player_menu_pane_controllers.dart:95-112 | lib/settings/pages/player_settings_content.dart:241-263 | lib/settings/pages/player_settings_content.dart:265-282 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) lib/themes/nipaplay/widgets/tag_search_widget.dart:540— lib/themes/nipaplay/widgets/tag_search_widget.dart:540-564 | lib/themes/nipaplay/widgets/tag_search_widget.dart:912-936 | lib/themes/nipaplay/widgets/tag_search_widget.dart:958-990 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 26+ corresponding lines) · ×1
Edited copies of one member (4 members, 26+ corresponding lines) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:697— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:697-722 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:294-325 | lib/themes/nipaplay/widgets/network_media_server_dialog.dart:773-802 | lib/themes/nipaplay/widgets/text_input_dialog.dart:250-277 — 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 (7 members, 9+ corresponding lines) · ×1
Edited copies of one member (7 members, 9+ corresponding lines) lib/providers/shared_remote_library_provider.dart:2128— lib/providers/shared_remote_library_provider.dart:2128-2137 | lib/services/episode_navigation_service.dart:1083-1094 | lib/services/playback_source_service.dart:869-877 | lib/services/playback_source_service.dart:998-1007 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:143-154 | lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:174-185 | lib/themes/nipaplay/widgets/playlist_menu.dart:220-233 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) ios/Runner/AirPlayRoutePickerView.swift:66— ios/Runner/AirPlayRoutePickerView.swift:66-73 | packages/adaptive_platform_ui/ios/Classes/iOS26ButtonView.swift:447-453 | packages/adaptive_platform_ui/ios/Classes/iOS26SegmentedControlView.swift:150-156 | packages/adaptive_platform_ui/ios/Classes/iOS26TabBarPlatformView.swift:572-578 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) rust/src/api/torrent.rs:398— rust/src/api/torrent.rs:398-407 | rust/src/api/torrent.rs:409-418 | rust/src/api/torrent.rs:420-429 | rust/src/api/torrent.rs:431-440 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) lib/themes/nipaplay/widgets/library_management_tab.dart:1773— lib/themes/nipaplay/widgets/library_management_tab.dart:1773-1781 | lib/themes/nipaplay/widgets/library_management_tab.dart:1783-1793 | lib/themes/nipaplay/widgets/library_management_tab.dart:1795-1803 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) lib/themes/nipaplay/widgets/custom_refresh_indicator.dart:38— lib/themes/nipaplay/widgets/custom_refresh_indicator.dart:38-52 | lib/themes/nipaplay/widgets/custom_slider.dart:33-46 | lib/themes/nipaplay/widgets/horizontal_anime_skeleton.dart:18-28 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) lib/providers/appearance_settings_provider.dart:256— lib/providers/appearance_settings_provider.dart:256-268 | lib/providers/appearance_settings_provider.dart:286-298 | lib/providers/appearance_settings_provider.dart:377-389 | lib/providers/appearance_settings_provider.dart:407-419 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) lib/plugins/plugin_service.dart:1566— lib/plugins/plugin_service.dart:1566-1572 | lib/services/media_server_service_base.dart:779-789 | lib/themes/nipaplay/widgets/switchable_view.dart:139-145 — 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/plugins/plugin_storage_impl_io.dart:13— lib/plugins/plugin_storage_impl_io.dart:13-25 | lib/services/file_log_service_io.dart:136-143 | lib/utils/subtitle_manager.dart:1370-1377 — 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 (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) lib/themes/nipaplay/widgets/bounce_hover_scale.dart:27— lib/themes/nipaplay/widgets/bounce_hover_scale.dart:27-41 | lib/themes/nipaplay/widgets/loading_placeholder.dart:27-42 | packages/adaptive_platform_ui/lib/src/widgets/adaptive_scaffold.dart:848-859 | packages/adaptive_platform_ui/lib/src/widgets/adaptive_tooltip.dart:239-251 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) lib/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:740— lib/themes/cupertino/widgets/cupertino_debug_log_viewer_sheet.dart:740-745 | lib/themes/nipaplay/widgets/large_screen_top_status_overlay.dart:100-104 | lib/themes/nipaplay/widgets/mobile_playback_status.dart:97-101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×1
Edited copies of one member (4 members, 4+ corresponding lines) lib/plugins/plugin_service.dart:83— lib/plugins/plugin_service.dart:83-86 | lib/services/remote_control_settings.dart:20-23 | lib/themes/nipaplay/widgets/large_screen_mode_preferences.dart:13-16 | lib/utils/settings_storage.dart:4-7 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (434 lines × 2) lib/services/emby_dandanplay_matcher.dart:1357— lib/services/emby_dandanplay_matcher.dart:1357-1790 | lib/services/jellyfin_dandanplay_matcher.dart:1405-1838 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1357` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (200–210 lines × 2) lib/themes/nipaplay/widgets/danmaku_list_menu.dart:456— lib/themes/nipaplay/widgets/danmaku_list_menu.dart:456-655 | lib/themes/nipaplay/widgets/danmaku_list_menu.dart:667-876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/danmaku_list_menu.dart:456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (154 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:678— lib/danmaku_next/nipaplay_next_engine.dart:678-831 | lib/danmaku_next/nipaplay_next_old_engine.dart:521-674 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (116 lines × 2) lib/themes/nipaplay/widgets/emby_library_card.dart:44— lib/themes/nipaplay/widgets/emby_library_card.dart:44-159 | lib/themes/nipaplay/widgets/jellyfin_library_card.dart:41-156 — before extracting anything, compare `lib/themes/nipaplay/widgets/emby_library_card.dart` and `lib/themes/nipaplay/widgets/jellyfin_library_card.dart` as WHOLE FILES: this scan already matched 4 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. 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/themes/nipaplay/widgets/emby_library_card.dart:44` 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 (101–103 lines × 2) lib/services/dandanplay_service_io.dart:1487— lib/services/dandanplay_service_io.dart:1487-1589 | lib/services/dandanplay_service_stub.dart:2423-2523 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (85–86 lines × 2) lib/themes/nipaplay/widgets/subtitle_list_menu.dart:657— lib/themes/nipaplay/widgets/subtitle_list_menu.dart:657-741 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:822-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/subtitle_list_menu.dart:657` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (81–84 lines × 2) lib/themes/nipaplay/widgets/video_player_ui.dart:1251— lib/themes/nipaplay/widgets/video_player_ui.dart:1251-1331 | lib/themes/nipaplay/widgets/video_player_ui.dart:1349-1432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/video_player_ui.dart:1251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (84 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:919— lib/danmaku_next/nipaplay_next_engine.dart:919-1002 | lib/danmaku_next/nipaplay_next_old_engine.dart:762-845 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (74 lines × 2) lib/services/emby_service.dart:1333— lib/services/emby_service.dart:1333-1406 | lib/services/jellyfin_service.dart:1208-1281 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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 (70 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:148— lib/danmaku_next/nipaplay_next_engine.dart:148-217 | lib/danmaku_next/nipaplay_next_old_engine.dart:139-208 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (64–65 lines × 2) lib/services/emby_dandanplay_matcher.dart:36— lib/services/emby_dandanplay_matcher.dart:36-99 | lib/services/jellyfin_dandanplay_matcher.dart:36-100 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (63–64 lines × 2) lib/services/emby_service.dart:1247— lib/services/emby_service.dart:1247-1310 | lib/services/jellyfin_service.dart:1123-1185 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:1247` 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 (56–62 lines × 2) lib/danmaku_dfm/dfm_plus_overlay.dart:704— lib/danmaku_dfm/dfm_plus_overlay.dart:704-765 | lib/danmaku_next/nipaplay_next2_overlay.dart:254-309 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_overlay.dart` and `lib/danmaku_next/nipaplay_next2_overlay.dart` as WHOLE FILES: this scan already matched 4 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/danmaku_dfm/dfm_plus_overlay.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 (59–61 lines × 2) lib/services/emby_dandanplay_matcher.dart:1176— lib/services/emby_dandanplay_matcher.dart:1176-1236 | lib/services/jellyfin_dandanplay_matcher.dart:1252-1310 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1176` it begins part-way through the construct above it, so those 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 (58–60 lines × 2) lib/settings/pages/developer_options_settings_content.dart:660— lib/settings/pages/developer_options_settings_content.dart:660-717 | lib/settings/pages/developer_options_settings_content.dart:817-876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/settings/pages/developer_options_settings_content.dart:660` 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 (57 lines × 2) lib/services/remote_subtitle_service.dart:1181— lib/services/remote_subtitle_service.dart:1181-1237 | lib/services/remote_subtitle_service.dart:1299-1355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/remote_subtitle_service.dart:1181` 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 (56 lines × 2) lib/danmaku_next/nipaplay_next_engine.dart:546— lib/danmaku_next/nipaplay_next_engine.dart:546-601 | lib/danmaku_next/nipaplay_next_old_engine.dart:389-444 — before extracting anything, compare `lib/danmaku_next/nipaplay_next_engine.dart` and `lib/danmaku_next/nipaplay_next_old_engine.dart` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 611 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 (54 lines × 2) lib/services/dandanplay_service_io.dart:835— lib/services/dandanplay_service_io.dart:835-888 | lib/services/dandanplay_service_stub.dart:778-831 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:835` 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 (51 lines × 2) lib/themes/nipaplay/widgets/danmaku_list_menu.dart:859— lib/themes/nipaplay/widgets/danmaku_list_menu.dart:859-909 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:956-1006 — before extracting anything, compare `lib/themes/nipaplay/widgets/danmaku_list_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_list_menu.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 92 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/themes/nipaplay/widgets/danmaku_list_menu.dart:859` 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 (48–50 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:5535— lib/themes/nipaplay/widgets/library_management_tab.dart:5535-5584 | lib/themes/nipaplay/widgets/library_management_tab.dart:5746-5793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:5535` it begins part-way through the construct above it, so those 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 (49 lines × 2) lib/player_abstraction/video_player_adapter.dart:620— lib/player_abstraction/video_player_adapter.dart:620-668 | lib/player_abstraction/video_player_adapter.dart:720-768 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/player_abstraction/video_player_adapter.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 (43–48 lines × 2) lib/services/remote_subtitle_service.dart:1406— lib/services/remote_subtitle_service.dart:1406-1453 | lib/services/remote_subtitle_service.dart:1471-1513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/remote_subtitle_service.dart:1471` 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 (118 lines × 2) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:300— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:300-417 | lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart:272-389 — before extracting anything, compare `lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart` and `lib/themes/nipaplay/widgets/bangumi_comment_dialog.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 385 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 (47 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:112— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:112-158 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:148-194 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (46 lines × 4) lib/themes/nipaplay/widgets/audio_tracks_menu.dart:227— lib/themes/nipaplay/widgets/audio_tracks_menu.dart:227-272 | lib/themes/nipaplay/widgets/audio_tracks_menu.dart:386-431 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:840-885 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:1006-1051 — before extracting anything, compare `lib/themes/nipaplay/widgets/audio_tracks_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart` as WHOLE FILES: this scan already matched 3 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. 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/themes/nipaplay/widgets/audio_tracks_menu.dart:227` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/subtitle_tracks_menu.dart:838` calls `_saveExternalSubtitles` and `lib/themes/nipaplay/widgets/audio_tracks_menu.dart:226` 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 (46 lines × 2) lib/services/dandanplay_remote_service.dart:398— lib/services/dandanplay_remote_service.dart:398-443 | lib/services/episode_navigation_service.dart:582-627 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/dandanplay_remote_service.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.
Duplicated block (45–46 lines × 2) lib/themes/nipaplay/widgets/library_management_tab.dart:5992— lib/themes/nipaplay/widgets/library_management_tab.dart:5992-6037 | lib/themes/nipaplay/widgets/library_management_tab.dart:6228-6272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/library_management_tab.dart:5992` it does not close everything it opens, so those exact lines 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–44 lines × 2) lib/services/dandanplay_service_io.dart:1866— lib/services/dandanplay_service_io.dart:1866-1909 | lib/services/dandanplay_service_stub.dart:2256-2289 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1866` it does not close everything it opens, so those exact lines 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/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:182— lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart:182-224 | lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart:225-268 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_smb_connection_dialog.dart` and `lib/themes/cupertino/widgets/cupertino_webdav_connection_dialog.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 127 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 (41–42 lines × 2) lib/services/dandanplay_service_io.dart:1380— lib/services/dandanplay_service_io.dart:1380-1421 | lib/services/dandanplay_service_stub.dart:2317-2357 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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 (40 lines × 2) lib/widgets/danmaku_container.dart:598— lib/widgets/danmaku_container.dart:598-637 | lib/widgets/danmaku_container.dart:713-752 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/danmaku_container.dart:598` it begins part-way through the construct above it, so those exact lines 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 × 13) lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:247— lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:247-285 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:291-329 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:335-373 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:379-417 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:424-462 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:468-506 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:512-550 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:556-594 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:600-638 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:644-682 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:688-726 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:732-770 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:776-814 — all 13 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/themes/nipaplay/widgets/custom_media_info_dialog.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 (38–39 lines × 2) lib/themes/nipaplay/widgets/subtitle_list_menu.dart:773— lib/themes/nipaplay/widgets/subtitle_list_menu.dart:773-810 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:935-973 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/subtitle_list_menu.dart:773` it begins part-way through the construct above it, so those exact lines 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/services/episode_navigation_service.dart:1118— lib/services/episode_navigation_service.dart:1118-1155 | lib/services/episode_navigation_service.dart:1175-1212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/episode_navigation_service.dart:1118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37–38 lines × 2) lib/themes/nipaplay/widgets/emby_library_card.dart:162— lib/themes/nipaplay/widgets/emby_library_card.dart:162-198 | lib/themes/nipaplay/widgets/jellyfin_library_card.dart:159-196 — before extracting anything, compare `lib/themes/nipaplay/widgets/emby_library_card.dart` and `lib/themes/nipaplay/widgets/jellyfin_library_card.dart` as WHOLE FILES: this scan already matched 4 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. 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 (36 lines × 2) lib/services/remote_subtitle_service.dart:950— lib/services/remote_subtitle_service.dart:950-985 | lib/services/remote_subtitle_service.dart:1073-1108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/remote_subtitle_service.dart:950` 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 (33–35 lines × 2) lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:413— lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:413-445 | lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:482-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/bangumi_comments_widget.dart:413` it does not close everything it opens, so those 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 (33 lines × 3) lib/services/local_media_management_api.dart:793— lib/services/local_media_management_api.dart:793-825 | lib/services/local_media_share_service.dart:436-468 | lib/services/local_media_share_service.dart:819-851 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_management_api.dart:793` it begins part-way through the construct above it, so those 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 (32–33 lines × 2) lib/services/local_media_management_api.dart:874— lib/services/local_media_management_api.dart:874-906 | lib/services/local_media_share_service.dart:507-538 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_management_api.dart:874` it begins part-way through the construct above it, so those 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/local_media_management_api.dart:870` calls `normalize` and `lib/services/local_media_share_service.dart:505` 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 (30–31 lines × 2) lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:260— lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:260-289 | lib/themes/cupertino/widgets/cupertino_rating_sheet.dart:171-201 — before extracting anything, compare `lib/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart` and `lib/themes/cupertino/widgets/cupertino_rating_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 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/themes/cupertino/widgets/cupertino_bangumi_collection_sheet.dart:260` 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/themes/nipaplay/widgets/nipaplay_window.dart:356— lib/themes/nipaplay/widgets/nipaplay_window.dart:356-383 | lib/themes/nipaplay/widgets/nipaplay_window.dart:487-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/nipaplay_window.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 (28 lines × 5) lib/themes/nipaplay/widgets/audio_tracks_menu.dart:228— lib/themes/nipaplay/widgets/audio_tracks_menu.dart:228-255 | lib/themes/nipaplay/widgets/audio_tracks_menu.dart:387-414 | lib/themes/nipaplay/widgets/danmaku_tracks_menu.dart:203-230 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:841-868 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:1007-1034 — before extracting anything, compare `lib/themes/nipaplay/widgets/audio_tracks_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart` as WHOLE FILES: this scan already matched 3 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. 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/themes/nipaplay/widgets/audio_tracks_menu.dart:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:838` calls `_saveExternalSubtitles` and `lib/themes/nipaplay/widgets/audio_tracks_menu.dart:226` 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 (27–28 lines × 4) lib/themes/nipaplay/widgets/danmaku_list_menu.dart:635— lib/themes/nipaplay/widgets/danmaku_list_menu.dart:635-662 | lib/themes/nipaplay/widgets/danmaku_list_menu.dart:856-882 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:790-817 | lib/themes/nipaplay/widgets/subtitle_list_menu.dart:953-979 — before extracting anything, compare `lib/themes/nipaplay/widgets/danmaku_list_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_list_menu.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 92 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/themes/nipaplay/widgets/danmaku_list_menu.dart:635` 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 (68–69 lines × 2) lib/providers/shared_remote_library_provider.dart:1379— lib/providers/shared_remote_library_provider.dart:1379-1447 | lib/providers/shared_remote_library_provider.dart:1632-1699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/providers/shared_remote_library_provider.dart:1379` 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 (27–28 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:203— lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:203-229 | lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart:288-315 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart` and `lib/themes/nipaplay/widgets/jellyfin_quality_menu.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:203` it begins part-way through the construct above it, so those 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 (26–28 lines × 2) lib/themes/nipaplay/widgets/history_all_modal.dart:100— lib/themes/nipaplay/widgets/history_all_modal.dart:100-125 | lib/themes/nipaplay/widgets/rating_dialog.dart:115-142 — 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/themes/nipaplay/widgets/history_all_modal.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.
Duplicated block (27 lines × 3) lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:793— lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart:793-819 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1382-1408 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:399-425 — before extracting anything, compare `lib/themes/nipaplay/widgets/batch_danmaku_dialog.dart` and `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 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/themes/nipaplay/widgets/batch_danmaku_dialog.dart:793` it begins part-way through the construct above it, so those 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–26 lines × 4) lib/themes/nipaplay/widgets/settings_item.dart:633— lib/themes/nipaplay/widgets/settings_item.dart:633-657 | lib/themes/nipaplay/widgets/settings_item.dart:669-693 | lib/themes/nipaplay/widgets/settings_item.dart:717-742 | lib/themes/nipaplay/widgets/settings_item.dart:800-824 — 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/themes/nipaplay/widgets/settings_item.dart:717` it does not close everything it opens, so those exact lines 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–26 lines × 2) lib/main.dart:1244— lib/main.dart:1244-1269 | lib/utils/launch_file_handler.dart:12-36 — 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:1244` it does not close everything it opens, so those 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–25 lines × 4) lib/services/remote_subtitle_service.dart:936— lib/services/remote_subtitle_service.dart:936-960 | lib/services/remote_subtitle_service.dart:1059-1083 | lib/services/remote_subtitle_service.dart:1169-1191 | lib/services/remote_subtitle_service.dart:1287-1309 — 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/services/remote_subtitle_service.dart:936` it begins part-way through the construct above it, so those 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/services/remote_subtitle_service.dart:1193` calls `debugPrint` and `lib/services/remote_subtitle_service.dart:961` 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 (24–25 lines × 3) lib/services/dandanplay_service_stub.dart:1504— lib/services/dandanplay_service_stub.dart:1504-1528 | lib/services/dandanplay_service_stub.dart:1881-1904 | lib/services/dandanplay_service_stub.dart:2087-2111 — 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/dandanplay_service_stub.dart:1504` 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–25 lines × 2) lib/utils/chinese_converter.dart:91— lib/utils/chinese_converter.dart:91-113 | lib/utils/chinese_converter.dart:225-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/utils/chinese_converter.dart:225` it does not close everything it opens, so those 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–24 lines × 7) lib/providers/shared_remote_library_provider.dart:1100— lib/providers/shared_remote_library_provider.dart:1100-1123 | lib/providers/shared_remote_library_provider.dart:1219-1241 | lib/providers/shared_remote_library_provider.dart:1336-1358 | lib/providers/shared_remote_library_provider.dart:1401-1423 | lib/providers/shared_remote_library_provider.dart:1497-1519 | lib/providers/shared_remote_library_provider.dart:1591-1613 | lib/providers/shared_remote_library_provider.dart:1653-1675 — all 7 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 (24 lines × 3) lib/themes/nipaplay/widgets/library_management_tab.dart:2018— lib/themes/nipaplay/widgets/library_management_tab.dart:2018-2041 | lib/themes/nipaplay/widgets/library_management_tab.dart:2049-2072 | lib/themes/nipaplay/widgets/library_management_tab.dart:2081-2104 — 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/themes/nipaplay/widgets/library_management_tab.dart:2018` it does not close everything it opens, so those 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–24 lines × 3) lib/themes/nipaplay/widgets/playlist_menu.dart:785— lib/themes/nipaplay/widgets/playlist_menu.dart:785-808 | lib/themes/nipaplay/widgets/playlist_menu.dart:887-910 | lib/themes/nipaplay/widgets/playlist_menu.dart:948-970 — 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 (21–24 lines × 2) lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:478— lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:478-501 | lib/themes/nipaplay/widgets/large_screen_settings_panel.dart:487-507 — before extracting anything, compare `lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart` and `lib/themes/nipaplay/widgets/large_screen_settings_panel.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. 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/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:478` 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 (23 lines × 5) lib/themes/nipaplay/widgets/audio_tracks_menu.dart:249— lib/themes/nipaplay/widgets/audio_tracks_menu.dart:249-271 | lib/themes/nipaplay/widgets/audio_tracks_menu.dart:408-430 | lib/themes/nipaplay/widgets/seek_step_menu.dart:297-319 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:862-884 | lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart:1028-1050 — before extracting anything, compare `lib/themes/nipaplay/widgets/audio_tracks_menu.dart` and `lib/themes/nipaplay/widgets/subtitle_tracks_menu.dart` as WHOLE FILES: this scan already matched 3 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. 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/themes/nipaplay/widgets/audio_tracks_menu.dart:249` it begins part-way through the construct above it, so those exact lines 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–23 lines × 3) lib/providers/shared_remote_library_provider.dart:928— lib/providers/shared_remote_library_provider.dart:928-950 | lib/providers/shared_remote_library_provider.dart:1780-1800 | lib/providers/shared_remote_library_provider.dart:1856-1876 — 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 (19–21 lines × 4) lib/services/dandanplay_service_io.dart:1942— lib/services/dandanplay_service_io.dart:1942-1960 | lib/services/dandanplay_service_io.dart:2419-2437 | lib/services/dandanplay_service_stub.dart:1411-1431 | lib/services/dandanplay_service_stub.dart:1792-1812 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_stub.dart:1411` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) lib/services/emby_service.dart:523— lib/services/emby_service.dart:523-543 | lib/services/jellyfin_service.dart:400-418 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–21 lines × 3) lib/themes/nipaplay/widgets/dashboard_home_page_models.dart:101— lib/themes/nipaplay/widgets/dashboard_home_page_models.dart:101-104 | lib/themes/nipaplay/widgets/hover_scale_text_button.dart:82-102 | lib/themes/nipaplay/widgets/search_bar_action_button.dart:62-82 — before extracting anything, compare `lib/themes/nipaplay/widgets/hover_scale_text_button.dart` and `lib/themes/nipaplay/widgets/search_bar_action_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/dashboard_home_page_models.dart:101` it does not close everything it opens, so those 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–20 lines × 3) lib/themes/nipaplay/widgets/library_management_tab.dart:816— lib/themes/nipaplay/widgets/library_management_tab.dart:816-834 | lib/themes/nipaplay/widgets/library_management_tab.dart:1639-1658 | lib/themes/nipaplay/widgets/library_management_tab.dart:4815-4833 — 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/themes/nipaplay/widgets/library_management_tab.dart:816` 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 (33 lines × 2) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:485— lib/danmaku_dfm/dfm_plus_layout_bridge.dart:485-517 | lib/danmaku_next/next2_layout_bridge.dart:161-193 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_layout_bridge.dart` and `lib/danmaku_next/next2_layout_bridge.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/danmaku_dfm/dfm_plus_layout_bridge.dart:485` it does not close everything it opens, so those exact lines 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–20 lines × 2) lib/pages/webdav_browser_page.dart:904— lib/pages/webdav_browser_page.dart:904-920 | lib/pages/webdav_browser_page.dart:1391-1410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/pages/webdav_browser_page.dart:904` it begins part-way through the construct above it, so those exact lines 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 × 4) lib/pages/new_series_page.dart:507— lib/pages/new_series_page.dart:507-524 | lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:221-238 | lib/themes/nipaplay/widgets/network_media_library_view.dart:849-866 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:737-754 — before extracting anything, compare `lib/pages/new_series_page.dart` and `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/pages/new_series_page.dart:507` it does not close everything it opens, so those exact lines 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 × 4) lib/player_abstraction/media_kit_player_adapter.dart:2580— lib/player_abstraction/media_kit_player_adapter.dart:2580-2597 | lib/providers/shared_remote_library_provider.dart:658-675 | lib/services/shared_remote_playback_sync_service.dart:240-257 | lib/utils/remote_media_fetcher.dart:401-417 — before extracting anything, compare `lib/providers/shared_remote_library_provider.dart` and `lib/utils/remote_media_fetcher.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/player_abstraction/media_kit_player_adapter.dart:2580` it does not close everything it opens, so those exact lines 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–18 lines × 2) lib/services/emby_service.dart:631— lib/services/emby_service.dart:631-645 | lib/services/jellyfin_service.dart:492-509 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:631` it begins part-way through the construct above it, so those 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 × 4) lib/themes/nipaplay/widgets/playlist_menu.dart:784— lib/themes/nipaplay/widgets/playlist_menu.dart:784-800 | lib/themes/nipaplay/widgets/playlist_menu.dart:886-902 | lib/themes/nipaplay/widgets/playlist_menu.dart:947-962 | lib/themes/nipaplay/widgets/playlist_menu.dart:983-998 — 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/themes/nipaplay/widgets/playlist_menu.dart:784` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–17 lines × 3) lib/services/local_media_management_api.dart:775— lib/services/local_media_management_api.dart:775-791 | lib/services/local_media_share_service.dart:422-435 | lib/services/local_media_share_service.dart:805-818 — before extracting anything, compare `lib/services/local_media_management_api.dart` and `lib/services/local_media_share_service.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 194 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/services/local_media_management_api.dart:775` it does not close everything it opens, so those 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 × 8) lib/services/webdav_service.dart:1536— lib/services/webdav_service.dart:1536-1551 | lib/services/webdav_service.dart:1571-1586 | lib/services/webdav_service.dart:1595-1610 | lib/services/webdav_service.dart:1619-1634 | lib/services/webdav_service.dart:1650-1665 | lib/services/webdav_service.dart:1670-1685 | lib/services/webdav_service.dart:1691-1706 | lib/services/webdav_service.dart:1714-1729 — 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.
Duplicated block (16 lines × 6) lib/services/dandanplay_service_io.dart:2015— lib/services/dandanplay_service_io.dart:2015-2030 | lib/services/dandanplay_service_io.dart:2486-2501 | lib/services/dandanplay_service_io.dart:2681-2696 | lib/services/dandanplay_service_stub.dart:1509-1524 | lib/services/dandanplay_service_stub.dart:1885-1900 | lib/services/dandanplay_service_stub.dart:2092-2107 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:2015` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/dandanplay_service_io.dart:2032` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:1526` 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 × 4) lib/services/remote_subtitle_service.dart:965— lib/services/remote_subtitle_service.dart:965-980 | lib/services/remote_subtitle_service.dart:1088-1103 | lib/services/remote_subtitle_service.dart:1202-1217 | lib/services/remote_subtitle_service.dart:1320-1335 — 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/services/remote_subtitle_service.dart:965` it does not close everything it opens, so those exact lines 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/pages/anime_detail_page.dart:2997— lib/pages/anime_detail_page.dart:2997-3012 | lib/themes/nipaplay/widgets/immersive_episode_rail.dart:311-326 | lib/themes/nipaplay/widgets/immersive_episode_rail.dart:419-433 — 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 (13–16 lines × 3) lib/themes/nipaplay/widgets/custom_slider.dart:87— lib/themes/nipaplay/widgets/custom_slider.dart:87-99 | lib/themes/nipaplay/widgets/history_all_modal.dart:276-291 | lib/themes/nipaplay/widgets/translation_button.dart:120-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/themes/nipaplay/widgets/custom_slider.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 (14–16 lines × 3) lib/widgets/danmaku_container.dart:564— lib/widgets/danmaku_container.dart:564-577 | lib/widgets/danmaku_container.dart:639-654 | lib/widgets/danmaku_container.dart:673-686 — 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/danmaku_container.dart:639` it begins part-way through the construct above it, so those 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 (14–16 lines × 2) lib/services/emby_dandanplay_matcher.dart:1253— lib/services/emby_dandanplay_matcher.dart:1253-1266 | lib/services/jellyfin_dandanplay_matcher.dart:1319-1334 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.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.
Duplicated block (13–16 lines × 2) lib/services/web_api_service.dart:290— lib/services/web_api_service.dart:290-302 | lib/services/web_api_service.dart:318-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart 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/web_api_service.dart:290` 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–16 lines × 2) lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:120— lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:120-129 | lib/themes/nipaplay/widgets/danmaku_settings_menu.dart:1219-1234 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/nipaplay/widgets/danmaku_settings_menu.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 4) lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:96— lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:96-109 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:127-141 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:132-145 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:163-177 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.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. 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–15 lines × 3) lib/services/full_backup_service.dart:776— lib/services/full_backup_service.dart:776-790 | lib/services/full_backup_service.dart:859-867 | lib/services/full_backup_service.dart:1051-1058 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 8) lib/providers/shared_remote_library_provider.dart:1080— lib/providers/shared_remote_library_provider.dart:1080-1093 | lib/providers/shared_remote_library_provider.dart:1101-1114 | lib/providers/shared_remote_library_provider.dart:1220-1232 | lib/providers/shared_remote_library_provider.dart:1337-1349 | lib/providers/shared_remote_library_provider.dart:1402-1414 | lib/providers/shared_remote_library_provider.dart:1498-1510 | lib/providers/shared_remote_library_provider.dart:1592-1604 | lib/providers/shared_remote_library_provider.dart:1654-1666 — 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.
Duplicated block (14 lines × 8) lib/services/dandanplay_service_io.dart:1140— lib/services/dandanplay_service_io.dart:1140-1153 | lib/services/dandanplay_service_io.dart:2015-2028 | lib/services/dandanplay_service_io.dart:2486-2499 | lib/services/dandanplay_service_io.dart:2681-2694 | lib/services/dandanplay_service_stub.dart:1163-1176 | lib/services/dandanplay_service_stub.dart:1509-1522 | lib/services/dandanplay_service_stub.dart:1885-1898 | lib/services/dandanplay_service_stub.dart:2092-2105 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/services/dandanplay_service_io.dart:2032` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:1526` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 6) lib/services/dandanplay_service_io.dart:2679— lib/services/dandanplay_service_io.dart:2679-2692 | lib/services/dandanplay_service_stub.dart:584-597 | lib/services/dandanplay_service_stub.dart:1161-1174 | lib/services/dandanplay_service_stub.dart:1507-1520 | lib/services/dandanplay_service_stub.dart:1883-1896 | lib/services/dandanplay_service_stub.dart:2090-2103 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/services/dandanplay_service_io.dart:2677` calls `debugPrint` and `lib/services/dandanplay_service_stub.dart:1505` 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–14 lines × 5) lib/themes/nipaplay/widgets/settings_item.dart:601— lib/themes/nipaplay/widgets/settings_item.dart:601-613 | lib/themes/nipaplay/widgets/settings_item.dart:633-646 | lib/themes/nipaplay/widgets/settings_item.dart:669-682 | lib/themes/nipaplay/widgets/settings_item.dart:718-731 | lib/themes/nipaplay/widgets/settings_item.dart:800-813 — 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. 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 × 4) lib/services/emby_service.dart:799— lib/services/emby_service.dart:799-811 | lib/services/emby_service.dart:853-866 | lib/services/jellyfin_service.dart:667-680 | lib/services/jellyfin_service.dart:714-727 — before extracting anything, compare `lib/services/emby_service.dart` and `lib/services/jellyfin_service.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 437 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/services/emby_service.dart:853` it begins part-way through the construct above it, so those 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 × 3) lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:182— lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart:182-195 | lib/themes/nipaplay/widgets/network_media_library_view.dart:503-515 | lib/themes/nipaplay/widgets/network_media_library_view.dart:813-825 — before extracting anything, compare `lib/themes/nipaplay/widgets/dandanplay_remote_library_view.dart` and `lib/themes/nipaplay/widgets/network_media_library_view.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 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/themes/nipaplay/widgets/dandanplay_remote_library_view.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.
Duplicated block (12–14 lines × 2) lib/services/smb_proxy_service.dart:149— lib/services/smb_proxy_service.dart:149-160 | lib/services/webdav_proxy_service.dart:160-173 — before extracting anything, compare `lib/services/smb_proxy_service.dart` and `lib/services/webdav_proxy_service.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/services/smb_proxy_service.dart:149` it does not close everything it opens, so those 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 × 5) lib/services/dandanplay_service_stub.dart:1436— lib/services/dandanplay_service_stub.dart:1436-1448 | lib/services/dandanplay_service_stub.dart:1530-1542 | lib/services/dandanplay_service_stub.dart:1817-1829 | lib/services/dandanplay_service_stub.dart:1906-1918 | lib/services/dandanplay_service_stub.dart:1974-1986 — 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/dandanplay_service_stub.dart:1436` 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/services/dandanplay_service_stub.dart:1529` calls `_clearBangumiDetailsCache` and `lib/services/dandanplay_service_stub.dart:1435` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 5) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:62— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:62-74 | lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:99-110 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:320-331 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_tracks_pane.dart:77-88 | lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:267-278 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_tracks_pane.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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–12 lines × 6) lib/services/dandanplay_service_io.dart:1250— lib/services/dandanplay_service_io.dart:1250-1259 | lib/services/dandanplay_service_io.dart:1280-1289 | lib/services/dandanplay_service_io.dart:1316-1327 | lib/services/dandanplay_service_stub.dart:2149-2158 | lib/services/dandanplay_service_stub.dart:2182-2191 | lib/services/dandanplay_service_stub.dart:2221-2232 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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/services/dandanplay_service_io.dart:1250` it begins part-way through the construct above it, so those 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/services/dandanplay_service_io.dart:1261` calls `_ensureVideoInfoTitles` and `lib/services/dandanplay_service_io.dart:1329` 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–12 lines × 3) lib/services/emby_dandanplay_matcher.dart:1753— lib/services/emby_dandanplay_matcher.dart:1753-1764 | lib/services/jellyfin_dandanplay_matcher.dart:1801-1812 | lib/themes/nipaplay/widgets/translation_button.dart:114-124 — before extracting anything, compare `lib/services/emby_dandanplay_matcher.dart` and `lib/services/jellyfin_dandanplay_matcher.dart` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 835 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/services/emby_dandanplay_matcher.dart:1753` it does not close everything it opens, so those exact lines 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–12 lines × 2) lib/services/episode_navigation_service.dart:1072— lib/services/episode_navigation_service.dart:1072-1079 | lib/services/remote_subtitle_service.dart:1983-1994 — 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 (9–11 lines × 6) lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:60— lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:60-69 | lib/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:97-105 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_offset_pane.dart:66-76 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart:318-326 | lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_tracks_pane.dart:75-83 | lib/themes/cupertino/widgets/player_menu/cupertino_jellyfin_quality_pane.dart:265-273 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_settings_pane.dart` and `lib/themes/cupertino/widgets/player_menu/cupertino_danmaku_tracks_pane.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/themes/cupertino/widgets/player_menu/cupertino_audio_tracks_pane.dart:60` it does not close everything it opens, so those 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 × 4) lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:544— lib/themes/nipaplay/widgets/bangumi_collection_dialog.dart:544-553 | lib/themes/nipaplay/widgets/custom_media_info_dialog.dart:1334-1344 | lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart:351-360 | lib/themes/nipaplay/widgets/smb_connection_dialog.dart:349-358 — before extracting anything, compare `lib/themes/nipaplay/widgets/custom_media_info_dialog.dart` and `lib/themes/nipaplay/widgets/manual_danmaku_dialog.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/themes/nipaplay/widgets/bangumi_collection_dialog.dart:544` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–11 lines × 2) lib/services/dandanplay_service_io.dart:485— lib/services/dandanplay_service_io.dart:485-495 | lib/services/dandanplay_service_stub.dart:379-386 — before extracting anything, compare `lib/services/dandanplay_service_io.dart` and `lib/services/dandanplay_service_stub.dart` as WHOLE FILES: this scan already matched 59 separate duplicated blocks between them, totalling at least 1201 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. 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/services/dandanplay_service_stub.dart:386` calls `setString`, `encode` and `lib/services/dandanplay_service_io.dart:495` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 3) lib/themes/nipaplay/widgets/library_management_tab.dart:951— lib/themes/nipaplay/widgets/library_management_tab.dart:951-961 | lib/themes/nipaplay/widgets/library_management_tab.dart:964-974 | lib/themes/nipaplay/widgets/library_management_tab.dart:976-985 — 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/themes/nipaplay/widgets/library_management_tab.dart:951` it begins part-way through the construct above it, so those 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/themes/nipaplay/widgets/library_management_tab.dart:964` calls `compareTo` and `lib/themes/nipaplay/widgets/library_management_tab.dart:976` 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 (9–11 lines × 2) lib/utils/chinese_converter.dart:50— lib/utils/chinese_converter.dart:50-58 | lib/utils/chinese_converter.dart:173-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 4) lib/models/emby_model.dart:100— lib/models/emby_model.dart:100-109 | lib/models/emby_model.dart:414-423 | lib/models/jellyfin_model.dart:123-132 | lib/models/jellyfin_model.dart:439-448 — before extracting anything, compare `lib/models/emby_model.dart` and `lib/models/jellyfin_model.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 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/models/emby_model.dart:100` it does not close everything it opens, so those 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–8 lines × 4) lib/player_abstraction/mdk_player_adapter_io.dart:606— lib/player_abstraction/mdk_player_adapter_io.dart:606-611 | lib/player_abstraction/video_player_adapter.dart:560-566 | lib/player_abstraction/video_player_adapter.dart:573-578 | lib/player_abstraction/video_player_adapter.dart:785-792 — 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/player_abstraction/mdk_player_adapter_io.dart:606` it does not close everything it opens, so those exact lines 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 × 5) lib/services/dandanplay_service_stub.dart:633— lib/services/dandanplay_service_stub.dart:633-639 | lib/services/dandanplay_service_stub.dart:1041-1048 | lib/services/dandanplay_service_stub.dart:1455-1462 | lib/services/dandanplay_service_stub.dart:1837-1844 | lib/services/dandanplay_service_stub.dart:2047-2054 — 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/dandanplay_service_stub.dart:633` it begins part-way through the construct above it, so those 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 (4–6 lines × 5) lib/themes/nipaplay/widgets/library_management_tab.dart:1095— lib/themes/nipaplay/widgets/library_management_tab.dart:1095-1098 | lib/themes/nipaplay/widgets/library_management_tab.dart:4921-4924 | lib/themes/nipaplay/widgets/library_management_tab.dart:5414-5419 | lib/themes/nipaplay/widgets/library_management_tab.dart:5619-5624 | lib/themes/nipaplay/widgets/shared_remote_library_view.dart:1400-1405 — before extracting anything, compare `lib/themes/nipaplay/widgets/library_management_tab.dart` and `lib/themes/nipaplay/widgets/shared_remote_library_view.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 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/themes/nipaplay/widgets/library_management_tab.dart:5414` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) lib/danmaku_dfm/dfm_plus_layout_bridge.dart:471— lib/danmaku_dfm/dfm_plus_layout_bridge.dart:471-475 | lib/danmaku_next/next2_layout_bridge.dart:141-145 | lib/danmaku_next/nipaplay_next_engine.dart:1075-1079 | lib/danmaku_next/nipaplay_next_old_engine.dart:909-913 — before extracting anything, compare `lib/danmaku_dfm/dfm_plus_layout_bridge.dart` and `lib/danmaku_next/next2_layout_bridge.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (5 lines × 3) lib/models/external_player_session/other_session.dart:57— lib/models/external_player_session/other_session.dart:57-61 | lib/models/external_player_session/potplayer_session.dart:92-96 | lib/models/external_player_session/vlc_session.dart:56-62 — 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. 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/models/external_player_session/vlc_session.dart:52` calls `value` and `lib/models/external_player_session/other_session.dart:53` 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/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:42— lib/themes/cupertino/widgets/player_menu/cupertino_playback_rate_pane.dart:42-49 | lib/themes/cupertino/widgets/player_menu/cupertino_seek_step_pane.dart:56-63 | lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart:202-209 | lib/themes/nipaplay/widgets/playback_rate_menu.dart:50-57 | lib/themes/nipaplay/widgets/seek_step_menu.dart:51-58 | lib/themes/nipaplay/widgets/subtitle_settings_menu.dart:238-245 — before extracting anything, compare `lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_settings_pane.dart` and `lib/themes/nipaplay/widgets/subtitle_settings_menu.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (203 lines × 2) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:246— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:246-448 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:259-461 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift: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 (35 lines × 2) rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:450— rust_builder/ios/Classes/RustLibNipaplayPlugin.swift:450-484 | rust_builder/macos/Classes/RustLibNipaplayPlugin.swift:463-497 — before extracting anything, compare `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift` and `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 404 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 6) rust/src/next2_engine/ffi.rs:74— rust/src/next2_engine/ffi.rs:74-79 | rust/src/next2_engine/ffi.rs:115-120 | rust/src/next2_engine/ffi.rs:149-154 | rust/src/next2_engine/ffi.rs:251-256 | rust/src/next2_engine/ffi.rs:375-380 | rust/src/next2_engine/ffi.rs:408-413 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/src/next2_engine/ffi.rs: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.
X18 · Disposal-pattern correctness· Owned disposable field is never released · ×1
Owned disposable field is never released packages/fluent_ui-4.15.1/lib/src/controls/form/auto_suggest_box.dart:476— `AutoSuggestBoxState` carries a disposal duty — a `State`, so the framework calls its `dispose()` when it leaves the tree — and it creates `_overlayNode` itself (line 476, `FocusScopeNode`), which makes that instance its own. Nothing in the class releases it — no `_overlayNode.dispose()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `FocusScopeNode` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_overlayNode.dispose();` in `dispose()` before `super.dispose()`.
Duplicated predicate lib/danmaku_dfm/dfm_plus_overlay.dart:674— `!Next2TextureBridge.isSupported || _layoutSize.isEmpty` appears character-identically in 2 files — lib/danmaku_dfm/dfm_plus_overlay.dart, lib/danmaku_next/nipaplay_next2_overlay.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/themes/nipaplay/widgets/large_screen_top_status_overlay.dart:81— `!_batteryAvailable || !_supportsBatteryPlugin` appears character-identically in 2 files — lib/themes/nipaplay/widgets/large_screen_top_status_overlay.dart, lib/themes/nipaplay/widgets/mobile_playback_status.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/providers/emby_provider.dart:209— `!_disposed && revision == _mediaLoadRevision` appears character-identically in 2 files — lib/providers/emby_provider.dart, lib/providers/jellyfin_provider.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/providers/emby_provider.dart:245— `!_disposed && revision == _movieLoadRevision` appears character-identically in 2 files — lib/providers/emby_provider.dart, lib/providers/jellyfin_provider.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/themes/nipaplay/widgets/brightness_gesture_area.dart:30— `!_hasStartedAdjustment && _accumulatedDrag > _minDragDistance` appears character-identically in 2 files — lib/themes/nipaplay/widgets/brightness_gesture_area.dart, lib/themes/nipaplay/widgets/volume_gesture_area.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/emby_service.dart:1238— `!_isConnected || _accessToken == null || _userId == null` appears character-identically in 2 files — lib/services/emby_service.dart, lib/services/jellyfin_service.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/video_player_state/video_player_state_danmaku.dart:163— `!_isDisposed && _currentVideoPath == targetVideoPath && _playbackGeneration == targetGeneration` appears character-identically in 2 files — lib/utils/video_player_state/video_player_state_danmaku.dart, lib/utils/video_player_state/video_player_state_metadata.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/video_player_state/video_player_state_metadata.dart:104— `!_isDisposed && _currentVideoPath == videoPath && _playbackGeneration == targetGeneration` appears character-identically in 2 files — lib/utils/video_player_state/video_player_state_metadata.dart, lib/utils/video_player_state/video_player_state_streaming.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/video_player_state/video_player_state_player_setup.dart:1406— `!_isDisposed && generation == _playbackGeneration && _currentVideoPath == videoPath` appears character-identically in 2 files — lib/utils/video_player_state/video_player_state_player_setup.dart, lib/utils/video_player_state/video_player_state_streaming.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/themes/nipaplay/widgets/large_screen_player_menu_panel.dart:551— `!_isFocusInsideContentScope(FocusManager.instance.primaryFocus) && !_ensureContentFocus()` appears character-identically in 2 files — lib/themes/nipaplay/widgets/large_screen_player_menu_panel.dart, lib/themes/nipaplay/widgets/large_screen_settings_panel.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/dandanplay_service_io.dart:91— `!_isLoggedIn || _token == null || _token!.isEmpty` appears character-identically in 2 files — lib/services/dandanplay_service_io.dart, lib/services/dandanplay_service_stub.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/emby_playback_sync_service.dart:331— `!_isPlaying || _currentItemId == null || _currentPlaySessionId == null` appears character-identically in 2 files — lib/services/emby_playback_sync_service.dart, lib/services/jellyfin_playback_sync_service.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart:593— `!_isSharedRemoteManagementStreamUrl(a) || !_isSharedRemoteManagementStreamUrl(b)` appears character-identically in 2 files — lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart, lib/themes/nipaplay/widgets/playlist_menu.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/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart:301— `!_scrollController.hasClients || _visibleEntries.isEmpty` appears character-identically in 2 files — lib/themes/cupertino/widgets/player_menu/cupertino_subtitle_list_pane.dart, lib/themes/nipaplay/widgets/subtitle_list_menu.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/anime4k_shader_manager.dart:121— `!await outputFile.exists() || (await outputFile.length()) != bytes.length` appears character-identically in 2 files — lib/utils/anime4k_shader_manager.dart, lib/utils/crt_shader_manager.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/services/playback_source_service.dart:722— `!entry.isDirectory && SMBService.instance.isVideoFile(entry.name)` appears character-identically in 3 files — lib/services/playback_source_service.dart, lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart, lib/themes/nipaplay/widgets/playlist_menu.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/episode_navigation_service.dart:1250— `!entry.isDirectory && WebDAVService.instance.isVideoFile(entry.name)` appears character-identically in 4 files — lib/services/episode_navigation_service.dart, lib/services/playback_source_service.dart, lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart, lib/themes/nipaplay/widgets/playlist_menu.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/playback_source_service.dart:332— `!entry.isDirectory && provider.isRemoteFilePlayable(entry)` appears character-identically in 3 files — lib/services/playback_source_service.dart, lib/themes/cupertino/widgets/player_menu/cupertino_playlist_pane.dart, lib/themes/nipaplay/widgets/playlist_menu.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/emby_service.dart:1771— `!fileName.toLowerCase().endsWith('.mp4') && !fileName.toLowerCase().endsWith('.mkv') && !fileName.toLowerCase().endsWith('.avi')` appears character-identically in 2 files — lib/services/emby_service.dart, lib/services/jellyfin_service.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/player_abstraction/erika_player_adapter.dart:476— `!force && signature == _lastFrameSignature` appears character-identically in 2 files — lib/player_abstraction/erika_player_adapter.dart, lib/widgets/macos_native_video_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/services/emby_service.dart:1371— `!forceDirectPlay && transcodingUrl != null && transcodingUrl.isNotEmpty` appears character-identically in 2 files — lib/services/emby_service.dart, lib/services/jellyfin_service.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/video_player_state/video_player_state_initialization.dart:262— `!globals.isMobilePlatform || _context == null` appears character-identically in 2 files — lib/utils/video_player_state/video_player_state_initialization.dart, lib/utils/video_player_state/video_player_state_playback_controls.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/globals.dart:210— `!kIsWeb && (Platform.isWindows || Platform.isLinux)` appears character-identically in 2 files — lib/utils/globals.dart, lib/utils/video_player_state/video_player_state_preferences.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/video_player_state/video_player_state_playback_controls.dart:24— `!kIsWeb && Platform.isMacOS && Platform.environment['NIPAPLAY_MACOS_HDR_EXIT_TRACE'] == '1'` appears character-identically in 2 files — lib/utils/video_player_state/video_player_state_playback_controls.dart, lib/utils/video_player_state/video_player_state_streaming.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate lib/utils/video_player_state.dart:1029— `!kIsWeb && Platform.isWindows && player.getPlayerKernelName() == 'Media Kit'` appears character-identically in 2 files — lib/utils/video_player_state.dart, lib/utils/video_player_state/video_player_state_playback_controls.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.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations.dart:49— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ar.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_be.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_bn.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ca.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_cs.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_de.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_el.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_en.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_es.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_fa.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_fr.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_he.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_hi.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_hr.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_hu.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_id.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_it.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ja.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ko.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ku.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ms.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_my.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_ne.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Blanket warning suppression packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations_nl.dart:5— `// ignore_for_file: type=lint` switches every lint off for the whole file — hidden debt. Ignore the specific lint on the specific line, with a justification, instead.
Silent fallback default in catch REDACTED:923— `queryFileSize` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch .github/workflows/scripts/generate-build-info-json.py:16— `_run` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch .github/workflows/scripts/generate-build-info-json.py:32— `_read_file` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch lib/controllers/user_activity_controller.dart:209— `formatTime` 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/cpp_native/bindings/similarity_engine_io.dart:199— `pairSimilarity` turns every thrown error into `0.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/player_abstraction/mdk_player_adapter_io.dart:469— `bufferedPosition` 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/plugins/plugin_service.dart:1649— `_extractBlockWords` 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/plugins/plugin_service.dart:1677— `_extractUiEntries` 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/plugins/plugin_service.dart:1698— `_extractDanmakuRendererDeclarations` 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/plugins/plugin_storage_impl_io.dart:105— `loadPluginIndex` 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/services/anime_deletion_tombstones.dart:41— `_readRaw` 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/services/media_server_watch_history_sync.dart:101— `_owners` 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/services/remote_control_client_service.dart:84— `_collectSelfHostPortKeys` 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/services/remote_control_client_service.dart:290— `_safeLocalHostname` 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/services/remote_control_settings.dart:85— `getTrustedDevices` 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/services/remote_subtitle_service.dart:960— `_listManagedLibraryCandidates` 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/services/remote_subtitle_service.dart:1083— `_listSharedRemoteCandidates` 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/services/security_bookmark_service.dart:208— `_getPathFromKey` 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 third_party/smb_connect/lib/src/connect/impl/smb1/com/smb_com_tree_connect_and_x.dart:125— `writeBytesWireFormat` 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 third_party/smb_connect/lib/src/connect/impl/smb1/com/smb_com_tree_connect_and_x_response.dart:74— `readBytesWireFormat` 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/themes/nipaplay/widgets/network_media_library_view.dart:1456— `_getCurrentViewTitle` 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.
Orphaned file lib/services/multi_address_server_service.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/danmaku_next/nipaplay_next_old_canvas_painter.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/danmaku_next/danmaku_sprite_atlas.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/emby_media_selection.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/services/emby_track_application.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/services/emby_media_selection_resolver.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/services/emby_media_selection_controller.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/server_profile_model.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/cpp_native/bindings/danmaku_parser_io.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/danmaku_next/nipaplay_next_old_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.
Orphaned file lib/services/emby_player_menu_selection.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 packages/danmaku_canvas/lib/danmaku_timeline.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/video_player_state/video_player_state_chapters.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/cpp_native/native_arena.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/themes/nipaplay/widgets/emby_media_selection_dialog.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/services/emby_release_name_parser.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/services/emby_media_source_catalog.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.
Fat interface: AppLocalizations (593 abstract methods) lib/l10n/app_localizations.dart:13— `AppLocalizations` declares 593 abstract methods: `appTitle`, `tabHome`, `tabVideoPlay`, `tabMediaLibrary`, `tabTorrentDownload`, `tabAccount`, `tabDanmakuConsole`, `externalPlayerConsoleTitle`, `externalPlayerConsoleEmptyTitle`, `externalPlayerConsoleEmptyDescription`, `externalPlayerConsoleAnime`, `externalPlayerConsoleEpisode`, `externalPlayerConsoleEpisodeId`, `externalPlayerConsoleProcessId`, `externalPlayerConsoleMediaPath`, `externalPlayerConsoleUnknownAnime`, `externalPlayerConsoleUnknownEpisode`, `externalPlayerConsoleProgress`, `externalPlayerConsoleProgressUnsupported`, `externalPlayerConsoleProgressLoading`, `externalPlayerConsoleTimestampLabel`, `externalPlayerConsoleTimestampHint`, `externalPlayerConsoleTimestampInvalid`, `externalPlayerConsoleTimestampSeek`, `externalPlayerConsoleDanmakuList`, `externalPlayerConsoleDanmakuStats`, `externalPlayerConsoleDanmakuEmpty`, `externalPlayerConsoleDanmakuUnknownSender`, `externalPlayerConsoleDanmakuSender`, `externalPlayerConsoleDanmakuTypeScroll`, `externalPlayerConsoleDanmakuTypeTop`, `externalPlayerConsoleDanmakuTypeBottom`, `externalPlayerConsoleDanmakuActive`, `externalPlayerConsoleDanmakuFollowEnabled`, `externalPlayerConsoleDanmakuFollowDisabled`, `externalPlayerConsoleDanmakuKeywordFilter`, `externalPlayerConsoleDanmakuKeywordHint`, `externalPlayerConsoleDanmakuKeywordAdd`, `externalPlayerConsoleDanmakuBlocked`, `externalPlayerConsoleDanmakuBlockModeKeyword`, and 553 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: FluentLocalizations (185 abstract methods) packages/fluent_ui-4.15.1/lib/l10n/generated/fluent_localizations.dart:51— `FluentLocalizations` declares 185 abstract methods: `backButtonTooltip`, `closeButtonLabel`, `searchLabel`, `closeNavigationTooltip`, `openNavigationTooltip`, `clickToSearch`, `modalBarrierDismissLabel`, `minimizeWindowTooltip`, `restoreWindowTooltip`, `closeWindowTooltip`, `dialogLabel`, `cutActionLabel`, `copyActionLabel`, `pasteActionLabel`, `selectAllActionLabel`, `undoActionLabel`, `newTabLabel`, `closeTabLabelSuffix`, `scrollTabBackwardLabel`, `scrollTabForwardLabel`, `noResultsFoundLabel`, `copyActionTooltip`, `cutActionTooltip`, `pasteActionTooltip`, `selectAllActionTooltip`, `undoActionTooltip`, `hour`, `minute`, `am`, `pm`, `month`, `day`, `year`, `pickADate`, `seeMore`, `seeLess`, `redLabel`, `greenLabel`, `blueLabel`, `opacityLabel`, and 145 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: ExternalPlayerLaunchSession (16 abstract methods) lib/models/external_player_session/session.dart:10— `ExternalPlayerLaunchSession` declares 16 abstract methods: `type`, `playerPath`, `mediaPath`, `processId`, `ipcPath`, `duration`, `position`, `isPaused`, `fraction`, `isClosed`, `launch`, `terminate`, `togglePause`, `seekToFraction`, `seekToPosition`, `refreshDanmaku`. 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: AbstractPlayer (29 abstract methods) lib/player_abstraction/abstract_player.dart:98— `AbstractPlayer` declares 29 abstract methods: `volume`, `playbackRate`, `state`, `textureId`, `media`, `mediaInfo`, `activeSubtitleTracks`, `activeAudioTracks`, `position`, `bufferedPosition`, `setBufferRange`, `supportsExternalSubtitles`, `updateTexture`, `setMedia`, `prepare`, `seek`, `dispose`, `snapshot`, `setDecoders`, `getDecoders`, `getProperty`, `setProperty`, `setVideoSurfaceSize`, `setChapter`, `playDirectly`, `pauseDirectly`, `setPlaybackRate`, `stepForward`, `stepBackward`. 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: MediaServerServiceBase (23 abstract methods) lib/services/media_server_service_base.dart:16— `MediaServerServiceBase` declares 23 abstract methods: `serviceName`, `serviceType`, `prefsKeyPrefix`, `serverNameFallback`, `notConnectedMessage`, `serverUrl`, `username`, `password`, `accessToken`, `userId`, `isConnected`, `isReady`, `selectedLibraryIds`, `currentProfile`, `currentAddressId`, `normalizeRequestPath`, `testConnection`, `performAuthentication`, `getServerId`, `getServerName`, `loadAvailableLibraries`, `loadTranscodeSettings`, `clearServiceData`. 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 (61 abstract methods) lib/src/rust/frb_generated.dart:97— `RustLibApi` declares 61 abstract methods: `crateApiDanmakuAnalyticsAnalyzeDensity`, `crateApiAssConverterAssResolveFontSize`, `crateApiIncrementalSyncBackupPrepareRestore`, `crateApiAssConverterConvertDanmakuToAss`, `crateApiAssConverterConvertPreparedDanmakuToAss`, `crateApiDanmakuAnalyticsDensityStats`, `crateApiDfmPlusDfmPlusDropLayout`, `crateApiDfmPlusDfmPlusFontMetrics`, `crateApiDfmPlusDfmPlusLayoutFrame`, `crateApiDfmPlusDfmPlusMeasureTextWidth`, `crateApiDfmPlusDfmPlusMeasureTextWidths`, `crateApiDfmPlusDfmPlusPrepareLayout`, `crateApiDfmPlusDfmPlusPrepareLayoutFull`, `crateApiFileScanDiffVideoFiles`, `crateApiDanmakuAnalyticsFindPeakSegments`, `crateApiMediaProbeHashFileHead`, `crateApiSimpleInitApp`, `crateApiPerformanceIsPerformanceProbeAvailable`, `crateApiTorrentIsTorrentEngineAvailable`, `crateApiMediaMetadataMediaBaseNameWithoutExtension`, `crateApiMediaMetadataMediaExtractAnimeTitleKeyword`, `crateApiMediaMetadataNaturalCompare`, `crateApiMediaMetadataNaturalCompareCaseSensitive`, `crateApiNext2Next2LayoutFrame`, `crateApiNext2Next2PrepareLayout`, `crateApiClientNotificationsNotifyClient`, `crateApiStartupCommandsParseStartupCommand`, `crateApiWebdavMultistatusParseWebdavMultistatus`, `crateApiMediaProbeProbeRemoteMedia`, `crateApiStartupCommandsReportStartupCommandResult`, `crateApiPerformanceSampleCpuCounters`, `crateApiPerformanceSampleGpuPercent`, `crateApiPerformanceSampleMemoryRssMb`, `crateApiPerformanceSamplePerformance`, `crateApiFileScanScanVideoFiles`, `crateApiDanmakuAnalyticsSmoothDensity`, `crateApiRemoteDirectorySortRemoteEntryIndices`, `crateApiClientNotificationsSubscribeClientNotifications`, `crateApiMediaMetadataSubtitleComputeMatchScore`, `crateApiMediaMetadataSubtitleExtractMatchTokens`, and 21 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 (276 abstract methods) lib/src/rust/frb_generated.io.dart:26— `RustLibApiImplPlatform` declares 276 abstract methods: `dco_decode_AnyhowException`, `dco_decode_StreamSink_client_notification_Sse`, `dco_decode_String`, `dco_decode_bool`, `dco_decode_box_autoadd_client_notification`, `dco_decode_box_autoadd_dfm_plus_frame_request`, `dco_decode_box_autoadd_dfm_plus_prepare_request`, `dco_decode_box_autoadd_f_64`, `dco_decode_box_autoadd_i_32`, `dco_decode_box_autoadd_i_64`, `dco_decode_box_autoadd_rust_ass_export_settings`, `dco_decode_box_autoadd_rust_next_2_frame_request`, `dco_decode_box_autoadd_rust_next_2_prepare_request`, `dco_decode_box_autoadd_u_32`, `dco_decode_client_notification`, `dco_decode_dfm_plus_danmaku_item`, `dco_decode_dfm_plus_font_metrics`, `dco_decode_dfm_plus_frame_item`, `dco_decode_dfm_plus_frame_layout`, `dco_decode_dfm_plus_frame_request`, `dco_decode_dfm_plus_prepare_request`, `dco_decode_dfm_plus_prepared_item`, `dco_decode_dfm_plus_prepared_layout`, `dco_decode_dfm_plus_raw_danmaku_item`, `dco_decode_f_64`, `dco_decode_i_32`, `dco_decode_i_64`, `dco_decode_list_String`, `dco_decode_list_bool`, `dco_decode_list_dfm_plus_danmaku_item`, `dco_decode_list_dfm_plus_frame_item`, `dco_decode_list_dfm_plus_prepared_item`, `dco_decode_list_dfm_plus_raw_danmaku_item`, `dco_decode_list_list_prim_u_8_strict`, `dco_decode_list_prim_f_64_loose`, `dco_decode_list_prim_f_64_strict`, `dco_decode_list_prim_i_64_strict`, `dco_decode_list_prim_u_32_strict`, `dco_decode_list_prim_u_8_loose`, `dco_decode_list_prim_u_8_strict`, and 236 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 (276 abstract methods) lib/src/rust/frb_generated.web.dart:28— `RustLibApiImplPlatform` declares 276 abstract methods: `dco_decode_AnyhowException`, `dco_decode_StreamSink_client_notification_Sse`, `dco_decode_String`, `dco_decode_bool`, `dco_decode_box_autoadd_client_notification`, `dco_decode_box_autoadd_dfm_plus_frame_request`, `dco_decode_box_autoadd_dfm_plus_prepare_request`, `dco_decode_box_autoadd_f_64`, `dco_decode_box_autoadd_i_32`, `dco_decode_box_autoadd_i_64`, `dco_decode_box_autoadd_rust_ass_export_settings`, `dco_decode_box_autoadd_rust_next_2_frame_request`, `dco_decode_box_autoadd_rust_next_2_prepare_request`, `dco_decode_box_autoadd_u_32`, `dco_decode_client_notification`, `dco_decode_dfm_plus_danmaku_item`, `dco_decode_dfm_plus_font_metrics`, `dco_decode_dfm_plus_frame_item`, `dco_decode_dfm_plus_frame_layout`, `dco_decode_dfm_plus_frame_request`, `dco_decode_dfm_plus_prepare_request`, `dco_decode_dfm_plus_prepared_item`, `dco_decode_dfm_plus_prepared_layout`, `dco_decode_dfm_plus_raw_danmaku_item`, `dco_decode_f_64`, `dco_decode_i_32`, `dco_decode_i_64`, `dco_decode_list_String`, `dco_decode_list_bool`, `dco_decode_list_dfm_plus_danmaku_item`, `dco_decode_list_dfm_plus_frame_item`, `dco_decode_list_dfm_plus_prepared_item`, `dco_decode_list_dfm_plus_raw_danmaku_item`, `dco_decode_list_list_prim_u_8_strict`, `dco_decode_list_prim_f_64_loose`, `dco_decode_list_prim_f_64_strict`, `dco_decode_list_prim_i_64_strict`, `dco_decode_list_prim_u_32_strict`, `dco_decode_list_prim_u_8_loose`, `dco_decode_list_prim_u_8_strict`, and 236 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: Configuration (33 abstract methods) third_party/smb_connect/lib/src/configuration.dart:12— `Configuration` declares 33 abstract methods: `debugPrint`, `debugPrintLowLevel`, `forceSmb1`, `random`, `bufferCache`, `minimumVersion`, `maximumVersion`, `isPort139FailoverEnabled`, `isUseUnicode`, `isUseBatching`, `nativeOs`, `nativeLanman`, `receiveBufferSize`, `sendBufferSize`, `soTimeout`, `connTimeout`, `responseTimeout`, `credentials`, `domain`, `username`, `password`, `capabilities`, `flags2`, `oemEncoding`, `localTimezone`, `pid`, `maximumBufferSize`, `transactionBufferSize`, `bufferCacheSize`, `listCount`, `listSize`, `getBatchLimit`, `machineId`. 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: Response (17 abstract methods) third_party/smb_connect/lib/src/connect/transport/response.dart:4— `Response` declares 17 abstract methods: `isReceived`, `setReceived`, `clearReceived`, `getGrantedCredits`, `getErrorCode`, `setMid`, `getMid`, `verifySignature`, `isVerifyFailed`, `isError`, `error`, `getExpiration`, `setExpiration`, `reset`, `getException`, `setException`, `getNextResponse`. 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 80 significant file(s) lose their only recent owner: lib/themes/nipaplay/widgets/dashboard_home_page_trending.dart, lib/themes/nipaplay/widgets/danmaku_list_menu.dart, lib/services/web_api_service.dart, lib/themes/cupertino/pages/settings/pages/cupertino_remote_controller_settings_page.dart, rust/src/api/next2.rs, lib/themes/nipaplay/pages/settings/debug_log_viewer_page.dart, lib/services/media_server_service_base.dart, lib/pages/new_series_page.dart (+72 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 26 significant file(s) lose their only recent owner: lib/themes/nipaplay/widgets/custom_media_info_dialog.dart, lib/services/full_backup_service.dart, lib/themes/nipaplay/widgets/immersive_anime_detail_scaffold.dart, lib/services/quarterly_review_cache.dart, lib/themes/nipaplay/widgets/immersive_episode_rail.dart, lib/danmaku_dfm/dfm_plus_layout_bridge.dart, lib/services/incremental_sync_transport.dart, lib/services/incremental_sync_repository.dart (+18 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 7 significant file(s) lose their only recent owner: lib/danmaku_next/danmaku_atlas_painter.dart, lib/cpp_native/bindings/danmaku_layout_io.dart, lib/utils/audio_track_manager.dart, lib/cpp_native/bindings/similarity_engine_io.dart, lib/cpp_native/bindings/native_bindings.dart, lib/cpp_native/bindings/danmaku_layout_web.dart, lib/plugins/similarity_ffi_service_io.dart. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 6 significant file(s) lose their only recent owner: lib/models/external_player_session/potplayer_session.dart, lib/models/external_player_session/vlc_session.dart, lib/services/danmaku/danmaku_service.dart, lib/models/danmaku/style.dart, lib/utils/external_player_danmaku_ass.dart, lib/utils/mpv_utils.dart. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 5 significant file(s) lose their only recent owner: lib/services/dandanplay_remote_service.dart, lib/utils/watch_history_auto_match_helper.dart, lib/themes/nipaplay/widgets/macos_hdr_probe_overlay.dart, packages/media_kit_video/common/darwin/Classes/plugin/VideoOutput.swift, lib/widgets/danmaku_track_offset_button.dart. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 4 significant file(s) lose their only recent owner: tool/ohos_mdk_smoke.dart, tool/ohos_erika_smoke.dart, lib/media_library/pick_local_media_directory.dart, lib/services/harmony_local_media_service.dart. Pair on, review, or document these before any departure.
README/code drift packages/adaptive_platform_ui/README.md:1284— packages/adaptive_platform_ui/README.md links to `.github/CONTRIBUTING.md`, but `packages/adaptive_platform_ui/.github/CONTRIBUTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/liquid_glass_widgets/README.md:21— packages/liquid_glass_widgets/README.md links to `docs/LIQUID_MORPH_ENGINE.md`, but `packages/liquid_glass_widgets/docs/LIQUID_MORPH_ENGINE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/liquid_glass_widgets/README.md:567— packages/liquid_glass_widgets/README.md links to `docs/ADAPTIVE_QUALITY.md`, but `packages/liquid_glass_widgets/docs/ADAPTIVE_QUALITY.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/adaptive_platform_ui/test/README.md:106— packages/adaptive_platform_ui/test/README.md claims "23 widgets", but the reader.Tree holds 739 Dart classes extending StatelessWidget or StatefulWidget. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
IC1 · Incompleteness & stubs· Empty method body · ×3
Empty method body packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:217— `startDragging` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:218— `updateDragging` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body packages/desktop_multi_window_ohos/lib/desktop_multi_window.dart:219— `endDragging` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Hand-rolled JSON/XML parsing via regex lib/utils/danmaku_xml_utils.dart:81— 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/cpp_native/bindings/danmaku_parser_io.dart:56— 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/cpp_native/bindings/danmaku_parser_io.dart:100— 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.
Documentation: no build, run or usage example packages/media_kit_video/README.md:1— `media_kit_video` is a published pub package (`pubspec.yaml` without `publish_to: none`) and neither `packages/media_kit_video/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.
Documentation: no build, run or usage example rust_builder/cargokit/build_tool/README.md:1— `build_tool` is runnable (`executables:` or `bin/` in its pub package) and neither `rust_builder/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.
D21 · Naming Consistency· `_matchWithDandanPlayAPI` spells `API` where 36 names in the project spell it `Api` · ×2
`_matchWithDandanPlayAPI` spells `API` where 36 names in the project spell it `Api` lib/services/emby_dandanplay_matcher.dart:677— 36 of 38 names in project repository.services spell the token `Api` (36 of 38; unit: names in project repository.services containing `Api`). Peers: repository.services.BangumiApiService (lib/services/bangumi_api_service.dart:11); DandanplayService.refreshWebApiBaseUrl (lib/services/dandanplay_service_io.dart:196); DandanplayService.getApiBaseUrl (lib/services/dandanplay_service_io.dart:200); DandanplayService.getAccountApiBaseUrl (lib/services/dandanplay_service_io.dart:205); DandanplayService._fetchBangumiDetailsFromApi (lib/services/dandanplay_service_io.dart:2116). Rename to `_matchWithDandanPlayApi`. [rule N6]
`_matchWithDandanPlayAPI` spells `API` where 36 names in the project spell it `Api` lib/services/jellyfin_dandanplay_matcher.dart:710— 36 of 38 names in project repository.services spell the token `Api` (36 of 38; unit: names in project repository.services containing `Api`). Peers: repository.services.BangumiApiService (lib/services/bangumi_api_service.dart:11); DandanplayService.refreshWebApiBaseUrl (lib/services/dandanplay_service_io.dart:196); DandanplayService.getApiBaseUrl (lib/services/dandanplay_service_io.dart:200); DandanplayService.getAccountApiBaseUrl (lib/services/dandanplay_service_io.dart:205); DandanplayService._fetchBangumiDetailsFromApi (lib/services/dandanplay_service_io.dart:2116). Rename to `_matchWithDandanPlayApi`. [rule N6]
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (129 single-owned of 896 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 896 of the 1270 production source files in this repository met that bar). They are anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: lib/media_library/media_library_section_order_store.dart.
D21 · Naming Consistency· `_launchURL` spells `URL` where 22 names in the project spell it `Url` · ×1
`_launchURL` spells `URL` where 22 names in the project spell it `Url` lib/settings/pages/about_settings_content.dart:683— 22 of 23 names in project repository.settings spell the token `Url` (22 of 23; unit: names in project repository.settings containing `Url`). Peers: AboutSettingsData.repositoryUrl (lib/settings/about_settings_data.dart:19); AboutSettingsData.qqGroupUrl (lib/settings/about_settings_data.dart:21); AboutSettingsData.officialWebsiteUrl (lib/settings/about_settings_data.dart:22); AboutSettingsData.afdianUrl (lib/settings/about_settings_data.dart:23); _AboutSettingsContentState._buildUrlQrContent (lib/settings/pages/about_settings_content.dart:618). Rename to `_launchUrl`. [rule N6]
D21 · Naming Consistency· `WebDAVFileSorter` spells `DAV` where 14 names in the project spell it `Dav` · ×1
`WebDAVFileSorter` spells `DAV` where 14 names in the project spell it `Dav` lib/utils/webdav_file_sorter.dart:9— 14 of 15 names in project repository.utils spell the token `Dav` (14 of 15; unit: names in project repository.utils containing `Dav`). Peers: AutoSyncSettings.saveWebDavConfiguration (lib/utils/auto_sync_settings.dart:130); AutoSyncSettings.hasWebDavConfiguration (lib/utils/auto_sync_settings.dart:162); MediaSourceUtils._remoteWebDavConnections (lib/utils/media_source_utils.dart:51); MediaSourceUtils.updateRemoteWebDavConnections (lib/utils/media_source_utils.dart:53); MediaSourceUtils.isWebDavPath (lib/utils/media_source_utils.dart:88). Rename to `WebDavFileSorter`. [rule N6]
D21 · Naming Consistency· `_disableMic` spells `Mic` where 18 names in the project spell it `MIC` · ×1
`_disableMic` spells `Mic` where 18 names in the project spell it `MIC` third_party/smb_connect/lib/src/smb/spnego_context.dart:28— 18 of 20 names in project repository.src spell the token `MIC` (18 of 20; unit: names in project repository.src containing `MIC`). Peers: Type3Message.setupMIC (third_party/smb_connect/lib/src/ntlmssp/type3_message.dart:285); Type3Message.isMICRequired (third_party/smb_connect/lib/src/ntlmssp/type3_message.dart:317); NtlmContext.isMICAvailable (third_party/smb_connect/lib/src/smb/ntlm_context.dart:261); NtlmContext.calculateMIC (third_party/smb_connect/lib/src/smb/ntlm_context.dart:266); NtlmContext.verifyMIC (third_party/smb_connect/lib/src/smb/ntlm_context.dart:306). Rename to `_disableMIC`. [rule N6]
D21 · Naming Consistency· `_requireMic` spells `Mic` where 18 names in the project spell it `MIC` · ×1
`_requireMic` spells `Mic` where 18 names in the project spell it `MIC` third_party/smb_connect/lib/src/smb/spnego_context.dart:29— 18 of 20 names in project repository.src spell the token `MIC` (18 of 20; unit: names in project repository.src containing `MIC`). Peers: Type3Message.setupMIC (third_party/smb_connect/lib/src/ntlmssp/type3_message.dart:285); Type3Message.isMICRequired (third_party/smb_connect/lib/src/ntlmssp/type3_message.dart:317); NtlmContext.isMICAvailable (third_party/smb_connect/lib/src/smb/ntlm_context.dart:261); NtlmContext.calculateMIC (third_party/smb_connect/lib/src/smb/ntlm_context.dart:266); NtlmContext.verifyMIC (third_party/smb_connect/lib/src/smb/ntlm_context.dart:306). Rename to `_requireMIC`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion package.json:1— `(repository root)` (282183 LoC, 1312 module-visible types across 71 directories) overshoots its size bounds. 1 of 39 build unit(s) (Cargo, Gradle, SwiftPM, Xcode, npm, pub) overshoot their size bounds, lowering Project Cohesion to 9.5/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
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 17 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: lib/services/multi_address_server_service.dart, lib/danmaku_next/nipaplay_next_old_canvas_painter.dart, lib/danmaku_next/danmaku_sprite_atlas.dart, lib/models/emby_media_selection.dart, lib/services/emby_track_application.dart, lib/services/emby_media_selection_resolver.dart, lib/services/emby_media_selection_controller.dart, lib/models/server_profile_model.dart (and 9 more) (18 orphaned of 896 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 896 of the 1270 production source files in this repository met that bar). 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.
P10 · Library API & versioning· Implementation type on the public API · ×1
Implementation type on the public API packages/liquid_glass_widgets/lib/src/renderer/internal/glass_drag_builder.dart:5— 14 public types in `repository.src` are marked as implementation by their own namespace, folder or name: `GlassDragBuilder` (packages/liquid_glass_widgets/lib/src/renderer/internal/glass_drag_builder.dart:5, `internal`), `GlassShadowPaints` (packages/liquid_glass_widgets/lib/src/renderer/internal/glass_shadow_paints.dart:6, `internal`), `InteractionNotification` (packages/liquid_glass_widgets/lib/src/renderer/internal/interaction_notification.dart:3, `internal`), `MultiShaderBuilder` (packages/liquid_glass_widgets/lib/src/renderer/internal/multi_shader_builder.dart:16, `internal`), `LiquidGlassGeometryState` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:14, `internal`), `RenderLiquidGlassGeometry` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:33, `internal`), `GeometryCache` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:291, `internal`), `UnrenderedGeometryCache` (packages/liquid_glass_widgets/lib/src/renderer/internal/render_liquid_glass_geometry.dart:329, `internal`), and 6 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
Logging is not universal — Only 9/18 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/adaptive_platform_ui/example`, `packages/adaptive_platform_ui/example/ios`, `packages/file_selector_ohos/example`, `packages/liquid_glass_widgets/example` and 4 more.
No SAST REDACTED:13— 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 16 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.
No dependency-update automation package.json:2— `package.json` 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`.
No security response headers detected REDACTED:2— 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 `REDACTED` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
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: pubspec.yaml:40 — depends on `shelf`.
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/9 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 rust_builder/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.
Subsumed condition operand rust/src/api/media_metadata.rs:276— `s.contains("jpn")` can never decide this `||` — every value satisfying `s.contains("jpn")` also satisfies `s.contains("jp")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
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 3 file(s) — `packages/media_kit/assets/web/hls1.4.10.js`, `rust_builder/ios/Classes/RustLibNipaplayPlugin.swift`, `rust_builder/macos/Classes/RustLibNipaplayPlugin.swift` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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.
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.
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.
Run 01a1eb00-49c8-7836-87b7-3804fdd65e97 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 150 · Warnings: 3012 · Recommendations: 166 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 19:33 UTC.
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.