Public report of jia070310/lomenTV-VDS, 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, 06:52 UTC · Survey ID cd_7db64439b05346b8b24160b3a4a0b49c
jia070310/lomenTV-VDS
Measured 17 November 2026, 06:49 UTC, at code version 015e4b7
First survey, so nothing to compare with yet
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
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 medium codebase: 40,838 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Production Readiness, 28.6
Findings by how serious they are
5 critical431 serious24 minor
16 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, 06:49 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
46of 46 dimensions measured by tools.
451of 460 findings point to an exact file and line, so you can open each one in the code. The other 9 concern the repository as a whole, such as missing documentation.
46dimensions across 7 lenses, read from 40,838 lines of product code in 2 projects.
jia070310/lomenTV-VDS falls short of our standard for production because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 46.2 out of 100 and is rated Weak, and four of its five critical findings are leaked passwords or keys.
Production Readiness, at 28.6, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 10.8 points. Adding an automated build and test pipeline would lift Production Readiness itself, worth about 9.1 points. Raising Production Readiness to 70 would lift the score to about 60.1.
Three passwords or keys in the code's history and one in the code are open to anyone who can read the repository. One package carries licence risk. Replacing each exposed password or key and replacing or clearing the banned-licence packages would close both risks.
The product code is 40,838 lines, about €42,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 Production Readiness rose from 28.6 to 70, the lowest score rated Strong, the score would rise from 46.2 to about 60.1.
Code composition: what the lines of code are
Product code 99%Tests 1%
Rebuild cost: about €42,000 · Estimate
Cost to rebuild
€14,000 to €71,000, for 235 to 744 hours of work, about 0.3 person-years for one engineer
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.7 at a score of 46. 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
Medium: 40,838 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 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 10.8 points · Low effort · REDACTED Scanning
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.kts.
Raises the score by about 5.2 points · Low effort · ADR Quality
3
Resolve the 1 Banned license finding(s) in License Compliance.
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 €42,000 to build again, about 0.3 person-years of work. Its weakest lens is Production Readiness, at 28.6 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 10.8 points for low effort, because it clears the 1 REDACTED Scanning 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 4.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 18% on every change. The history of the code shows how much it changes: about 10,208 lines over the last 90 days, which is about 41,399 lines a year. At that pace, the extra work comes to an estimated 8.2 to 49 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: 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.
115 modules, with 145 dependencies between them. 3 loops run through 6 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 75 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.
data.remote.api uses data.remote.model, so a change to data.remote.model can break data.remote.api, while a change to data.remote.api can't break data.remote.model.
Position
Below the diagonal: data.remote.api uses a module listed above it, which is the healthy direction.
data.remote.parser uses data.model.live, so a change to data.model.live can break data.remote.parser, while a change to data.remote.parser can't break data.model.live.
Position
Below the diagonal: data.remote.parser uses a module listed above it, which is the healthy direction.
12→27 data.scraper.SmartMediaScraper uses data.scraperpart of a loop✕
Connections
1 pair of types, where a type in data.scraper.SmartMediaScraper uses a type in data.scraper.
data.scraper.SmartMediaScraper uses data.scraper, so a change to data.scraper can break data.scraper.SmartMediaScraper, while a change to data.scraper.SmartMediaScraper can't break data.scraper.
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.
domain.model uses domain.model.ResourceLibrary, so a change to domain.model.ResourceLibrary can break domain.model, while a change to domain.model can't break domain.model.ResourceLibrary.
Position
Below the diagonal: domain.model uses a module listed above it, which is the healthy direction.
domain.model uses domain.model.WebDavConfig, so a change to domain.model.WebDavConfig can break domain.model, while a change to domain.model can't break domain.model.WebDavConfig.
Position
Below the diagonal: domain.model uses a module listed above it, which is the healthy direction.
14→22 service.WebDavConfigServer uses servicepart of a loop✕
Connections
1 pair of types, where a type in service.WebDavConfigServer uses a type in service.
service.WebDavConfigServer uses service, so a change to service can break service.WebDavConfigServer, while a change to service.WebDavConfigServer can't break service.
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.
30 pairs of types, where a type in ui.live.components uses a type in data.model.live. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
ui.live.components uses data.model.live, so a change to data.model.live can break ui.live.components, while a change to ui.live.components can't break data.model.live.
Position
Below the diagonal: ui.live.components uses a module listed above it, which is the healthy direction.
ui.live.components uses data.preferences.LiveSettingsPreferences.Companion, so a change to data.preferences.LiveSettingsPreferences.Companion can break ui.live.components, while a change to ui.live.components can't break data.preferences.LiveSettingsPreferences.Companion.
Position
Below the diagonal: ui.live.components uses a module listed above it, which is the healthy direction.
data.local.database.entity uses data.local.database.entity.TmdbSyncQueueEntity, so a change to data.local.database.entity.TmdbSyncQueueEntity can break data.local.database.entity, while a change to data.local.database.entity can't break data.local.database.entity.TmdbSyncQueueEntity.
Position
Below the diagonal: data.local.database.entity uses a module listed above it, which is the healthy direction.
data.local.database.entity uses domain.model, so a change to domain.model can break data.local.database.entity, while a change to data.local.database.entity can't break domain.model.
Position
Below the diagonal: data.local.database.entity uses a module listed above it, which is the healthy direction.
data.preferences uses data.preferences.LiveSettingsPreferences.Companion, so a change to data.preferences.LiveSettingsPreferences.Companion can break data.preferences, while a change to data.preferences can't break data.preferences.LiveSettingsPreferences.Companion.
Position
Below the diagonal: data.preferences uses a module listed above it, which is the healthy direction.
data.preferences uses domain.model, so a change to domain.model can break data.preferences, while a change to data.preferences can't break domain.model.
Position
Below the diagonal: data.preferences uses a module listed above it, which is the healthy direction.
utils.FileNameParser uses domain.model, so a change to domain.model can break utils.FileNameParser, while a change to utils.FileNameParser can't break domain.model.
Position
Below the diagonal: utils.FileNameParser uses a module listed above it, which is the healthy direction.
data.local.database.dao uses data.local.database.entity.TmdbSyncQueueEntity, so a change to data.local.database.entity.TmdbSyncQueueEntity can break data.local.database.dao, while a change to data.local.database.dao can't break data.local.database.entity.TmdbSyncQueueEntity.
Position
Below the diagonal: data.local.database.dao uses a module listed above it, which is the healthy direction.
data.local.database.dao uses domain.model, so a change to domain.model can break data.local.database.dao, while a change to data.local.database.dao can't break domain.model.
Position
Below the diagonal: data.local.database.dao uses a module listed above it, which is the healthy direction.
data.local.database.dao uses data.local.database.entity, so a change to data.local.database.entity can break data.local.database.dao, while a change to data.local.database.dao can't break data.local.database.entity.
Position
Below the diagonal: data.local.database.dao uses a module listed above it, which is the healthy direction.
service uses service.WebDavConfigServer, so a change to service.WebDavConfigServer can break service, while a change to service can't break service.WebDavConfigServer.
Position
Below the diagonal: service uses a module listed above it, which is the healthy direction.
data.local.database uses domain.model, so a change to domain.model can break data.local.database, while a change to data.local.database can't break domain.model.
Position
Below the diagonal: data.local.database uses a module listed above it, which is the healthy direction.
data.local.database uses data.local.database.dao, so a change to data.local.database.dao can break data.local.database, while a change to data.local.database can't break data.local.database.dao.
Position
Below the diagonal: data.local.database uses a module listed above it, which is the healthy direction.
data.repository uses data.model.live, so a change to data.model.live can break data.repository, while a change to data.repository can't break data.model.live.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.repository uses data.remote.parser, so a change to data.remote.parser can break data.repository, while a change to data.repository can't break data.remote.parser.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.repository uses data.local.database.entity, so a change to data.local.database.entity can break data.repository, while a change to data.repository can't break data.local.database.entity.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.repository uses data.local.database.dao, so a change to data.local.database.dao can break data.repository, while a change to data.repository can't break data.local.database.dao.
Position
Below the diagonal: data.repository uses a module listed above it, which is the healthy direction.
data.scraper uses data.scraper.MediaInfoExtractor, so a change to data.scraper.MediaInfoExtractor can break data.scraper, while a change to data.scraper can't break data.scraper.MediaInfoExtractor.
Position
Below the diagonal: data.scraper uses a module listed above it, which is the healthy direction.
data.scraper uses data.scraper.SmartMediaScraper, so a change to data.scraper.SmartMediaScraper can break data.scraper, while a change to data.scraper can't break data.scraper.SmartMediaScraper.
Position
Below the diagonal: data.scraper uses a module listed above it, which is the healthy direction.
domain.service uses data.remote.model, so a change to data.remote.model can break domain.service, while a change to domain.service can't break data.remote.model.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
domain.service uses domain.service.MediaSyncService, so a change to domain.service.MediaSyncService can break domain.service, while a change to domain.service can't break domain.service.MediaSyncService.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
domain.service uses data.remote.api, so a change to data.remote.api can break domain.service, while a change to domain.service can't break data.remote.api.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
domain.service uses data.local.database.entity, so a change to data.local.database.entity can break domain.service, while a change to domain.service can't break data.local.database.entity.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
domain.service uses utils.FileNameParser, so a change to utils.FileNameParser can break domain.service, while a change to domain.service can't break utils.FileNameParser.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
domain.service uses data.local.database.dao, so a change to data.local.database.dao can break domain.service, while a change to domain.service can't break data.local.database.dao.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
domain.service uses data.repository, so a change to data.repository can break domain.service, while a change to domain.service can't break data.repository.
Position
Below the diagonal: domain.service uses a module listed above it, which is the healthy direction.
ui.screens.live uses data.model.live, so a change to data.model.live can break ui.screens.live, while a change to ui.screens.live can't break data.model.live.
Position
Below the diagonal: ui.screens.live uses a module listed above it, which is the healthy direction.
ui.screens.live uses data.preferences.LiveSettingsPreferences.Companion, so a change to data.preferences.LiveSettingsPreferences.Companion can break ui.screens.live, while a change to ui.screens.live can't break data.preferences.LiveSettingsPreferences.Companion.
Position
Below the diagonal: ui.screens.live uses a module listed above it, which is the healthy direction.
ui.screens.live uses data.preferences, so a change to data.preferences can break ui.screens.live, while a change to ui.screens.live can't break data.preferences.
Position
Below the diagonal: ui.screens.live uses a module listed above it, which is the healthy direction.
ui.screens.live uses data.repository, so a change to data.repository can break ui.screens.live, while a change to ui.screens.live can't break data.repository.
Position
Below the diagonal: ui.screens.live uses a module listed above it, which is the healthy direction.
com.lomen.tv uses data.preferences, so a change to data.preferences can break com.lomen.tv, while a change to com.lomen.tv can't break data.preferences.
Position
Below the diagonal: com.lomen.tv uses a module listed above it, which is the healthy direction.
ui.player uses data.local.database.entity, so a change to data.local.database.entity can break ui.player, while a change to ui.player can't break data.local.database.entity.
Position
Below the diagonal: ui.player uses a module listed above it, which is the healthy direction.
ui.player uses data.local.database.dao, so a change to data.local.database.dao can break ui.player, while a change to ui.player can't break data.local.database.dao.
Position
Below the diagonal: ui.player uses a module listed above it, which is the healthy direction.
ui.screens.detail uses domain.model, so a change to domain.model can break ui.screens.detail, while a change to ui.screens.detail can't break domain.model.
Position
Below the diagonal: ui.screens.detail uses a module listed above it, which is the healthy direction.
ui.screens.detail uses data.local.database.entity, so a change to data.local.database.entity can break ui.screens.detail, while a change to ui.screens.detail can't break data.local.database.entity.
Position
Below the diagonal: ui.screens.detail uses a module listed above it, which is the healthy direction.
ui.screens.detail uses data.local.database.dao, so a change to data.local.database.dao can break ui.screens.detail, while a change to ui.screens.detail can't break data.local.database.dao.
Position
Below the diagonal: ui.screens.detail uses a module listed above it, which is the healthy direction.
ui.screens.detail uses data.scraper, so a change to data.scraper can break ui.screens.detail, while a change to ui.screens.detail can't break data.scraper.
Position
Below the diagonal: ui.screens.detail uses a module listed above it, which is the healthy direction.
ui.screens.detail uses domain.service, so a change to domain.service can break ui.screens.detail, while a change to ui.screens.detail can't break domain.service.
Position
Below the diagonal: ui.screens.detail uses a module listed above it, which is the healthy direction.
ui.screens.search uses domain.model, so a change to domain.model can break ui.screens.search, while a change to ui.screens.search can't break domain.model.
Position
Below the diagonal: ui.screens.search uses a module listed above it, which is the healthy direction.
ui.screens.search uses data.local.database.dao, so a change to data.local.database.dao can break ui.screens.search, while a change to ui.screens.search can't break data.local.database.dao.
Position
Below the diagonal: ui.screens.search uses a module listed above it, which is the healthy direction.
ui.screens.search uses domain.service, so a change to domain.service can break ui.screens.search, while a change to ui.screens.search can't break domain.service.
Position
Below the diagonal: ui.screens.search uses a module listed above it, which is the healthy direction.
ui.viewmodel uses ui.viewmodel.MediaSyncViewModel, so a change to ui.viewmodel.MediaSyncViewModel can break ui.viewmodel, while a change to ui.viewmodel can't break ui.viewmodel.MediaSyncViewModel.
Position
Below the diagonal: ui.viewmodel uses a module listed above it, which is the healthy direction.
ui.viewmodel uses data.local.database.entity, so a change to data.local.database.entity can break ui.viewmodel, while a change to ui.viewmodel can't break data.local.database.entity.
Position
Below the diagonal: ui.viewmodel uses a module listed above it, which is the healthy direction.
ui.viewmodel uses data.preferences, so a change to data.preferences can break ui.viewmodel, while a change to ui.viewmodel can't break data.preferences.
Position
Below the diagonal: ui.viewmodel uses a module listed above it, which is the healthy direction.
ui.viewmodel uses data.local.database.dao, so a change to data.local.database.dao can break ui.viewmodel, while a change to ui.viewmodel can't break data.local.database.dao.
Position
Below the diagonal: ui.viewmodel uses a module listed above it, which is the healthy direction.
LomenTVApplication uses domain.service, so a change to domain.service can break LomenTVApplication, while a change to LomenTVApplication can't break domain.service.
Position
Below the diagonal: LomenTVApplication uses a module listed above it, which is the healthy direction.
LomenTVApplication uses com.lomen.tv, so a change to com.lomen.tv can break LomenTVApplication, while a change to LomenTVApplication can't break com.lomen.tv.
Position
Below the diagonal: LomenTVApplication uses a module listed above it, which is the healthy direction.
ui.screens.category uses domain.model, so a change to domain.model can break ui.screens.category, while a change to ui.screens.category can't break domain.model.
Position
Below the diagonal: ui.screens.category uses a module listed above it, which is the healthy direction.
ui.screens.category uses data.local.database.entity, so a change to data.local.database.entity can break ui.screens.category, while a change to ui.screens.category can't break data.local.database.entity.
Position
Below the diagonal: ui.screens.category uses a module listed above it, which is the healthy direction.
ui.screens.category uses ui.viewmodel, so a change to ui.viewmodel can break ui.screens.category, while a change to ui.screens.category can't break ui.viewmodel.
Position
Below the diagonal: ui.screens.category uses a module listed above it, which is the healthy direction.
ui.screens.home uses ui.viewmodel.MediaSyncViewModel, so a change to ui.viewmodel.MediaSyncViewModel can break ui.screens.home, while a change to ui.screens.home can't break ui.viewmodel.MediaSyncViewModel.
Position
Below the diagonal: ui.screens.home uses a module listed above it, which is the healthy direction.
ui.screens.home uses data.local.database.entity, so a change to data.local.database.entity can break ui.screens.home, while a change to ui.screens.home can't break data.local.database.entity.
Position
Below the diagonal: ui.screens.home uses a module listed above it, which is the healthy direction.
ui.screens.home uses data.local.database.dao, so a change to data.local.database.dao can break ui.screens.home, while a change to ui.screens.home can't break data.local.database.dao.
Position
Below the diagonal: ui.screens.home uses a module listed above it, which is the healthy direction.
ui.screens.home uses domain.service, so a change to domain.service can break ui.screens.home, while a change to ui.screens.home can't break domain.service.
Position
Below the diagonal: ui.screens.home uses a module listed above it, which is the healthy direction.
ui.screens.settings uses domain.model.ResourceLibrary, so a change to domain.model.ResourceLibrary can break ui.screens.settings, while a change to ui.screens.settings can't break domain.model.ResourceLibrary.
Position
Below the diagonal: ui.screens.settings uses a module listed above it, which is the healthy direction.
ui.screens.settings uses domain.model, so a change to domain.model can break ui.screens.settings, while a change to ui.screens.settings can't break domain.model.
Position
Below the diagonal: ui.screens.settings uses a module listed above it, which is the healthy direction.
ui.screens.settings uses service.WebDavConfigServer, so a change to service.WebDavConfigServer can break ui.screens.settings, while a change to ui.screens.settings can't break service.WebDavConfigServer.
Position
Below the diagonal: ui.screens.settings uses a module listed above it, which is the healthy direction.
ui.screens.settings uses data.preferences, so a change to data.preferences can break ui.screens.settings, while a change to ui.screens.settings can't break data.preferences.
Position
Below the diagonal: ui.screens.settings uses a module listed above it, which is the healthy direction.
ui.screens.settings uses ui.viewmodel, so a change to ui.viewmodel can break ui.screens.settings, while a change to ui.screens.settings can't break ui.viewmodel.
Position
Below the diagonal: ui.screens.settings uses a module listed above it, which is the healthy direction.
ui.screens.category.CategoryItem uses data.local.database.entity, so a change to data.local.database.entity can break ui.screens.category.CategoryItem, while a change to ui.screens.category.CategoryItem can't break data.local.database.entity.
Position
Below the diagonal: ui.screens.category.CategoryItem uses a module listed above it, which is the healthy direction.
ui.screens.category.CategoryItem uses ui.viewmodel, so a change to ui.viewmodel can break ui.screens.category.CategoryItem, while a change to ui.screens.category.CategoryItem can't break ui.viewmodel.
Position
Below the diagonal: ui.screens.category.CategoryItem uses a module listed above it, which is the healthy direction.
ui.screens.category.CategoryItem uses ui.screens.category, so a change to ui.screens.category can break ui.screens.category.CategoryItem, while a change to ui.screens.category.CategoryItem can't break ui.screens.category.
Position
Below the diagonal: ui.screens.category.CategoryItem uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 60.9 · Adequate · gated by D2, D4 ·
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
A07:2025 — Authentication Failures
5
High / Critical
A05:2025 — Injection
1
Medium
Roadmap
Top priorities: Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; Add a CI workflow that builds and runs the test suite on every push/PR; Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 — 5
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 — 431
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 — 24
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
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 46 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 46 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, 451 of 460 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: test source is present (.kt) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
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 (.kt) and this repository declares a JVM test suite (repository root, Gradle), but it was not re-run: the analyzer environment could not run it. 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 — a Gradle build resolved 260 artifact(s) across its subprojects (89 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
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.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D26 Project Cohesion — 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. `app` (40838 LoC, 370 module-visible types across 38 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
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. `app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
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. Boot via AndroidApp (app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: at java.base/java.lang.Thread.run(Thread.java:1583)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
> A failure occurred…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it).
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
DM8 Value-object opportunities — 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 finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
DM9 Scattered domain decisions — 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 measured — scattered-decision detection needs expression-level symbol resolution: a comparison operand bound to the member it judges (arm one) and a construction bound to the type it produces (arm two). A Roslyn compilation carries both; arm two alone also runs on any frontend that declares whether a construction is produced or passed, and this target loaded neither.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Kotlin is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Kotlin is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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").
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.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
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.
+ 23 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 GuangyaLoginDialogKt.GuangyaLoginDialog (cyclomatic 174). — Refactoring it lifts Cyclomatic Complexity from 4.5 to about 5.0/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.
+ 49 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 10 bodies over 60 down to 60 or less in Cognitive Complexity — start with GuangyaLoginDialogKt.GuangyaLoginDialog (cognitive 493), LiveScreenKt.LiveScreen (cognitive 147), HomeScreenKt.HomeScreen (cognitive 133). — 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 10 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.1 / 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.
Resolve the 32 MethodTooLong finding(s) in God Classes — start with SettingsScreen.kt (6), DetailScreen.kt (4), WebDavConfigServer.kt (3). — One of this dimension's main actionable groups (32 warning-level).
Resolve the 15 FileTooLong finding(s) in God Classes — start with SettingsScreen.kt, HomeScreen.kt, PlayerScreen.kt. — One of this dimension's main actionable groups (15 warning-level).
Resolve the 7 ClassTooLong finding(s) in God Classes — start with PlayerViewModel.kt, WebDavConfigServer.kt, DetailViewModel.kt. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D4 · Code Duplication2.9 / 10Weak✓ Tool-verified
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
177 duplicated block group(s) detected. 17.7 % of the production lines (7,230 of 40,838) are in a reported copy. A further 48 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 127 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with SettingsScreen.kt (2), DoubanScraper.kt, LiveClassicPanelChannelList.kt. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 7 Duplicated block (16 lines × 2) finding(s) in Code Duplication — start with HomeScreen.kt (2), LiveChannelItem.kt, ResourceLibraryScreen.kt. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 7 Duplicated block (15 lines × 2) finding(s) in Code Duplication — start with WebDavConfigDialog.kt (2), MediaScraper.kt, LiveStatusBar.kt. — One of this dimension's main actionable groups (7 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.
2 production modules (Gradle), 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 1 of the 2 (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.
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.
1 of 20 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 2 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. A further 23 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict.
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.
Resolve the 7 Hotspot finding(s) in Churn × Complexity Hotspots — start with PlayerScreen.kt, HomeScreen.kt, SettingsScreen.kt. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.4 / 10Exemplary✓ 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.
23 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt. Counted over 95 of the 157 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Small-team knowledge concentration
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
3 deducted task-comment markers across 40838 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 3 TodoComment finding(s) in Explicit Debt — start with SearchViewModel.kt (3). — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d17_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.
1 of 1 documentation facets pass in full. 1 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.kts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
19 % of calls cross a namespace and 9 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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.
3 finding(s): 0 critical, 3 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 3 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 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).
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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 95 of the 157 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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.
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 1 platform declaration(s) and 47 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 — 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 singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
`GuangyaTokenAutoRefresh` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (registered; e.g. `registered` in `start` at line 35). — app/src/main/java/com/lomen/tv/domain/service/GuangyaTokenAutoRefresh.kt:28
`PlayerService` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (exoPlayer, trackSelector, bandwidthMeter, currentMediaUrl, currentMediaTitle, currentMediaEpisodeTitle; e.g. `exoPlayer` in `initializePlayer` at line 72). — app/src/main/java/com/lomen/tv/domain/service/PlayerService.kt:31
`WatchHistoryService` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (cachedWatchHistory, cacheTimestamp; e.g. `cachedWatchHistory` in `getRecentWatchHistory` at line 37). — app/src/main/java/com/lomen/tv/domain/service/WatchHistoryService.kt:19
What to do
Java/Kotlin: keep container singletons stateless — move per-request data into locals or a request-scoped bean — or back the state with java.util.concurrent types (ConcurrentHashMap, AtomicInteger/AtomicReference), guard it with synchronized / a Lock (Kotlin: withLock), or mark a flag that is only ever overwritten volatile (@Volatile).
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.
`WebDavMediaDao` declares 17 abstract methods: `getAllSync`, `getByLibraryId`, `getMoviesByLibraryId`, `getTvShowsByLibraryId`, `getByFilePath`, `getCreatedAtByFilePaths`, `getById`, `insert`, `insertAll`, `update`, `deleteByLibraryId`, `deleteByFilePath`, `deleteAll`, `countByLibraryId`, `search`, `getFingerprintsByLibraryId`, `deleteByFilePaths`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer 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. — app/src/main/java/com/lomen/tv/data/local/database/dao/WebDavMediaDao.kt:12
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.
Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.
`EpisodeEntity`'s public constructor takes `id`, `movieId`, `title`, `overview`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `EpisodeEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/EpisodeEntity.kt:20
`FavoriteEntity`'s public constructor takes `mediaId`, `title`, `posterUrl`, `backdropUrl`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `FavoriteEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/FavoriteEntity.kt:15
`MovieEntity`'s public constructor takes `id`, `title`, `originalTitle`, `overview`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `MovieEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/MovieEntity.kt:8
`SkipConfigEntity`'s public constructor takes `mediaId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `SkipConfigEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/SkipConfigEntity.kt:15
`TmdbEpisodeEntity`'s public constructor takes `name`, `overview`, `stillUrl`, `airDate` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TmdbEpisodeEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/TmdbEpisodeEntity.kt:14
`TmdbMediaEntity`'s public constructor takes `title`, `originalTitle`, `overview`, `posterUrl`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TmdbMediaEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/TmdbMediaEntity.kt:15
`TmdbSyncQueueEntity`'s public constructor takes `key`, `lastError` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TmdbSyncQueueEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/TmdbSyncQueueEntity.kt:15
`WatchHistoryEntity`'s public constructor takes `id`, `movieId`, `episodeId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `WatchHistoryEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/WatchHistoryEntity.kt:17
`WebDavMediaEntity`'s public constructor takes `id`, `libraryId`, `title`, `originalTitle`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `WebDavMediaEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/lomen/tv/data/local/database/entity/WebDavMediaEntity.kt:16
What to do
Give each aggregate one way in that can refuse — a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
Do you agree with this assessment?
DM12 · Ambient inputs in the domain10.0 / 10Exemplary○ Nothing flagged
Other · Domain Modelling — Whether domain types receive the time and randomness their rules depend on, rather than reading the process clock or a global random source directly — an ambient read makes the rule it feeds untestable at the instant that matters and lets two reads inside one operation disagree.
Method: Roslyn (DDD-gated, C#/VB only): domain-layer types scanned for ambient reads — DateTime/DateTimeOffset.Now/UtcNow/Today, Random.Shared, new Random(), Stopwatch.GetTimestamp — resolved against the semantic model, with a comment/string-stripped token fallback only where resolution fails. Body reads are scored; field/property initialisers are surfaced unscored. Apply/When folds excluded (ES1 owns them). Deterministic, symbol-resolved.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies (EF/Marten/HTTP/ASP.NET) — the clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
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 key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
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.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR.
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 spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.
`app/build.gradle.kts` 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`. — app/build.gradle.kts:70
What to do
Run what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add 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 traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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 · 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.
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.
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.
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.
Other · Code Health — Whether suspend functions that make a cancellable request accept or pass on the coroutine's cancellation (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/27 suspend functions that make a cancellable request (Ktor, OkHttp newCall, URL streams) accept the coroutine's cancellation 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. In a suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`requestDeviceCode` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:198
`pollTokenOnce` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:230
`ensureCaptchaToken` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:319
`requestSmsCode` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:349
`loginBySms` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:382
`checkQuarkConnection` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1821
`downloadApk` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/domain/service/DownloadService.kt:35
`isOpenListOrAList` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:159
`loginOpenList` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:243
`getOpenListDirectUrl` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:288
`resolveWebDavUrl` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:359
`checkForUpdates` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/domain/service/VersionCheckService.kt:29
`getDownloadUrl` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/domain/service/quarkcloudservice.kt:33
`listFiles` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. (×2) — app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:78, app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:63
`tryOpenListApi` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:162
`tryOpenListLoginAndList` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:226
`getOrRefreshOpenListToken` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:303
`readTextFile` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. (×2) — app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:673, app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:219
`fileExists` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. (×2) — app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:707, app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:236
`getCastAndCrew` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:35
`refreshAccessTokenLocked` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:73
`doPost` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:210
`doCheck` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:239
`getRawUrl` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`. — app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:253
What to do
Thread the coroutine's cancellation through suspend 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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×11) — app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:995, app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1013, app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1179, …
`catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×4) — app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1815, app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:254, app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:231, …
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. — app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:214
Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler 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 — 2 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 — 12 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 77 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: Dagger rejects, at compile time, a component that holds a binding with a narrower scope than its own.
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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: at java.base/java.lang.Thread.run(Thread.java:1583)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
> A failure occurred…; runtime evidence skipped (launch chosen because app/build.gradle.kts applies the Android application plugin and gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no data at rest for these controls to protect.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named column (email, first_name, date_of_birth, phone_number, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Room, JPA or MongoDB entity, an Exposed or Ktorm table, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (Room, Exposed, SQLDelight, Realm, JPA, JDBC, MongoDB, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~305 lines of test source are present (.kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .kt suite was found but not re-run
D12 Dependency Hygiene — Not scored — a Gradle build resolved 260 artifact(s) across its subprojects (89 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 5 candidate(s) found and not reported.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .kt, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Aggregate boundaries — no aggregates detected — aggregate-boundary check not applicable
DM10 One transaction, one aggregate — no repository writes detected — no operation to judge against the one-aggregate rule
DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM4 Rich vs anemic model — no data-bearing entities detected — rich-vs-anemic model not assessable
DM5 Encapsulated state — no domain entities found — DM5 grades how entities protect their state, and this repository declares none
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
DM9 Scattered domain decisions — not measured — scattered-decision detection needs expression-level symbol resolution: a comparison operand bound to the member it judges (arm one) and a construction bound to the type it produces (arm two). A Roslyn compilation carries both; arm two alone also runs on any frontend that declares whether a construction is produced or passed, and this target loaded neither
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
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
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
M4 Documentation accuracy — Not applicable: the 1 current-state document(s) make no claim of a kind M4 checks. 2 claim(s) of kinds M4 does not check were not checked (path 2); M4 checks only links and versions and artefact counts.
P12 CI test-gate honesty — no CI workflow found
P2 Observability — This repository's JVM source (1 module(s), 154 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, 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.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Banned license: org.jellyfin.media3:media3-ffmpeg-decoder — `org.jellyfin.media3:media3-ffmpeg-decoder` 1.2.1+1 is published on Maven Central under `GPL-3.0`, which this policy bans, and this repository declares it in a Maven or Gradle manifest. The licence was read from the artifact's POM `<licenses>` block — following `<parent>` where the POM inherits them — and normalised to SPDX before it was judged, because Maven publishes the name as free text (`GNU Affero General Public License v3` is AGPL-3.0). Where a POM lists several licences they are read as a CHOICE, per Maven's own documentation, so this is charged only because EVERY listed licence is banned. Replace the dependency, or record an accepted exception.
MethodTooLong: SettingsScreenKt.LiveSettingsSection app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2872— MethodTooLong — LiveSettingsSection runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× 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: SettingsScreenKt.SettingsScreen app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:134— MethodTooLong — SettingsScreen runs 286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 186 over it, 2.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WebDavConfigDialogKt.WebDavEditForm app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:129— MethodTooLong — WebDavEditForm runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WebDavConfigServer.serveMainPage app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:133— MethodTooLong — serveMainPage 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: DetailScreenKt.HeroSection app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:406— MethodTooLong — HeroSection runs 229 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 129 over it, 2.29× 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: WebDavConfigServer.serveLiveConfigPage app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:468— MethodTooLong — serveLiveConfigPage runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DetailViewModel.loadMediaDetail app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:128— MethodTooLong — loadMediaDetail runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WebDavConfigServer.serveTmdbConfigPage app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:810— MethodTooLong — serveTmdbConfigPage runs 200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TmdbApiConfigServer.serveMainPage app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt:63— MethodTooLong — serveMainPage runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LomenTVNavigationKt.LomenTVNavigation app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:72— MethodTooLong — LomenTVNavigation runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SettingsScreenKt.MediaTypeSortDialog app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2301— MethodTooLong — MediaTypeSortDialog runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: SmartMediaScraper.scrapeSeriesInfo app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:181— MethodTooLong — scrapeSeriesInfo runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
MethodTooLong: SkipConfigDialogKt.DurationSliderWithControls app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:294— MethodTooLong — DurationSliderWithControls runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
MethodTooLong: SkipConfigDialogKt.SkipConfigDialog app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:66— MethodTooLong — SkipConfigDialog runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HomeScreenKt.HomeHeader app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:910— MethodTooLong — HomeHeader runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ResourceLibraryScreenKt.LibraryListItemV2 app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1046— MethodTooLong — LibraryListItemV2 runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.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: DetailScreenKt.ManualMetadataEditDialog app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:738— MethodTooLong — ManualMetadataEditDialog runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.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: VersionUpdateDialogKt.VersionUpdateDialog app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:46— MethodTooLong — VersionUpdateDialog runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.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: PlayerViewModel.prepareMedia app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:221— MethodTooLong — prepareMedia runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.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: SettingsScreenKt.ClassificationStrategyDialog app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2625— MethodTooLong — ClassificationStrategyDialog runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CategoryScreenKt.CategoryScreen app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:72— MethodTooLong — CategoryScreen runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WatchHistoryService.getRecentWatchHistory app/src/main/java/com/lomen/tv/domain/service/WatchHistoryService.kt:37— MethodTooLong — getRecentWatchHistory runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: DetailScreenKt.DetailContent app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:211— MethodTooLong — DetailContent runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SettingsScreenKt.HomeSettingsSection app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:893— MethodTooLong — HomeSettingsSection runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
MethodTooLong: TmdbApiSettingsDialogKt.TmdbApiSettingsDialog app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:63— MethodTooLong — TmdbApiSettingsDialog runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
+ 7 more in this group — see findings.md.
X2 · Cancellation propagation· Suspend function with a blocking request · ×27
Suspend function with a blocking request: requestDeviceCode app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:198— `requestDeviceCode` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: pollTokenOnce app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:230— `pollTokenOnce` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: ensureCaptchaToken app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:319— `ensureCaptchaToken` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: requestSmsCode app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:349— `requestSmsCode` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: loginBySms app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:382— `loginBySms` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: checkQuarkConnection app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1821— `checkQuarkConnection` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: downloadApk app/src/main/java/com/lomen/tv/domain/service/DownloadService.kt:35— `downloadApk` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: isOpenListOrAList app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:159— `isOpenListOrAList` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: loginOpenList app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:243— `loginOpenList` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: getOpenListDirectUrl app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:288— `getOpenListDirectUrl` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: resolveWebDavUrl app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:359— `resolveWebDavUrl` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: checkForUpdates app/src/main/java/com/lomen/tv/domain/service/VersionCheckService.kt:29— `checkForUpdates` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: getDownloadUrl app/src/main/java/com/lomen/tv/domain/service/quarkcloudservice.kt:33— `getDownloadUrl` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: listFiles app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:78— `listFiles` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: tryOpenListApi app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:162— `tryOpenListApi` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: tryOpenListLoginAndList app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:226— `tryOpenListLoginAndList` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: getOrRefreshOpenListToken app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:303— `getOrRefreshOpenListToken` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: readTextFile app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:673— `readTextFile` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: fileExists app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:707— `fileExists` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: getCastAndCrew app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:35— `getCastAndCrew` suspends, but makes its request with `URL(…).openConnection()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: refreshAccessTokenLocked app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:73— `refreshAccessTokenLocked` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: doPost app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:210— `doPost` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: doCheck app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:239— `doCheck` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: listFiles app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:63— `listFiles` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
Suspend function with a blocking request: readTextFile app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:219— `readTextFile` suspends, but makes its request with `newCall(…).execute()`, which blocks: its caller's cancellation cannot reach the request, so it runs to its end after whatever wanted it has given up — `withContext(Dispatchers.IO)` moves it off the caller's thread and does not change that. Make the request with a call that suspends: Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` over `enqueue` that cancels the `Call` in `invokeOnCancellation`.
FileTooLong: settings/SettingsScreen.kt app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt— FileTooLong — 2621 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2121 over it, 5.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: home/HomeScreen.kt app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt— FileTooLong — 1858 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1358 over it, 3.72× 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: player/PlayerScreen.kt app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt— FileTooLong — 1738 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1238 over it, 3.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: home/ResourceLibraryScreen.kt app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt— FileTooLong — 1353 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 853 over it, 2.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: settings/GuangyaLoginDialog.kt app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt— FileTooLong — 1195 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: GuangyaFieldCorner (127-1566). The bar is 500 significant lines; this is 695 over it, 2.39× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: settings/WebDavConfigDialog.kt app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt— FileTooLong — 1150 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 650 over it, 2.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: detail/DetailScreen.kt app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt— FileTooLong — 1101 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 601 over it, 2.20× 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: player/PlayerViewModel.kt app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt— FileTooLong — 1007 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: PlayerViewModel (36-1573). The bar is 500 significant lines; this is 507 over it, 2.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: service/WebDavConfigServer.kt app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt— FileTooLong — 858 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: WebDavConfigServer (10-1097). The bar is 500 significant lines; this is 358 over it, 1.72× 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: detail/DetailViewModel.kt app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt— FileTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: DetailViewModel (39-994). The bar is 500 significant lines; this is 247 over it, 1.49× 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: live/LiveScreen.kt app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt— FileTooLong — 655 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 155 over it, 1.31× 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: settings/LiveSettingsComponents.kt app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt— FileTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 135 over it, 1.27× 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: components/LiveStatusBar.kt app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt— FileTooLong — 573 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 73 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: service/PlayerService.kt app/src/main/java/com/lomen/tv/domain/service/PlayerService.kt— FileTooLong — 561 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: PlayerService (31-771). The bar is 500 significant lines; this is 61 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: TmdbScraper (41-870). The bar is 500 significant lines; this is 58 over it, 1.12× 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.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:995— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1013— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1179— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1815— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:308— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/ui/components/NotificationBar.kt:34— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:254— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/domain/service/VersionCheckService.kt:78— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:582— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:590— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:725— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/data/preferences/MediaTypeSortPreferences.kt:66— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:254— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:231— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:245— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (12 lines × 2) app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:132— app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:132-143 | app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:194-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelChannelList.kt:198— app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelChannelList.kt:198-209 | app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelGroupList.kt:150-162 — 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 `app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelChannelList.kt:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:249— app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:249-260 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2915-2926 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:262` calls `launch` and `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2927` 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 (12 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:404— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:404-415 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2393-2404 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:404` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1555— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1555-1566 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1693-1704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1555` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:995— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:995-1006 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:837-848 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:995` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2448— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2448-2459 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2469-2480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2448` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3219— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3219-3230 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt: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 `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3219` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:729— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:729-740 | app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:776-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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt: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.
DM11 · Constructible invalid state· Constructible in an invalid state · ×9
Constructible in an invalid state: EpisodeEntity app/src/main/java/com/lomen/tv/data/local/database/entity/EpisodeEntity.kt:20— `EpisodeEntity`'s public constructor takes `id`, `movieId`, `title`, `overview`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `EpisodeEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: FavoriteEntity app/src/main/java/com/lomen/tv/data/local/database/entity/FavoriteEntity.kt:15— `FavoriteEntity`'s public constructor takes `mediaId`, `title`, `posterUrl`, `backdropUrl`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `FavoriteEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: MovieEntity app/src/main/java/com/lomen/tv/data/local/database/entity/MovieEntity.kt:8— `MovieEntity`'s public constructor takes `id`, `title`, `originalTitle`, `overview`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `MovieEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: SkipConfigEntity app/src/main/java/com/lomen/tv/data/local/database/entity/SkipConfigEntity.kt:15— `SkipConfigEntity`'s public constructor takes `mediaId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `SkipConfigEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: TmdbEpisodeEntity app/src/main/java/com/lomen/tv/data/local/database/entity/TmdbEpisodeEntity.kt:14— `TmdbEpisodeEntity`'s public constructor takes `name`, `overview`, `stillUrl`, `airDate` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TmdbEpisodeEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: TmdbMediaEntity app/src/main/java/com/lomen/tv/data/local/database/entity/TmdbMediaEntity.kt:15— `TmdbMediaEntity`'s public constructor takes `title`, `originalTitle`, `overview`, `posterUrl`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TmdbMediaEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: TmdbSyncQueueEntity app/src/main/java/com/lomen/tv/data/local/database/entity/TmdbSyncQueueEntity.kt:15— `TmdbSyncQueueEntity`'s public constructor takes `key`, `lastError` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `TmdbSyncQueueEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: WatchHistoryEntity app/src/main/java/com/lomen/tv/data/local/database/entity/WatchHistoryEntity.kt:17— `WatchHistoryEntity`'s public constructor takes `id`, `movieId`, `episodeId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `WatchHistoryEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Constructible in an invalid state: WebDavMediaEntity app/src/main/java/com/lomen/tv/data/local/database/entity/WebDavMediaEntity.kt:16— `WebDavMediaEntity`'s public constructor takes `id`, `libraryId`, `title`, `originalTitle`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule`, `Requires.` or an `…Exception.ThrowIf…(` helper, and so was any method of this type it calls — a guard reached further than that is not seen. A static factory beside it was NOT counted: while this constructor is public a caller can skip the factory. If the constructor validates in a way this search misses, this row is wrong. If it does not, a caller can build a `WebDavMediaEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
Hotspot: app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:163— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in PlayerScreenKt.PlayerScreen 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-04-13..2026-07-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-13 02:53:31 +08:00' --until='2026-07-12 02:53:31 +08:00' --full-history --no-merges -- app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:181— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in HomeScreenKt.HomeScreen at line 181. 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-04-13..2026-07-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-13 02:53:31 +08:00' --until='2026-07-12 02:53:31 +08:00' --full-history --no-merges -- app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:134— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in SettingsScreenKt.SettingsScreen at line 134. 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-04-13..2026-07-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-13 02:53:31 +08:00' --until='2026-07-12 02:53:31 +08:00' --full-history --no-merges -- app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:472— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in LiveSettingsComponentsKt.HistoryListDialog at line 472. 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-04-13..2026-07-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-13 02:53:31 +08:00' --until='2026-07-12 02:53:31 +08:00' --full-history --no-merges -- app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:128— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in DetailViewModel.loadMediaDetail at line 128. 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-04-13..2026-07-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-13 02:53:31 +08:00' --until='2026-07-12 02:53:31 +08:00' --full-history --no-merges -- app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:221— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in PlayerViewModel.prepareMedia at line 221. 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-04-13..2026-07-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-13 02:53:31 +08:00' --until='2026-07-12 02:53:31 +08:00' --full-history --no-merges -- app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:118— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in ResourceLibraryScreenKt.ResourceLibraryScreen at line 118. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-04-13..2026-07-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-13 02:53:31 +08:00' --until='2026-07-12 02:53:31 +08:00' --full-history --no-merges -- app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
ClassTooLong: PlayerViewModel app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:36— ClassTooLong — 952 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 552 over it, 2.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WebDavConfigServer app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:10— ClassTooLong — 851 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 451 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DetailViewModel app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:39— ClassTooLong — 667 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 267 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.
ClassTooLong: TmdbScraper REDACTED:41— ClassTooLong — 521 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 121 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PlayerService app/src/main/java/com/lomen/tv/domain/service/PlayerService.kt:31— ClassTooLong — 471 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 71 over it, 1.18× 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: SmartMediaScraper app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:27— ClassTooLong — 456 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 56 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WebDavClient app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:34— ClassTooLong — 449 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 49 over it, 1.12× 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.
Duplicated block (16 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelItem.kt:136— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelItem.kt:136-151 | app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelChannelList.kt:225-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 `app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelItem.kt: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 (16 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1386— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1386-1401 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1724-1739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1386` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2564— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2564-2579 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2116-2131 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2564` 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, `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2582` calls `focusRequester` and `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2134` 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1414— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1414-1429 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1489-1504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1414` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:583— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:583-598 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1095-1110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:583` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:587— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:587-602 | app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:643-658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:587` it does not close everything it opens, so those 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, `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:603` calls `fillMaxWidth` and `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:659` 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) app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:209— app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:209-224 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:850-865 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt` and `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:209` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:77— app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:77-91 | app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:101-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 `app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:297— app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:297-311 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1002-1016 — 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) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1165— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1165-1179 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1189-1203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1165` 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:329— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:329-343 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:365-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt: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.
Duplicated block (15 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1424— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1424-1438 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1527-1541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1424` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:198— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:198-212 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:728-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:198` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:154— app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:154-168 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:728-742 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt` and `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:154` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) REDACTED:587— REDACTED:587-600 | REDACTED:618-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 `REDACTED:587` it does not close everything it opens, so those exact 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) app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:70— app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:70-83 | app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:118-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:70` 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) app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:177— app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:177-190 | app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:212-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt: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 (14 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:579— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:579-592 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:709-722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:579` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1615— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1615-1628 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1746-1759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt: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.
Duplicated block (14 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1387— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1387-1400 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1454-1467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1387` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1242— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1242-1255 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1369-1382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1242` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:277— app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:277-284 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:298-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 `app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:277` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1731— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1731-1738 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1932-1939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1731` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/java/com/lomen/tv/data/scraper/MediaInfoExtractor.kt:497— app/src/main/java/com/lomen/tv/data/scraper/MediaInfoExtractor.kt:497-504 | app/src/main/java/com/lomen/tv/data/scraper/MediaInfoExtractor.kt:529-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1140— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1140-1147 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1250-1257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1511— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1511-1518 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1571-1579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) REDACTED:704— REDACTED:704-711 | REDACTED:736-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:704` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/src/main/java/com/lomen/tv/data/repository/LiveChannelRepository.kt:141— app/src/main/java/com/lomen/tv/data/repository/LiveChannelRepository.kt:141-148 | app/src/main/java/com/lomen/tv/data/repository/LiveChannelRepository.kt:162-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 (11 lines × 2) REDACTED:755— REDACTED:755-765 | REDACTED:791-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:755` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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) app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:71— app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:71-81 | app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:102-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:71` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt:330— app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt:330-340 | app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:1086-1096 — 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 `app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelEpgList.kt:193— app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelEpgList.kt:193-203 | app/src/main/java/com/lomen/tv/ui/live/components/LiveEpgDialog.kt:111-121 — 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 `app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelEpgList.kt:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:655— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:655-665 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:796-806 — both copies are in the same file, so extract the 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) app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:605— app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:605-616 | app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:663-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:605` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:76— app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:76-86 | app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:100-110 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:405-415 — before extracting anything, compare `app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt` and `app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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, `app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:416` calls `resolveFinalScrapedType` and `app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:87` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelItem.kt:136— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelItem.kt:136-146 | app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelChannelList.kt:225-235 | app/src/main/java/com/lomen/tv/ui/live/components/LiveTempPanel.kt:147-157 — 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 `app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelItem.kt: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 (11 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1105— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1105-1115 | app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:834-844 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1630-1640 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt: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 (11 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1045— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1045-1055 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1103-1113 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1166-1176 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `WebDavConfigServer.WebDavConfig): ConnectionTestResult? = withContext(Dispatchers.IO` in one and `WebDavConfigServer.WebDavConfig): ConnectionTestResult = withContext(Dispatchers.IO` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1044` calls `setRequestProperty` and `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1165` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2064— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2064-2074 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2134-2144 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2266-2276 — 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 `app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2064` 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) app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:76— app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:76-85 | app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:96-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/src/main/java/com/lomen/tv/domain/service/MediaSyncService.kt:165— app/src/main/java/com/lomen/tv/domain/service/MediaSyncService.kt:165-174 | app/src/main/java/com/lomen/tv/domain/service/MediaSyncService.kt:192-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/domain/service/MediaSyncService.kt:165` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:731— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:731-740 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:757-766 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:731` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:720— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:720-729 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:783-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:720` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:707— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:707-717 | app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:773-782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:707` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:167— app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:167-175 | app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:202-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:167` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:399— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:399-407 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:262-270 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:399` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:627— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:627-635 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:661-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:627` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:618— app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:618-627 | app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:675-683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:618` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:81— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:81-87 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:227-233 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1149— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1149-1155 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1171-1177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1149` 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1663— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1663-1669 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1930-1936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1663` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1453— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1453-1459 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1461-1467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Stateful singleton: GuangyaTokenAutoRefresh app/src/main/java/com/lomen/tv/domain/service/GuangyaTokenAutoRefresh.kt:28— `GuangyaTokenAutoRefresh` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (registered; e.g. `registered` in `start` at line 35).
Stateful singleton: PlayerService app/src/main/java/com/lomen/tv/domain/service/PlayerService.kt:31— `PlayerService` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (exoPlayer, trackSelector, bandwidthMeter, currentMediaUrl, currentMediaTitle, currentMediaEpisodeTitle; e.g. `exoPlayer` in `initializePlayer` at line 72).
Stateful singleton: WatchHistoryService app/src/main/java/com/lomen/tv/domain/service/WatchHistoryService.kt:19— `WatchHistoryService` is a singleton (@Singleton: the container shares one instance across every request thread) but mutates instance state outside any lock (cachedWatchHistory, cacheTimestamp; e.g. `cachedWatchHistory` in `getRecentWatchHistory` at line 37).
TodoComment app/src/main/java/com/lomen/tv/ui/screens/search/SearchViewModel.kt:130— // TODO: 实现搜索历史持久化 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment app/src/main/java/com/lomen/tv/ui/screens/search/SearchViewModel.kt:143— // TODO: 保存到DataStore — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment app/src/main/java/com/lomen/tv/ui/screens/search/SearchViewModel.kt:148— // TODO: 清除DataStore — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TooManyMethods: PlayerViewModel app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:36— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TmdbScraper REDACTED:41— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PlayerService app/src/main/java/com/lomen/tv/domain/service/PlayerService.kt:31— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (31 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2254— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2254-2284 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2407-2437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2254` 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 (31 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1173— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1173-1203 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1220-1250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) app/src/main/java/com/lomen/tv/ui/viewmodel/MediaSyncViewModel.kt:95— app/src/main/java/com/lomen/tv/ui/viewmodel/MediaSyncViewModel.kt:95-125 | app/src/main/java/com/lomen/tv/ui/viewmodel/MediaSyncViewModel.kt:155-185 — both copies are in the same file, so extract the 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) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:267— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:267-288 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:343-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 `app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:609— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:609-630 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:758-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 `app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:609` it does not close everything it opens, so those exact 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) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:419— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:419-440 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:535-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 3) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2082— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2082-2102 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2152-2172 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2284-2304 — 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 `app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2082` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1033— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1033-1053 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1069-1089 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1105-1125 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1033` 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, `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1126` calls `size`, `clip` and `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1054` 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 (21 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1307— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1307-1327 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1977-1997 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2101-2121 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1307` 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 × 3) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1584— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1584-1602 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1622-1640 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1664-1682 — 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 `app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1584` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1135— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1135-1153 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1643-1661 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1787-1805 — 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 `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1135` 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 × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1063— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1063-1081 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1123-1141 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1212-1230 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `WebDavConfigServer.WebDavConfig): ConnectionTestResult? = withContext(Dispatchers.IO` in one and `WebDavConfigServer.WebDavConfig): ConnectionTestResult = withContext(Dispatchers.IO` 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 (19 lines × 2) app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:309— app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:309-327 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:383-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1363— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1363-1381 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:197-215 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `historyItem` to `com.lomen.tv.domain.service.WatchHistoryItem` in one and `WatchHistoryItem` 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, `app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:217` calls `Column` and `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1383` 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1195— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1195-1213 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1222-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1195` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:725— app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:725-741 | app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:783-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt: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 (17 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1393— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1393-1409 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1422-1438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1393` it does not close everything it opens, so those 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, `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1421` calls `Spacer`, `height`, `scale` and `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1392` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2732— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2732-2748 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2764-2780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2732` 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 × 4) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2045— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2045-2060 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2115-2130 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2185-2200 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2247-2262 — 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 `app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2045` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 4) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2077— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2077-2092 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2147-2162 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2210-2225 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2279-2294 — 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 `app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2077` it does not close everything it opens, so those exact lines 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 × 4) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3321— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3321-3336 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3423-3438 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3525-3540 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3624-3639 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3321` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:219— app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:219-231 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:408-420 — both copies are in the same file, so extract the 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) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:809— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:809-821 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:867-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 `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:809` 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) app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:117— app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:117-129 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:709-721 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt` and `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/TmdbApiSettingsDialog.kt:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) REDACTED:779— REDACTED:779-784 | REDACTED:815-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:779` it does not close everything it opens, so those exact 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) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:315— app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:315-320 | app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:256-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:254` calls `d` and `app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:313` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:161— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:161-166 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:162-167 — 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 × 3) REDACTED:335— REDACTED:335-340 | REDACTED:630-635 | REDACTED:801-805 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:335` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1665— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1665-1669 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1731-1735 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1932-1936 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1665` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) REDACTED:342— REDACTED:342-346 | REDACTED:575-579 | REDACTED:807-812 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:342` 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 (5 lines × 2) app/src/main/java/com/lomen/tv/ui/viewmodel/ResourceLibraryViewModel.kt:318— app/src/main/java/com/lomen/tv/ui/viewmodel/ResourceLibraryViewModel.kt:318-322 | app/src/main/java/com/lomen/tv/ui/viewmodel/ResourceLibraryViewModel.kt:364-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/viewmodel/ResourceLibraryViewModel.kt:318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:64— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:64-68 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:123-127 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) REDACTED:145— REDACTED:145-149 | REDACTED:366-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/lomen/tv/domain/service/TmdbMetadataSyncManager.kt:162— app/src/main/java/com/lomen/tv/domain/service/TmdbMetadataSyncManager.kt:162-181 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:841-880 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:943-974 | app/src/main/java/com/lomen/tv/ui/viewmodel/MediaSyncViewModel.kt:390-434 — 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3317— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3317-3408 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3419-3510 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3521-3611 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3620-3691 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:461— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:461-507 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:512-553 — 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) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:267— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:267-308 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:147-188 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:673— app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:673-700 | app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:707-728 — 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:990— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:990-1012 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:833-854 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) app/src/main/java/com/lomen/tv/data/repository/LiveChannelRepository.kt:140— app/src/main/java/com/lomen/tv/data/repository/LiveChannelRepository.kt:140-156 | app/src/main/java/com/lomen/tv/data/repository/LiveChannelRepository.kt:161-177 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) app/src/main/java/com/lomen/tv/ui/viewmodel/ResourceLibraryViewModel.kt:253— app/src/main/java/com/lomen/tv/ui/viewmodel/ResourceLibraryViewModel.kt:253-269 | app/src/main/java/com/lomen/tv/ui/viewmodel/ResourceLibraryViewModel.kt:290-307 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) REDACTED:198— REDACTED:198-212 | REDACTED:217-233 — 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) app/src/main/java/com/lomen/tv/domain/service/TmdbMetadataSyncManager.kt:60— app/src/main/java/com/lomen/tv/domain/service/TmdbMetadataSyncManager.kt:60-74 | app/src/main/java/com/lomen/tv/domain/service/TmdbMetadataSyncManager.kt:76-90 — 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.
Duplicated block (29 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1088— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1088-1116 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1308-1336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1088` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (29 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1605— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1605-1633 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1873-1901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1605` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–28 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:59— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:59-85 | app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:348-375 — 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 `app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:59` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (27–28 lines × 2) app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:461— app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:461-487 | app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:495-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:461` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/search/SearchScreen.kt:350— app/src/main/java/com/lomen/tv/ui/screens/search/SearchScreen.kt:350-369 | app/src/main/java/com/lomen/tv/ui/screens/search/SearchScreen.kt:396-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/search/SearchScreen.kt:350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1197— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1197-1216 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1500-1519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1197` it does not close everything it opens, so those exact lines 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 × 4) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1417— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1417-1434 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2197-2215 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2334-2352 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:248-265 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1417` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `modifier` to `Modifier = Modifier` in one and `modifier =` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18–19 lines × 4) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2534— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2534-2551 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2087-2104 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2227-2244 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2490-2508 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2534` it does not close everything it opens, so those 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, `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2553` calls `focusRequester` and `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2510` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–18 lines × 2) app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:279— app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:279-296 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:357-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:357` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:151— app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:151-167 | app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:319-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:538— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:538-553 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1059-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:538` it begins part-way through the construct above it, so those 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–16 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1168— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1168-1181 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1271-1286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 3) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:136— app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:136-149 | app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:369-381 | app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:463-476 — 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 `app/src/main/java/com/lomen/tv/data/alist/AListClient.kt: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 (13–14 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2568— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2568-2581 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2120-2133 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2261-2273 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2568` it does not close everything it opens, so those 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, `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2582` calls `focusRequester` and `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2134` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:849— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:849-862 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:956-969 | app/src/main/java/com/lomen/tv/ui/viewmodel/MediaSyncViewModel.kt:416-429 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:971` calls `enqueueSeasonEpisodes` and `app/src/main/java/com/lomen/tv/ui/viewmodel/MediaSyncViewModel.kt:430` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1383— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1383-1396 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2162-2175 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2300-2313 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1383` it does not close everything it opens, so those exact lines 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 × 5) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2542— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2542-2554 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2571-2583 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2095-2107 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2235-2247 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2728-2740 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2542` it does not close everything it opens, so those exact lines 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 × 5) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2987— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2987-2999 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3010-3022 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3033-3045 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3056-3068 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3079-3091 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2987` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2123— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2123-2135 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2263-2275 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2499-2511 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2123` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3346— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3346-3358 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3448-3460 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3550-3562 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3346` 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–12 lines × 2) app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:98— app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:98-109 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:404-414 — before extracting anything, compare `app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt` and `app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:98` it does not close everything it opens, so those exact 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–12 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:692— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:692-703 | app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:761-771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:692` 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 × 4) app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:217— app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:217-226 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:309-318 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:383-392 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:406-415 — 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 `app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:217` it does not close everything it opens, so those exact 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 × 4) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:581— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:581-590 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:642-651 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:686-695 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:711-720 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:652` calls `focusRequester` and `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:696` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:68— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:68-76 | app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:357-365 | app/src/main/java/com/lomen/tv/ui/live/components/LiveTempPanel.kt:102-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:259— app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:259-267 | app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:310-318 | app/src/main/java/com/lomen/tv/domain/service/quarkcloudservice.kt:55-63 — 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 `app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:309` calls `header` and `app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt:258` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:47— app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:47-54 | app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:70-77 | app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:102-109 — 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 `app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:47` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1199— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1199-1206 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1297-1305 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1366-1374 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1199` it does not close everything it opens, so those 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 × 4) app/src/main/java/com/lomen/tv/domain/service/TmdbMetadataSyncManager.kt:171— app/src/main/java/com/lomen/tv/domain/service/TmdbMetadataSyncManager.kt:171-176 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:853-858 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:960-965 | app/src/main/java/com/lomen/tv/ui/viewmodel/MediaSyncViewModel.kt:420-425 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:206— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:206-211 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:240-245 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:331-336 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:416-421 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:422` calls `error` and `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt: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.
GuangyaLoginDialogKt.GuangyaLoginDialog (cyclomatic 174) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:131— GuangyaLoginDialogKt.GuangyaLoginDialog has cyclomatic complexity 174 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlayerScreenKt.PlayerScreen (cyclomatic 110) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:163— PlayerScreenKt.PlayerScreen has cyclomatic complexity 110 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LiveScreenKt.LiveScreen (cyclomatic 87) app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:83— LiveScreenKt.LiveScreen has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeScreenKt.HomeScreen (cyclomatic 85) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:181— HomeScreenKt.HomeScreen 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.
PlayerScreenKt.PlayerControls (cyclomatic 45) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1371— PlayerScreenKt.PlayerControls has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SmartMediaScraper.scrapeSeriesInfo (cyclomatic 40) app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:181— SmartMediaScraper.scrapeSeriesInfo 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.
WatchHistoryService.getRecentWatchHistory (cyclomatic 38) app/src/main/java/com/lomen/tv/domain/service/WatchHistoryService.kt:37— WatchHistoryService.getRecentWatchHistory has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LiveSettingsComponentsKt.HistoryListDialog (cyclomatic 34) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:472— LiveSettingsComponentsKt.HistoryListDialog 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.
SettingsScreenKt.SettingsScreen (cyclomatic 30) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:134— SettingsScreenKt.SettingsScreen 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.
WebDavClient.parsePropFindResponse (cyclomatic 29) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:535— WebDavClient.parsePropFindResponse has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SkipConfigDialogKt.DurationSliderWithControls (cyclomatic 28) app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:294— SkipConfigDialogKt.DurationSliderWithControls has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ResourceLibraryScreenKt.LibraryListItemV2 (cyclomatic 25) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1046— ResourceLibraryScreenKt.LibraryListItemV2 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.
CategoryScreenKt.CategoryScreen (cyclomatic 24) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:72— CategoryScreenKt.CategoryScreen 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.
WebDavConfigDialogKt.testAListConnection (cyclomatic 24) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1262— WebDavConfigDialogKt.testAListConnection has cyclomatic complexity 24 (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.
DetailViewModel.loadMediaDetail (cyclomatic 23) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:128— DetailViewModel.loadMediaDetail 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.
HomeScreenKt.HomeHeader (cyclomatic 22) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:910— HomeScreenKt.HomeHeader 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.
ResourceLibraryScreenKt.ResourceLibraryScreen (cyclomatic 21) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:118— ResourceLibraryScreenKt.ResourceLibraryScreen 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.
PlayerScreenKt.EpisodeListPanel (cyclomatic 20) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1820— PlayerScreenKt.EpisodeListPanel 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.
PlayerViewModel.getNextEpisode (cyclomatic 20) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:607— PlayerViewModel.getNextEpisode 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.
HomeScreenKt.WebDavMoviesRow (cyclomatic 20) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1902— HomeScreenKt.WebDavMoviesRow 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. This shape REPEATS in the file: one other method here (HomeScreenKt.WebDavTvShowsRow) 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.
HomeScreenKt.WebDavTvShowsRow (cyclomatic 20) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2027— HomeScreenKt.WebDavTvShowsRow 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. This shape REPEATS in the file: one other method here (HomeScreenKt.WebDavMoviesRow) 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.
ResourceLibraryScreenKt.MainContent (cyclomatic 20) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:615— ResourceLibraryScreenKt.MainContent 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.
PlayerViewModel.prepareMedia (cyclomatic 19) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:221— PlayerViewModel.prepareMedia 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.
PlayerViewModel.getPreviousEpisode (cyclomatic 19) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:756— PlayerViewModel.getPreviousEpisode 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.
SettingsScreenKt.LiveSettingsSection (cyclomatic 19) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2872— SettingsScreenKt.LiveSettingsSection 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.
DetailViewModel.getResumePlaybackInfo (cyclomatic 18) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:453— DetailViewModel.getResumePlaybackInfo 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.
WebDavConfigDialogKt.testWithGetMethod (cyclomatic 17) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1158— WebDavConfigDialogKt.testWithGetMethod 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.
SkipConfigDialogKt.SkipConfigDialog (cyclomatic 16) app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:66— SkipConfigDialogKt.SkipConfigDialog 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.
GuangyaLoginDialogKt.GuangyaLoginDialog (cognitive 493) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:131— GuangyaLoginDialogKt.GuangyaLoginDialog has cognitive complexity 493 (threshold 15). Drivers by points: if/else 208 (453 pts), boolean chains 28, match/switch 4 (8 pts), error handling 1 (3 pts), loops 1 (nesting depth added 251). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LiveScreenKt.LiveScreen (cognitive 147) app/src/main/java/com/lomen/tv/ui/screens/live/LiveScreen.kt:83— LiveScreenKt.LiveScreen has cognitive complexity 147 (threshold 15). Drivers by points: if/else 80 (113 pts), match/switch 8 (14 pts), boolean chains 10, error handling 2 (6 pts), loops 2 (4 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeScreenKt.HomeScreen (cognitive 133) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:181— HomeScreenKt.HomeScreen has cognitive complexity 133 (threshold 15). Drivers by points: if/else 71 (125 pts), boolean chains 4, match/switch 4 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayerScreenKt.PlayerScreen (cognitive 129) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:163— PlayerScreenKt.PlayerScreen has cognitive complexity 129 (threshold 15). Drivers by points: if/else 84 (102 pts), boolean chains 21, match/switch 3 (6 pts) (nesting depth added 21). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
WatchHistoryService.getRecentWatchHistory (cognitive 90) app/src/main/java/com/lomen/tv/domain/service/WatchHistoryService.kt:37— WatchHistoryService.getRecentWatchHistory has cognitive complexity 90 (threshold 15). Drivers by points: if/else 36 (68 pts), boolean chains 11, error handling 4 (10 pts), loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmartMediaScraper.scrapeSeriesInfo (cognitive 75) app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:181— SmartMediaScraper.scrapeSeriesInfo has cognitive complexity 75 (threshold 15). Drivers by points: if/else 36 (61 pts), boolean chains 12, match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayerViewModel.prepareMedia (cognitive 67) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:221— PlayerViewModel.prepareMedia has cognitive complexity 67 (threshold 15). Drivers by points: if/else 20 (59 pts), loops 2 (6 pts), boolean chains 1, error handling 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WebDavClient.parsePropFindResponse (cognitive 63) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:535— WebDavClient.parsePropFindResponse has cognitive complexity 63 (threshold 15). Drivers by points: if/else 12 (39 pts), error handling 3 (10 pts), match/switch 3 (9 pts), boolean chains 4, loops 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.
LiveSettingsComponentsKt.HistoryListDialog (cognitive 63) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:472— LiveSettingsComponentsKt.HistoryListDialog has cognitive complexity 63 (threshold 15). Drivers by points: if/else 32 (51 pts), boolean chains 12 (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.
PlayerScreenKt.PlayerControls (cognitive 62) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1371— PlayerScreenKt.PlayerControls has cognitive complexity 62 (threshold 15). Drivers by points: if/else 56, boolean chains 5, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SkipConfigDialogKt.DurationSliderWithControls (cognitive 48) app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:294— SkipConfigDialogKt.DurationSliderWithControls has cognitive complexity 48 (threshold 15). Drivers by points: if/else 30 (36 pts), match/switch 4 (7 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DetailViewModel.loadMediaDetail (cognitive 47) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:128— DetailViewModel.loadMediaDetail has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (36 pts), error handling 3 (7 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourceLibraryScreenKt.LibraryListItemV2 (cognitive 44) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1046— ResourceLibraryScreenKt.LibraryListItemV2 has cognitive complexity 44 (threshold 15). Drivers by points: if/else 34 (40 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CategoryScreenKt.CategoryScreen (cognitive 42) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:72— CategoryScreenKt.CategoryScreen has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 4 (12 pts), match/switch 3 (6 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.
MetadataService.searchByFileName (cognitive 39) REDACTED:31— MetadataService.searchByFileName has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (38 pts), 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.
DetailViewModel.getResumePlaybackInfo (cognitive 36) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailViewModel.kt:453— DetailViewModel.getResumePlaybackInfo has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 7, loops 2 (5 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.
SettingsScreenKt.SettingsScreen (cognitive 36) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:134— SettingsScreenKt.SettingsScreen has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 5, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HomeScreenKt.WebDavMoviesRow (cognitive 35) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1902— HomeScreenKt.WebDavMoviesRow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (HomeScreenKt.WebDavTvShowsRow) 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.
HomeScreenKt.WebDavTvShowsRow (cognitive 35) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2027— HomeScreenKt.WebDavTvShowsRow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (HomeScreenKt.WebDavMoviesRow) 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.
ResourceLibraryScreenKt.ResourceLibraryScreen (cognitive 35) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:118— ResourceLibraryScreenKt.ResourceLibraryScreen has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WatchHistoryService.getPlaybackInfo (cognitive 33) app/src/main/java/com/lomen/tv/domain/service/WatchHistoryService.kt:346— WatchHistoryService.getPlaybackInfo has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (30 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.
PlayerViewModel.getNextEpisode (cognitive 33) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:607— PlayerViewModel.getNextEpisode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeScreenKt.HomeHeader (cognitive 33) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:910— HomeScreenKt.HomeHeader has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 5, 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.
LiveStatusBarKt.LiveSourceDialog (cognitive 32) app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:650— LiveStatusBarKt.LiveSourceDialog has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayerViewModel.getPreviousEpisode (cognitive 31) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:756— PlayerViewModel.getPreviousEpisode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourceLibraryScreenKt.MainContent (cognitive 29) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:615— ResourceLibraryScreenKt.MainContent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 3 (7 pts), boolean chains 5 (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.
PlayerService.updateAvailableTracks (cognitive 28) app/src/main/java/com/lomen/tv/domain/service/PlayerService.kt:675— PlayerService.updateAvailableTracks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsScreenKt.LiveSettingsSection (cognitive 28) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2872— SettingsScreenKt.LiveSettingsSection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
EpgParser.parseXmlContent (cognitive 27) app/src/main/java/com/lomen/tv/data/remote/parser/EpgParser.kt:134— EpgParser.parseXmlContent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 3, 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.
WebDavClient.listAllVideoFiles (cognitive 27) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:446— WebDavClient.listAllVideoFiles has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiveEpgDialogKt.LiveEpgDialog (cognitive 27) app/src/main/java/com/lomen/tv/ui/live/components/LiveEpgDialog.kt:45— LiveEpgDialogKt.LiveEpgDialog has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5 (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.
PlayerViewModel.getQualityOptions (cognitive 27) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:1045— PlayerViewModel.getQualityOptions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (23 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.
DetailScreenKt.DetailContent (cognitive 26) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:211— DetailScreenKt.DetailContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlayerViewModel.getEpisodeList (cognitive 25) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:941— PlayerViewModel.getEpisodeList has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 3 (7 pts), loops 2 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AListClient.listAllVideoFiles (cognitive 24) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:119— AListClient.listAllVideoFiles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (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.
PlayerScreenKt.EpisodeListPanel (cognitive 24) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1820— PlayerScreenKt.EpisodeListPanel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HomeScreenKt.RecentWatchingRow (cognitive 24) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1272— HomeScreenKt.RecentWatchingRow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiveChannelItemKt.LiveChannelItem (cognitive 23) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelItem.kt:43— LiveChannelItemKt.LiveChannelItem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DoubanScraper.getCastAndCrew (cognitive 22) app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:35— DoubanScraper.getCastAndCrew has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (6 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.
VersionUpdateDialogKt.VersionUpdateDialog (cognitive 22) app/src/main/java/com/lomen/tv/ui/components/VersionUpdateDialog.kt:46— VersionUpdateDialogKt.VersionUpdateDialog has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, match/switch 3 (6 pts), boolean chains 4 (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.
DetailScreenKt.ManualMetadataEditDialog (cognitive 22) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:738— DetailScreenKt.ManualMetadataEditDialog has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, 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.
SkipConfigDialogKt.SkipConfigDialog (cognitive 21) app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt:66— SkipConfigDialogKt.SkipConfigDialog has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 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.
LiveClassicPanelChannelListKt.LiveClassicPanelChannelItem (cognitive 19) app/src/main/java/com/lomen/tv/ui/live/components/LiveClassicPanelChannelList.kt:142— LiveClassicPanelChannelListKt.LiveClassicPanelChannelItem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsScreenKt.PlaybackSettingsSection (cognitive 19) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1129— SettingsScreenKt.PlaybackSettingsSection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GuangyaApiClient.listAllVideoFiles (cognitive 18) app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:352— GuangyaApiClient.listAllVideoFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 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.
SettingsScreenKt.HomeSettingsSection (cognitive 18) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:893— SettingsScreenKt.HomeSettingsSection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WebDavClient.parseHtmlDirectoryListing (cognitive 17) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:383— WebDavClient.parseHtmlDirectoryListing has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetadataService.getCastAndCrew (cognitive 17) REDACTED:263— MetadataService.getCastAndCrew has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 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.
DetailScreenKt.HeroSection (cognitive 17) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:406— DetailScreenKt.HeroSection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SettingsScreenKt.getWifiIpAddress (cognitive 17) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3696— SettingsScreenKt.getWifiIpAddress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2, error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebDavConfigDialogKt.testWithGetMethod (cognitive 17) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1158— WebDavConfigDialogKt.testWithGetMethod has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 5, boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuangyaApiClient.listByParentId (cognitive 16) app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:286— GuangyaApiClient.listByParentId has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebDavClient.listFiles (cognitive 16) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:78— WebDavClient.listFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, 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.
WebDavConfigDialogKt.testAListConnection (cognitive 16) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1262— WebDavConfigDialogKt.testAListConnection has cognitive complexity 16 (threshold 15). Drivers by points: error handling 6, match/switch 3 (5 pts), if/else 3, boolean chains 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent 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· Near-duplicate member family (4 members, 35 shared lines) · ×1
Near-duplicate member family (4 members, 35 shared lines) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1362— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1362-1527 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2155-2284 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2293-2437 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:196-353 — These 4 members are variants of one another: a block of 35 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, 32 shared lines) · ×1
Near-duplicate member family (4 members, 32 shared lines) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2042— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2042-2102 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2112-2172 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2182-2234 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:2244-2304 — These 4 members are variants of one another: a block of 32 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 (86 shared lines) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:607— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:607-751 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:756-886 — These two members are variants of one another: 86 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 (53 shared lines) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1603— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1603-1677 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1871-1960 — These two members are variants of one another: 53 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) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2478— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2478-2605 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1479-1590 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2032-2154 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2166-2294 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2305-2555 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2629-2797 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1515-1632 — 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 (110 corresponding lines) · ×1
Edited copy of a member (110 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:316— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:316-440 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:447-556 — These two members are one piece of code written twice and then edited apart: 110 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (106 corresponding lines) · ×1
Edited copy of a member (106 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1916— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1916-2022 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2041-2146 — These two members are one piece of code written twice and then edited apart: 106 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (114 corresponding lines) · ×1
Edited copy of a member (114 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:337— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:337-465 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1395-1508 — These two members are one piece of code written twice and then edited apart: 114 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1068— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1068-1125 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1288-1345 — 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 copy of a member (89 corresponding lines) · ×1
Edited copy of a member (89 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1580— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1580-1681 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1718-1806 — These two members are one piece of code written twice and then edited apart: 89 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 63+ corresponding lines) · ×1
Edited copies of one member (3 members, 63+ corresponding lines) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:119— app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:119-187 | app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:352-414 | app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:448-528 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 63 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1386— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1386-1446 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1453-1523 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (70 corresponding lines) · ×1
Edited copy of a member (70 corresponding lines) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:31— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:31-100 | app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:319-388 — 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 (57 corresponding lines) · ×1
Edited copy of a member (57 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1036— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1036-1092 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1095-1155 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) REDACTED:586— REDACTED:586-615 | REDACTED:617-646 — 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:543— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:543-583 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:597-651 — 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 copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) REDACTED:132— REDACTED:132-161 | REDACTED:224-253 | REDACTED:353-382 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) REDACTED:307— REDACTED:307-328 | REDACTED:330-351 | REDACTED:563-584 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) app/src/main/java/com/lomen/tv/data/remote/parser/EpgParser.kt:68— app/src/main/java/com/lomen/tv/data/remote/parser/EpgParser.kt:68-105 | app/src/main/java/com/lomen/tv/data/remote/parser/LiveSourceParser.kt:55-85 — 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 (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/search/SearchScreen.kt:349— app/src/main/java/com/lomen/tv/ui/screens/search/SearchScreen.kt:349-387 | app/src/main/java/com/lomen/tv/ui/screens/search/SearchScreen.kt:395-443 — 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) · ×1
Edited copy of a member (34 corresponding lines) app/src/main/java/com/lomen/tv/ui/components/InfoPillToast.kt:38— app/src/main/java/com/lomen/tv/ui/components/InfoPillToast.kt:38-71 | app/src/main/java/com/lomen/tv/ui/components/WhitePillToast.kt:41-74 — 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 copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) app/src/main/java/com/lomen/tv/data/scraper/MediaInfoExtractor.kt:465— app/src/main/java/com/lomen/tv/data/scraper/MediaInfoExtractor.kt:465-486 | app/src/main/java/com/lomen/tv/data/scraper/MediaInfoExtractor.kt:496-518 | app/src/main/java/com/lomen/tv/data/scraper/MediaInfoExtractor.kt:528-545 — 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 copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) REDACTED:187— REDACTED:187-218 | REDACTED:408-439 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:126— app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:126-150 | app/src/main/java/com/lomen/tv/data/scraper/DoubanScraper.kt:189-214 — 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 (4 members, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt:304— app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt:304-322 | app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:436-461 | app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:745-770 | app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:1065-1083 — 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 copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1196— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1196-1228 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1499-1534 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:63— app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:63-87 | app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:94-118 | app/src/main/java/com/lomen/tv/domain/service/QuarkService.kt:121-147 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:46— app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:46-66 | app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:69-87 | app/src/main/java/com/lomen/tv/data/repository/ResourceLibraryRepository.kt:101-116 — 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 copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) REDACTED:778— REDACTED:778-788 | REDACTED:814-824 — 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 (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:87— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:87-117 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:179-196 — 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 (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:219— app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:219-234 | app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:236-248 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:772— app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:772-785 | app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:787-803 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInput.kt:21— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInput.kt:21-40 | app/src/main/java/com/lomen/tv/ui/live/components/LiveDateTimeBar.kt:69-87 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×1
Edited copy of a member (12 corresponding lines) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1530— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1530-1541 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:355-366 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:68— app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:68-83 | app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt:115-131 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 8+ corresponding lines) · ×1
Edited copies of one member (6 members, 8+ corresponding lines) app/src/main/java/com/lomen/tv/data/preferences/LiveSettingsPreferences.kt:150— app/src/main/java/com/lomen/tv/data/preferences/LiveSettingsPreferences.kt:150-157 | app/src/main/java/com/lomen/tv/data/preferences/LiveSettingsPreferences.kt:162-169 | app/src/main/java/com/lomen/tv/data/preferences/LiveSettingsPreferences.kt:352-360 | app/src/main/java/com/lomen/tv/data/preferences/LiveSettingsPreferences.kt:365-372 | app/src/main/java/com/lomen/tv/data/preferences/LiveSettingsPreferences.kt:387-395 | app/src/main/java/com/lomen/tv/data/preferences/LiveSettingsPreferences.kt:400-407 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1237— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1237-1247 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:168-177 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) app/src/main/java/com/lomen/tv/domain/model/MediaType.kt:15— app/src/main/java/com/lomen/tv/domain/model/MediaType.kt:15-18 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:1577-1580 | app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:107-110 — 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 (89–90 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2156— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2156-2245 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2294-2382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (78 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:317— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:317-394 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:448-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (56–57 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1917— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1917-1973 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2042-2097 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1917` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (53–54 lines × 2) app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:678— app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:678-731 | app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:814-866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt:678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (51 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:261— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:261-311 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:314-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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:261` 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 (50 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1412— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1412-1461 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:243-292 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1412` it begins part-way through the construct above it, so those 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 `modifier` to `Modifier = Modifier` in one and `modifier =` 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 (35–36 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3360— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3360-3394 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3462-3496 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3564-3599 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3360` 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 (35 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1976— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1976-2010 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2100-2134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1976` 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) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:731— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:731-763 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:794-826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:731` 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 (32 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:433— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:433-464 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1477-1508 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:433` 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: `MaterialTheme` names `androidx.compose.material3.MaterialTheme` in one and `androidx.tv.material3.MaterialTheme` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (29–30 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:555— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:555-583 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:622-651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:555` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:268— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:268-296 | app/src/main/java/com/lomen/tv/ui/screens/favorites/FavoritesScreen.kt:160-188 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:148-176 — 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 `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:268` it does not close everything it opens, so those exact lines 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–27 lines × 6) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2482— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2482-2508 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1489-1514 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2035-2061 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2169-2194 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2324-2350 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2641-2666 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2482` it does not close everything it opens, so those 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, `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2479` calls `FocusRequester` and `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2032` 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 (27 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1298— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1298-1324 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1367-1393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1298` 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, `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1394` calls `bringIntoView` and `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1325` 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–26 lines × 2) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:126— app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:126-151 | app/src/main/java/com/lomen/tv/data/guangya/GuangyaApiClient.kt:359-382 — 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 `app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:836— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:836-861 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1632-1657 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:836` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: `MaterialTheme` names `androidx.compose.material3.MaterialTheme` in one and `androidx.tv.material3.MaterialTheme` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:869— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:869-893 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:490-514 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:869` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (24 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:148— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:148-171 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:173-196 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:198-221 — 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:146` calls `when` and `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:171` 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 (23–24 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2125— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2125-2148 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2265-2287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2125` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1125— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1125-1148 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1214-1237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1125` 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 × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:434— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:434-455 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1478-1499 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1601-1623 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:434` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22–23 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/favorites/FavoritesScreen.kt:241— app/src/main/java/com/lomen/tv/ui/screens/favorites/FavoritesScreen.kt:241-263 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:217-238 — 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 `app/src/main/java/com/lomen/tv/ui/screens/favorites/FavoritesScreen.kt:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelList.kt:57— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelList.kt:57-78 | app/src/main/java/com/lomen/tv/ui/live/components/LiveFavoriteList.kt:33-53 — 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 `app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelList.kt:57` 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 (20–21 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:403— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:403-422 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:882-902 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1447-1466 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:403` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:401` calls `fillMaxWidth`, `padding` and `app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:881` 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–20 lines × 6) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1307— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1307-1325 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1332-1351 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1977-1995 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2000-2019 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2101-2119 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2124-2143 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1307` it begins part-way through the construct above it, so those 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) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2099— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2099-2118 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2239-2257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2099` 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–18 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1460— app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1460-1475 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1497-1512 | app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1545-1562 — 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 `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1460` it does not close everything it opens, so those 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, `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1496` calls `Spacer`, `height`, `scale` and `app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt:1459` 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–17 lines × 7) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2492— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2492-2508 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1498-1514 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2045-2061 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2178-2194 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2334-2350 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2650-2666 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:1542-1555 — there are 7 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2492` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2352` calls `height` and `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2510` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 4) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1452— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1452-1468 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2254-2270 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2407-2423 | app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt:283-299 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/recentwatching/RecentWatchingScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `modifier` to `Modifier = Modifier` in one and `modifier =` 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 (14–17 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1044— app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1044-1057 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:1596-1612 — 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 `app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt:1044` 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 (16–17 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1235— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1235-1251 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1336-1351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1235` it begins part-way through the construct above it, so those 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, `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1335` calls `padding` and `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1234` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1069— app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1069-1086 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1289-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1069` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30–31 lines × 4) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:371— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:371-400 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:502-531 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2221-2251 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2358-2388 — before extracting anything, compare `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt` and `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:371` it begins part-way through the construct above it, so those exact lines 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) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:805— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:805-819 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1604-1619 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1872-1887 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:805` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:802` calls `Composable` and `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1601` 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 × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:845— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:845-860 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1641-1656 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:1909-1924 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:845` it begins part-way through the construct above it, so those exact lines 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 × 7) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:550— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:550-564 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:580-594 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:610-624 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:640-654 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:670-684 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:700-714 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:730-744 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:550` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 4) app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:249— app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:249-263 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:278-291 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:388-401 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:456-470 — 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. 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) REDACTED:59— REDACTED:59-71 | REDACTED:93-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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 (12–14 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:196— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:196-209 | app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:370-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:196` 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 × 4) app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:148— app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:148-160 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:173-185 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:198-210 | app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:230-242 — 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 `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:146` calls `when` and `app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:171` 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) app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:125— app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt:125-137 | app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt:608-619 — before extracting anything, compare `app/src/main/java/com/lomen/tv/data/scraper/MediaScraper.kt` and `app/src/main/java/com/lomen/tv/data/scraper/SmartMediaScraper.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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.
Duplicated block (11–13 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1196— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1196-1206 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1292-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 `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1196` it begins part-way through the construct above it, so those exact lines 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 × 5) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2540— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2540-2552 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2093-2105 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2233-2245 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2497-2509 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2727-2738 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt: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, `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2553` calls `focusRequester` and `app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2510` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 7) app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2545— app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2545-2555 | app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2574-2584 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2098-2108 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2238-2248 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2383-2393 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2731-2741 | app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:2763-2773 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:2545` it does not close everything it opens, so those exact lines 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) app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:678— app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:678-688 | app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:713-722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:712` calls `method` and `app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:677` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–11 lines × 2) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1055— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1055-1065 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:179-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1055` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInput.kt:22— app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInput.kt:22-30 | app/src/main/java/com/lomen/tv/ui/live/components/LiveDateTimeBar.kt:70-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInput.kt:22` it does not close everything it opens, so those 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–9 lines × 2) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:71— app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:71-79 | app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:258-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 `app/src/main/java/com/lomen/tv/data/alist/AListClient.kt: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.
Duplicated block (7 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:194— app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:194-201 | app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:369-375 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:753-759 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:194` it begins part-way through the construct above it, so those exact lines 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–12 lines × 3) REDACTED:312— REDACTED:312-323 | REDACTED:599-607 | REDACTED:765-776 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:599` it does not close everything it opens, so those 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, `REDACTED:607` calls `optDouble`, `toFloat` and `REDACTED:323` 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–7 lines × 2) REDACTED:341— REDACTED:341-346 | REDACTED:806-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:341` 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 (7 lines × 4) app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1594— app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1594-1600 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1632-1638 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1674-1680 | app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1992-1998 — 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 `app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1594` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:538— app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:538-548 | app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:1059-1069 | app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt:183-188 — 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 `app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt:538` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Swallowed exception (empty catch) app/src/main/java/com/lomen/tv/data/alist/AListClient.kt:214— 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 predicate app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt:3723— `!address.isLoopbackAddress && address is java.net.Inet4Address` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt, app/src/main/java/com/lomen/tv/ui/viewmodel/TmdbApiViewModel.kt. 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 app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt:302— `!address.isLoopbackAddress && address.hostAddress?.contains(":") == false` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt, app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt. 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 app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt:72— `channel.urlList.isNotEmpty() && channelUrlIdx < channel.urlList.size` appears character-identically in 3 files — app/src/main/java/com/lomen/tv/ui/live/components/LiveChannelInfo.kt, app/src/main/java/com/lomen/tv/ui/live/components/LiveStatusBar.kt, app/src/main/java/com/lomen/tv/ui/live/components/LiveTempPanel.kt. 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 app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt:1865— `keyEvent.key == Key.Back && keyEvent.type == KeyEventType.KeyUp` appears character-identically in 7 files — app/src/main/java/com/lomen/tv/ui/player/PlayerScreen.kt, app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt, app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt, app/src/main/java/com/lomen/tv/ui/screens/settings/GuangyaLoginDialog.kt. 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 app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt:196— `keyEvent.key == Key.DirectionUp || keyEvent.key == Key.DirectionDown || keyEvent.key == Key.DirectionLeft || keyEvent.key == Key.DirectionRi…` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/ui/screens/settings/LiveSettingsComponents.kt, app/src/main/java/com/lomen/tv/ui/screens/settings/WebDavConfigDialog.kt. 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 app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt:70— `library.username.isNotEmpty() && library.password.isNotEmpty()` appears character-identically in 3 files — app/src/main/java/com/lomen/tv/data/webdav/WebDavClient.kt, app/src/main/java/com/lomen/tv/domain/service/MediaUrlResolver.kt, app/src/main/java/com/lomen/tv/ui/screens/home/ResourceLibraryScreen.kt. 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 app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:499— `media.rating != null && media.rating > 0` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt, app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt. 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 app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt:156— `playbackInfo != null && playbackInfo.videoPath != null` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/ui/navigation/LomenTVNavigation.kt, app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt. 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 app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt:368— `series.rating != null && series.rating > 0` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/ui/screens/category/CategoryScreen.kt, app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt. 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 app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt:858— `showVersionUpdateDialog && versionInfo != null` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/ui/screens/home/HomeScreen.kt, app/src/main/java/com/lomen/tv/ui/screens/settings/SettingsScreen.kt. 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 app/src/main/java/com/lomen/tv/domain/model/MediaType.kt:15— `this == MediaType.TV_SHOW || this == MediaType.VARIETY || this == MediaType.ANIME || this == MediaType.DOCUMENTARY` appears character-identically in 3 files — app/src/main/java/com/lomen/tv/domain/model/MediaType.kt, app/src/main/java/com/lomen/tv/ui/player/PlayerViewModel.kt, app/src/main/java/com/lomen/tv/ui/screens/detail/DetailScreen.kt. 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 app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt:57— `uri == "/api/tmdb/config" && method == Method.POST` appears character-identically in 2 files — app/src/main/java/com/lomen/tv/service/TmdbApiConfigServer.kt, app/src/main/java/com/lomen/tv/service/WebDavConfigServer.kt. 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.
Silent fallback default in catch app/src/main/java/com/lomen/tv/domain/service/VersionCheckService.kt:78— `parseVersionCode` swallows every exception into `0` — 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 app/src/main/java/com/lomen/tv/ui/screens/search/SearchViewModel.kt:117— `searchOnline` swallows every exception into `emptyList()` — 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.
Fat interface: WebDavMediaDao (17 abstract methods) app/src/main/java/com/lomen/tv/data/local/database/dao/WebDavMediaDao.kt:12— `WebDavMediaDao` declares 17 abstract methods: `getAllSync`, `getByLibraryId`, `getMoviesByLibraryId`, `getTvShowsByLibraryId`, `getByFilePath`, `getCreatedAtByFilePaths`, `getById`, `insert`, `insertAll`, `update`, `deleteByLibraryId`, `deleteByFilePath`, `deleteAll`, `countByLibraryId`, `search`, `getFingerprintsByLibraryId`, `deleteByFilePaths`. Counted over its public functions with no body, once per name; default-bodied functions and properties are not counted, because no implementer 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.
D16 · Bus Factor· Small-team knowledge concentration · ×1
Small-team knowledge concentration — 23 file(s) are concentrated to one author — the ambient state with 2 active author(s), not 23 separate risks. The signal becomes meaningful as ownership spreads; no per-file action implied now.
No ADRs found app/build.gradle.kts:2— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `app/build.gradle.kts` makes this repository a deployable product (line 2).
D28 · Secrets (history)· Rotate the exposed credentials · ×1
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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 app/build.gradle.kts:70— `app/build.gradle.kts` 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 changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X2 · Cancellation propagation· Not all suspend functions that make a request accept the coroutine's cancellation · ×1
Not all suspend functions that make a request accept the coroutine's cancellation — Only 0/27 suspend functions that make a cancellable request (Ktor, OkHttp newCall, URL streams) accept the coroutine's cancellation 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. In a suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `app/src/main/java/com/lomen/tv/ui/player/SkipConfigDialog.kt` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
0
—
Run 01a1e844-1d2c-7278-b164-906ab651cf94 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 5 · Warnings: 431 · Recommendations: 24 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 06:49 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.